Configure advanced routing, NIC gateways

SUMMARY

Allow routing outside of the default gateway to alternate subnets or use additional NICs to segment network traffic.

ISSUE

Allow routing outside of the default gateway to alternate subnets.
Use additional NICs to segment network traffic.

 

RESOLUTION

Two gateways cannot be used, so an alternate routing script using Route-eth* must be used.

To create a special routing script:

  1. Connect to the appliance via SSH
  2. Go to the network-scripts directory:
    cd /etc/sysconfig/network-scripts
  3. Create a file called "route-ethX" where X is the NIC being used for routing.  For example, "route-eth1".
  4. Within the file, define the networks to be used.  Each network must be defined or routing will fail.  An example of route-eth1:
    GATEWAY0=192.168.21.1
    NETMASK0=255.255.255.0
    ADDRESS0=192.168.21.40
    
    GATEWAY1=192.168.21.1
    NETMASK1=255.255.255.0
    ADDRESS1=192.168.1.0
    
    GATEWAY2=192.168.21.1
    NETMASK2=255.255.255.0
    ADDRESS2=192.168.2.0

Note: The first entry must always contain an IP address on the same subnet as the gateway. The gateway values are the IP address of the device/router we need to route through.

An alternate method would be to add a static route, then put the entry into /etc/rc.local to run at startup.

CAUSE

Having more than one gateway is prohibited.

NOTES

While additional NICs have the benefit of segmenting network traffic they are not required for advanced routing.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Contact us