一: 如何查看 Linux 的默认网关
1. 如果固定 IP 上网, cat /etc/sysconfig/network 里面 gateway 项
2. 如果是 dhcp 上网, 使用 route 命令, default 那一行就是网关了
- [root@hello ~]# route
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 192.1.1.0 255.255.255.0 U 0 0 0 eth0
- 169.254.0.0 255.255.0.0 U 0 0 0 eth0
- default 192.1.1.1 0.0.0.0 UG 0 0 0 eth0
3. 也可以用 netstat 命令查看
来源: http://www.bubuko.com/infodetail-2759490.html