查看ip,gateway和dns的方法
1.查看ip
/ # ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:22:43:47:45:C9
inet addr:192.168.1.117 Bcast:192.168.2.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2669 errors:0 dropped:0 overruns:0 frame:0
TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:219639 (214.4 KiB) TX bytes:2332 (2.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1016 (1016.0 B) TX bytes:1016 (1016.0 B)
usb0 Link encap:Ethernet HWaddr AA:52:18:91:66:C8
inet addr:192.168.100.2 Bcast:192.168.100.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:71 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8575 (8.3 KiB) TX bytes:0 (0.0 B)
/ # [ 158.392212]
[ 158.392243] !
[ 158.397370]
2.查看gateway
/ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.0 * 255.255.255.0 U 0 0 0 usb0
192.168.0.0 * 255.255.252.0 U 0 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
3.查看dns
/ # cat /etc/resolv.conf
search luther.com
nameserver 202.106.186.115
nameserver 202.106.1.20
阅读(2208) | 评论(0) | 转发(0) |