How to add and delete gateways in Linux system
How to add and delete gateways in Linux system:
1. Temporarily add Gateway
Route add default gw x.x.x.x temporarily adds gateway, effective immediately
two。 Permanently add a gateway:
Vim / etc/sysconfig/network-scripts/ifcfg-eth0GATEWAY=x.x.x.x or vim / etc/rc.local..route add default gw x.x.x.x
Note:
Add a gateway can only add an IP in your existing routing network segment. Add a gateway without specifying the subnet mask (because it is the ip of an existing network segment, so the mask has been confirmed) how to delete the gateway route del default gw x.x.x.x temporarily delete the gateway, effective immediately