Linux查看本机ip 网管 DNS

IP:

ifconfig

gateway:

[root@localhost /]$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.5.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
122.49.14.64 0.0.0.0 255.255.255.224 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.5.0.0 10.5.0.2 255.255.255.0 UG 0 0 0 tun0
0.0.0.0 122.49.14.65 0.0.0.0 UG 0 0 0 eth0

(以0.0.0.0开始的行的gateway是默认网关)

DNS:

[root@localhost /]$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 202.106.0.20
nameserver 8.8.8.8


你可能感兴趣的:(Linux查看本机ip 网管 DNS)