Tag Archives: ip route

How to Find Default Gateway in Linux

A gateway is a node or a router that acts as an access point to passes network data from local networks to remote networks. There are many ways to find out your gateway in Linux. Here are some of them from Terminal.

You can find default gateway using ip, route and netstat commands in Linux systems.

Using route command

Open up your terminal and type the following commands:

sk@sk:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     1      0        0 eth1

The above output shows my default gateway is 192.168.1.1. UG stands for the network link is Up and G stands for Gateway. Continue reading How to Find Default Gateway in Linux