Is there any way to delete a route from a linux routing table?
This turns out to be harder than i thought The routes I want to delete are the "!" rejected routes, but I can't seem to formulate the right "route del" command to pull it off.
Here is the routing table...
Destination Gateway Genmask Flags Metric Ref Use Iface
67.40.227.206 * 255.255.255.255 UH 0 0 0 ppp0
192.168.46.79 * 255.255.255.255 UH 0 0 0 ipsec0
192.168.46.79 - 255.255.255.255 !H 2 - 0 -
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
10.1.0.0 * 255.255.0.0 U 0 0 0 ipsec0
10.1.0.0 - 255.255.0.0 ! 2 - 0 -
default * 0.0.0.0 U 3 0 0 ppp0
default * 0.0.0.0 U 4 0 0 ppp0
I have two entries for 192.168.46.79 and 10.1.0.0. These are generated automatically by the little linux-based router i use I can ping the IPSEC tunnels from the shell itself, but traffic from the LAN takes the second route (the rejected "!" or "!H" route) for reasons I simply don't understand.
Best Answer
with the route -n
command you'll obtain
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.178.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 160.98.123.1 0.0.0.0 UG 600 0 0 wlan0
sudo route del -net 0.0.0.0 gw 192.168.178.1 netmask 0.0.0.0 dev eth0
you'll get all parameters respectively from above