Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is there a way to add a route in Linux with the Dynamic flag set? The reason I want to do this is to troubleshoot an issue where there exist identically static and dynamic routes, and what happen if I try to delete the static route.

We suspect that the dynamic route was removed, and not the static route.

I have tried:

route add -net 192.168.100.0/24 gw 192.168.0.1 dyn

But route -n only show the flags UG.

share|improve this question

1 Answer 1

Try:

ip route add 192.168.100.0/24 via 192.168.0.1

could be written as

ip r a 192.168.100.0/24 via 192.168.0.1

there's some trace found in my history.

ip route add 192.168.100.0/24 via 192.168.0.1 scope global dev eth0

You could even add a secondary ip address to same link;

ip a a 192.168.100.210/24 dev eth0 label eth0:test

ip is a full featured iproute2 tool. But as low level, you may have to ip address add before ip route add... So please, RTFM ;-)

man -Pless\ +/^ip.route ip
share|improve this answer
    
Thanks for reply, but I do not see how this command add the route with the D flag. –  Dog eat cat world Jan 8 '13 at 8:10
1  
I think you misunderstand dynamic route meaning. If I rightly understand you ask, you can't. Did you already browse http://lartc.org the linux advanced routing & traffic control documentation? –  F. Hauri Jan 8 '13 at 9:29

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.