hello. i am doing a project about implementing the linux route command with php. i have managed to see the IP tables using route but the problem now is implementing route add / route del. i have searched the web and came up with some examples but none of them work. i am running fedora 6 and have stopped SElinux since i read somewhere that it may give trouble with user rights and all.
here are some of the examples i have tried:
$answer = system("route del 192.168.183.5",$ret_val);
echo "test ".$ret_val;
with this one i get a return value of 7 which i believe it's an error code since it should be 0, couldn't find it anywhere
$add = shell_exec("/sbin/route del 192.168.183.5");
echo `route del 192.168.183.4`;
$defaultRoute = shell_exec("route add 192.168.183.8 gateway 192.168.183.2");
i even tried one with sudo and still nothing.
can anyone please help me since i am really puzzled about this. thanks