22 авг. 2014 г.

on

Linux configure default gateway using route command

1. Check whether you have already configured default gateway:

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.0.0      *               255.255.255.0   U     1      0        0 eth3
192.168.88.0    *               255.255.255.0   U     1      0        0 eth2
10.1.1.0        *               255.255.255.0   U     1      0        0 eth1
192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0

2. If you have no default gateway you can use the command above to add it:

$ route add default gw {ip-address} {interface-name}
Where,
  • IP-ADDRESS: Specify router IP address
  • INTERFACE-NAME: Specify interface name such as eth0

Example:
$ route add default gw 172.16.0.1 eth3




Технологии Blogger.