How to find the default gateway on Linux

by lifeLinux on May 2, 2011

Whether you are troubleshooting network problems or trying to set up a VPN…, knowing what address your computer has configured as the default gateway is always useful. Running a simple command from the terminal can give you this.

root@lifelinux:~# route -n

Sample outputs:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.64.64.64     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 ppp0
0.0.0.0         10.64.64.64     0.0.0.0         UG    0      0        0 ppp0

10.64.64.64 is the address for my default gateway.

Leave a Comment

Previous post:

Next post: