Add persistent route on CentOS

Posted . Visible to the public.

Create route-ethX file in: /etc/sysconfig/network-scripts/

ADDRESS0=x.x.x.x
NETMASK0=x.x.x.x
GATEWAY0=x.x.x.x

Example: We want to route two networks

192.168.6.0/24 and 192.168.5.0/24 through 10.10.16.231

ADDRESS0=192.168.6.0
NETMASK0=255.255.255.0
GATEWAY0=10.10.16.231

ADDRESS1=192.168.5.0
NETMASK1=255.255.255.0
GATEWAY1=10.10.16.231

NB: Do not forget to increment the number for every route:
ADDRESS(X)
NETMASK(X)
GATEWAY(X)

Andreas Wagner
Tags
Posted by Andreas Wagner to Toolbox Cash on Go's deck (2015-06-11 15:33)