您的位置:首页 > 运维架构 > Linux

Linux获取IP_网关_DNS

2013-01-08 21:46 363 查看
 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

转自:http://blog.csdn.net/zdwzzu2006/article/details/6928803
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: