How do I set up static routing on the API Gateway?
Release: 10
Component: Gateway
Modification of Static Routes will require that the administrator connects to the root shell to add additional configuration. The steps below will outline what is required to enable this.
any net <NETWORK> netmask <NETMASK> gw <GATEWAY> <DEV>
any net 172.16.0.0 netmask 255.240.0.0 gw 192.168.0.1 eth0
any net 10.0.0.0 netmask 255.0.0.0 gw 192.168.0.1 eth0
Alternative method
Add a new file /etc/sysconfig/network-scripts/route-ens160 with ens160 representing the interface value. This is the default interface with one NIC present in the virtual Gateway. You can get the interface name by running the following command:
[root@ssg10 network-scripts]# service network status
Configured devices:
lo ens160
Currently active devices:
lo ssg_eth0
In this example, the interface name is ens160. This name should also match the configuration file (ifcfg-ens160) in network-scripts folder.
For every interface, a file needs to be created that associates static routes with the interface. There are 2 syntaxes that can be used.
GATEWAY#=<gateway>
NETMASK#=<netmask>
ADDRESS#=<network>
Example GATEWAY0=192.168.108.2
NETMASK0=255.255.255.0
ADDRESS0=192.168.34.0
GATEWAY1=192.168.108.2
NETMASK1=255.255.0.0
ADDRESS1=10.1.0.0
<network/cidr> via <gateway>
10.0.0.0/8 via 192.168.108.2
192.168.32.0/24 via 192.168.108.2
Once all the static routes are in place, reboot the Gateway to ensure that all routes are properly established.