Linux - How to find gateway ipaddress in server, How to find gateway ip address using route command

How to find gateway ipaddress in server

Linux provide many way to to find the gateway IP Address, Lets see some example one by one.

Find gateway IP Address using netstat command
 
 # netstat -nr

 OUTPUT:
 =======
 Kernel IP routing table
 Destination     Gateway         Genmask         Flags   MSS Window  irtt 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

Find gateway IP Address using netstat command
 
 # route -nee

 OUTPUT:
 =======
 Kernel IP routing table
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    MSS   Window irtt
 192.168.1.0     0.0.0.0         255.255.255.0   U     1      0        0 eth0     0     0      0
 0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0     0     0      0

Another simple way to find the gateway IP address of your machine is
 
 ip route show

 default via 192.168.1.1 dev eth0  proto static 
This are the simple way to find IP Address.

The topic on Linux - How to find gateway ipaddress in server is posted by - Math

Hope you have enjoyed, Linux - How to find gateway ipaddress in serverThanks for your time

Tech Bluff