Command to know your default gateway

Written By Smart| 27 July 2009| No Comment

gateway to connect devices in the home to the Internet or other WAN.

if you want to know the gateway of your computer,run below commands in terminal

$route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.1.1     0.0.0.0                  UG    0      0        0 eth0

or

you can use netstat -r

$netstat -r

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0        *                  255.255.255.0   U        0             0                   eth0
default         192.168.1.1     0.0.0.0                  UG       0           0                eth0

Related Posts with Thumbnails

Share With Others

Leave your response!




Comment moderation is enabled. Your comment may take some time to appear.