Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 1 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


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.