Linux Scroll

Just another WordPress.com site

Centos add persistence static route

Static route configuration file:

/etc/sysconfig/network-scripts/route-interface file

Static route conf file for eth0:

/etc/sysconfig/network-scripts/route-eth0

IP Command Arguments Format
The following is a sample route-eth0 file using the IP command arguments format. The default gateway is 192.168.1.1, interface eth0. The two static routes are for the 10.10.10.0/24 and 172.16.1.0/24 networks:

default 192.168.1.1 dev eth0

10.10.10.0/24 via 192.168.1.1 dev eth0
172.16.1.0/24 via 192.168.1.1 dev eth0

Network/Netmask Directives Format
The following is a sample route-eth0 file using the network/netmask directives format. The default gateway is 192.168.1.1, interface eth0. The two static routes are for the 10.10.10.0/24 and 172.16.1.0/24 networks:

ADDRESS0=10.10.10.0

NETMASK0=255.255.255.0
GATEWAY0=192.168.1.1
ADDRESS1=172.16.1.0
NETMASK1=255.255.255.0
GATEWAY1=192.168.1.1

The 10.10.10.0/24 and 172.16.1.0/24 networks would use the default gateway anyway.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: