How to get the gateway IP address of your machine on Linux.

Getting the gateway IP address of your machine is a very important trick sometimes. This is very easy on Linux. Use the ip route command on Linux to print information about the IP routing. This includes the gateway IP address. ┌──[[email protected]]─[~/Videos] └──╼ ╼ $ ip route | grep default | awk ‘{print $3}’ 192.168.1.1┌──[[email protected]]─[~/Videos] └──╼ … Read more

How to find out the gateway IP address of your Linux machine on a LAN.

This is how you find out the gateway IP address of your Linux machine on a LAN. I have executed the route -n command and I have this output. The UG flags on the IP address denote it as a gateway IP address. root@darknet:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric … Read more

Adding a default route in Linux. How to define the default gateway.

Adding a default route in Linux is easy. The route command is the best way to do this. ~# route add default gw 172.18.31.1~# route add default gw 172.18.31.1 I used this command on a machine that previously had an IP address in the 192.168.0.xx range and the default gateway was 192.168.0.1. So I had … Read more

How to show the routing table on Linux with the bash command shell.

Netscape Navigator install floppies.

The netstat command may be used to show the routing tables for your network connection easily. Use the netstat -r command to achieve this. iMac05:~ admin$ netstat -r Routing tables   Internet: Destination Gateway Flags Refs Use Netif Expire default 172.18.31.1 UGSc 31 0 en0 127 localhost UCS 0 0 lo0 localhost localhost UH 0 … Read more