Gateway

We can add or delete the default gateway at run-time using the route command. The default gateway tells us where to send the packet if none of the network or host entry in routing table matches with the destination IP address of packet.

The following command line is used to delete the default gateway from the routing table:

$ route del default gw <ip_address_of_default_gateway>

The following command line is used to add the default gateway in the routing table:

$ route add default gw <ip_address_of_default_gateway>

To add same permanent gateway for all the interfaces, we can modify the /etc/sysconfig/network file and add the following entry:

GATEWAY=<ip_address_of_new_default_gateway>

To assign different gateway entries for each interface, we modify the /etc/sysconfig/network-scripts/ifcfg-<interfacename> configuration file as follows:

GATEWAY=<ip_address_of_new_default_gateway>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.219.217