Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm configuring some network stuff, and every time I try something the connection breaks. Thinking that I must be configuring something incorrectly to break all connections, I did a bit of troubleshooting, to find out that on a fresh boot all networks are working. If I run the command ip rule flush I lose all connectivity until I reboot.

I'm using Kubuntu 12.04 network manager connecting via wireless adapter. Any help appreciated

share|improve this question
    
could you post the output of 'ip rule show' just after reboot? –  Serge Sep 23 '12 at 17:07
add comment

migrated from serverfault.com Sep 23 '12 at 20:35

This question came from our site for professional system and network administrators.

2 Answers

I believe this is to be expected.

When you boot there is a rule numbered 32766, as follows:

 32766: from all lookup main

main is the route table normally set up, so unless you have made special preparations you need it. When you enter the ip rule flush command it is deleted.

You can add this rule again after flushing by executing:

 sudo ip rule add from all lookup main pref 32766

I tried this out and, like you, when I did the flush I lost connectivity, and when I re-added it I regained it.

This is the normal set of rules on my 12.04 Ubuntu system:

 0: from all lookup local   
 32766: from all lookup main   
 32767: from all lookup default   

Similarly you could also:

ip rule add from all lookup default pref 32767

So the script should be something like this:

ip rule flush

ip rule add from all lookup main pref 32766

ip rule add from all lookup default pref 32767

share|improve this answer
add comment

are you sure you are not trying to do the following command instead?

ip ru flush cache

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.