RHCE Route IP Traffic

RHCE Objective: Route IP traffic and create static routes

In most cases, you’ll use routing when you have a multi-homed system. A server with an interface on one network and one or more interfaces on a different network. You’d do this for bastion hosts (public interface, private interface) for example or if you want to keep maintenance traffic like backups or general admin access away from the production traffic.

Under RH6 route information was located in /etc/sysconfig/network-scripts/route-interface. You can set up default and static routes and reload the interface (ifdown/ifup), reload the network (service network restart), or just reboot the system (depending on the system not a bad idea, to ensure the routes are configured and will come back after a boot).

default via 10.105.12.254

You can also add routes on the command line using the route command, route add net 10.100.0.0/16 gw 10.105.12.254 dev eth1. Of course if you want to maintain this info, you’ll need to add it to the file(s) as noted above. Note for the file, you use ‘via’ but on the command line, you’d use ‘gw’.

10.100.0.0/16 via 10.105.12.254 dev eth1

The ip command has been available for some years now and ip route add and ip route del are the new ways of managing routes. The command line is similar but not exactly the same.

ip route add 10.100.0.0/16 via 10.105.12.254 dev eth1

Note no net option. By adding the CIDR of /16, you’re telling ip that it’s a network vs a single host (/32).

NetworkManager

One of the issues with RH7 are the new tools such as NetworkManager. For a workstation, especially a wireless user, using NetworkManager is helpful. It offers a simple method of managing network interfaces. But you should not be using NetworkManager in a server environment.

This entry was posted in Computers and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *