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

I have an RHEL3 server on which I would like to change my default route. Every site I've seen that shows how to do this ends with doing "service network restart" or "/etc/init.d/network restart".

I've got applications running which I assume will not take kindly to having the ethernet interface restarted and I'm wondering if there's any less drastic to just remove the old route and add a new one without having to completely restart networking.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You can change your default route with 'ip' command. Before you read next - it's very likely that you'll lost connection to your server after using those commands. Be very careful. All changes with ip command are temporary (to next change, or reboot)

  • For help type:

ip route help

  • Example command to replace default gateway to IP:

ip route replace default via IP

  • Example command to remove default gateway and add IP:

ip route delete default

ip route add default via IP ...

  • You can also use device name:

ip route replace default dev ppp0

share|improve this answer
    
Worked like a charm. –  Keith Wolters Dec 2 '12 at 12:28

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.