
Static routing is the term used to refer to the manual method used to set up routing. An administrator enters routes into the router using configuration commands. This method has the advantage of being predictable, and simple to set up. It is easy to manage in small networks but does not scale well.
Question: How can I save
static routes I set up in my
Fedora/RedHat/
CentOS Linux after I
reboot server?
Answer: In Fedora Linux (or RedHat, CentOS) you can set up static routes for certain network interface (for example eth1) by editing file
/etc/sysconfig/network-scripts/route-eth1.
For example, you have to save static route added by the following command:
route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.100.1 dev eth1
To do it, just add the following line to /etc/sysconfig/network-scripts/route-eth1:
ADDRESS0=192.168.0.0
NETMASK0=255.255.255.0
GATEWAY0=192.168.100.1
Related Posts