lost and found ( for me ? )

How to add static routes permanently on CentOS 5.5 or Ubuntu 10.10


Create /etc/sysconfig/network-script/route-eth[x] file.
[x] means interface number.

Here’s an example of adding a static route on eth0
# cat /etc/sysconfig/network-scripts/route-eth0 via

[destination] via [gateway’s IP]


add static route in /etc/network/interfaces file and then do “/etc/init.d/networking restart” to reflect on it
# add static route
up route add -net gw dev eth0

up route add [-host/-net] [address] gw [gateway’s IP] dev [interface number]

# /etc/init.d/networking restart

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.