IBM Support

IBM PureData for Analytics - How to add a static route permanently

Question & Answer


Question

When you want to add a static route permanently on the host, you need to add it to a file so that it takes effect after OS reboots.

Answer

You need to add the static configuration to a file "route-XXX" under /etc/sysconfig/network-scripts/ directory. XXX is the network interface name that you add the static route to.

For example, if you want to add the following static route permanently
/sbin/route add -net 10.20.30.0 netmask 255.255.225.0 gw 123.4.5.6 bond1

You want to create the following file (if not exist),

/etc/sysconfig/network-scripts/route-bond1

and add the following

ex)
GATEWAY1=123.4.5.6
ADDRESS1=10.20.30.0
NETMASK1=255.255.225.0

If the file already exists and has some static routes, you need to change the number after the GATEWAY#, ADDRESS# and NETMASK# so that it does not become duplicate.
For example, if there are two existing static route in the file, you need to change the number to 3:

ex)
GATEWAY3=123.4.5.6
ADDRESS3=10.20.30.0
NETMASK3=255.255.225.0

.

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
17 October 2019

UID

swg21698754