欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

linux 查看本地 IP、网关、DNS

最编程 2024-07-06 20:50:42
...

IP: 
    ifconfig

gateway:
[root@localhost ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window irtt Iface
172.16.44.0     0.0.0.0          255.255.255.0    U         0      0          0 vmnet8
172.16.10.0     0.0.0.0          255.255.255.0        U         0      0          0 vmnet1
172.16.0.0       0.0.0.0          255.255.252.0        U         0      0          0 eth0
169.254.0.0     0.0.0.0          255.255.0.0           U         0      0          0 eth0
0.0.0.0         172.16.0.254    0.0.0.0           UG        0      0          0 eth0

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


DNS:
[root@localhost ~]# cat /etc/resolv.conf
search               localdomain
nameserver 172.16.0.250

如果共享访问互联网,查看出口IP

curl  http://members.3322.org/dyndns/getip 

 

http://blog.****.net/zdwzzu2006/article/details/6928803

 



本文转自茄子_2008博客园博客,原文链接:http://www.cnblogs.com/xd502djj/p/4244591.html,如需转载请自行联系原作者。