less than 1 minute read

Centos 查看网关

方法一:使用 ip 命令查看网关

ip route show default

# 返回结果如下,其中via后的地址为网关地址
# default via 192.168.1.1 dev eth0 proto static

方法二:使用 route 查看网关

route -n

# 返回结果如下,其中Gateway为网关地址
# Destination  Gateway      Genmask  Flags  Metric  Ref  Use  Iface
# default      192.168.1.1  0.0.0.0  UG     0       0    0    eth0

Updated:

Leave a comment