User Tools

Site Tools


linux:linux-networking:redhat-route

Redhat Route

route-ethX

/etc/sysconfig/network-scripts/route-ethX

Various startup & control scripts in RHEL expect networking to be setup in a certain way. When it is, failures/stops/starts/restarts/reloads will work smoothly on the server.

Here is the recommended method for setting up additional network routes;

  • Create a separate routing file for any additional routes, with the routes in the relevant files based on the Gateway they use.
  • The name of the file should be route-NIC, with NIC being the network interface name in question.
  • The file needs to have the three variables (ADDRESS, NETMASK & GATEWAY) numbered sequentially, starting from 0.
  • Subsequent static routes must be numbered sequentially, and must not skip any values. For example, ADDRESS0, ADDRESS1, ADDRESS2, and so on.
[root@fworksapp1 network-scripts]# cat route-bond1 
ADDRESS0=172.16.68.0
NETMASK0=255.255.255.0  
GATEWAY0=172.16.103.254

ADDRESS1=10.13.5.80
NETMASK1=255.255.255.255
GATEWAY1=172.16.103.254

Here's a table showing common examples of translations between subnets, notations & netmasks;

Netmask Notation Hosts
255.255.0.0 /16 65534 hosts
255.255.255.0 /24 254 hosts
255.255.255.224 /27 30 hosts
255.255.255.240 /28 14 hosts
255.255.255.255 /32 1 host

document from Redhat here

There are resources on the internet that can aid in calculation of further Netmasks/Notations.
(ask Google to help you find your favourite)

linux/linux-networking/redhat-route.txt · Last modified: by 127.0.0.1