How Do I Find My Linux Gateway / Router IP Address
[1] Find out Gateway / router IP address under Linux / UNIX using route commandYou need to use route command. This command can manipulates the kernel’s IP routing tables.
$ route -n
Output:
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
192.168.1.1 is gateway IP address for our computer. The flag U indicates that route is up and G indicates that it is gateway. You can print gateway name, enter:[2] Find out Gateway / router IP address under Linux / UNIX using netstat command
Open a terminal and type the following command:
# netstat -r -n
Sample outputs:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Không có nhận xét nào:
Đăng nhận xét