IBM Support

Set a default routing gateway

Question & Answer


Question

How do I set a default routing gateway for my NPS server?

Answer

To add or change the gateway, run the following command as the root user:

route add default gw 192.168.0.1

To make the assignment permanent, as root user, edit the file /etc/sysconfig/network by changing or adding the following line:

GATEWAY=192.168.0.1


You can confirm the change by running one of the following commands:

  • /sbin/route
  • /bin/netstat -rn

The following is sample output:

$ /sbin/route
Kernel IP routing table
Destination  Gateway      Genmask         Flags Metric Ref   Use Iface
192.168.0.0  *            255.255.255.0   U     0      0     0   eth0
10.0.0.0     *            255.255.0.0     U     0      0     0   eth1
default      192.168.0.1  0.0.0.0         UG    0      0     0   eth0







=====
=====ORIGINAL INFO LISTED BELOW========
=====SAVED==============================
To add or change the gateway, run the following command as the root user:

route add default gw 192.168.0.1

To make the assignment permanent, as root user, edit the file /etc/sysconfig/network by changing or adding the following line:

GATEWAY=192.168.0.1


You can confirm the change by running one of the following commands:
  • /sbin/route
  • /bin/netstat -rn

The following is sample output:

[nz@npsserver ~]$ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
10.0.0.0 * 255.255.0.0 U 0 0 0 eth1
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ175616

Document Information

More support for:
IBM PureData System

Software version:
1.0.0

Document number:
461235

Modified date:
17 October 2019

UID

swg21568854