日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

centos查看网关地址

發布時間:2025/3/13 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 centos查看网关地址 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Centos/Linux下如何查看網關地址/Gateway地址? Linux下查看網關的命令還是很多的,不過如果IP是DHCP獲取,那么有些命令是不適用的,當然也有通用的查詢網關命令.

?

1.ifconfig -a 和 cat /etc/resolv.conf? (主要查看ip/netmask和dns)

2.netstat -rn

3.cat /etc/sysconfig/network

4.cat /etc/sysconfig/network-scripts/ifcfg-eth0

5.traceroute 第一行就是自己的網關

6.ip route show

7.route -n

以上幾個是比較常用的查詢網關的命令。下面是范例:

?

[root@www.ctohome.com]# netstat -rn
Kernel IP routing table
Destination???? Gateway???????? Genmask???????? Flags?? MSS Window? irtt Iface
184.82.152.96?? 0.0.0.0???????? 255.255.255.248 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???????? 184.82.152.97?? 0.0.0.0???????? UG??????? 0 0????????? 0 eth0

?


[root@www.ctohome.com]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82567V-2 Gigabit Network Connection
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:1c:c0:f8:a1:ac
ONBOOT=yes
NETMASK=255.255.255.248
IPADDR=184.82.152.98
GATEWAY=184.82.152.97
TYPE=Ethernet

?


[root@www.ctohome.com]# ip route show
184.82.152.96/29 dev eth0? proto kernel? scope link? src 184.82.152.98
169.254.0.0/16 dev eth0? scope link
default via 184.82.152.97 dev eth0


[root@www.ctohome.com]# route -n
Kernel IP routing table
Destination???? Gateway???????? Genmask???????? Flags Metric Ref??? Use Iface
184.82.152.96?? 0.0.0.0???????? 255.255.255.248 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???????? 184.82.152.97?? 0.0.0.0???????? UG??? 0????? 0??????? 0 eth0

?

[root@www.ctohome.com]#? ifconfig -a
eth0????? Link encap:Ethernet? HWaddr 00:1C:C0:F8:A1:AC ?
????????? inet addr:184.82.152.98? Bcast:184.82.152.103? Mask:255.255.255.248

總結

以上是生活随笔為你收集整理的centos查看网关地址的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。