ping命令
查看检测目标主机是否连接,这里注意有的防火墙/企业路由器为了安全考虑,开启防ping
-
ping www.baidu.com
-
ping 114.114.114.114
-
ping baidu.com
企业案例
企业级如果上不了网,排查流程
- 步骤一
检查硬件
传输介质—网线用寻线仪排查或交叉法排查,查看网线
物理设备,看网卡灯亮不亮 - 步骤二
检查数据链路
C7 命令ip a
C6 命令ipconfig 需yum install -y net-tools
ping 网关地址
192.168.1.1
192.168.1.255 - 步骤三
检查外网是否连通
ping 公网的ip地址
114.114.114.114 - 步骤四
检查DNS服务器
ping域名
baidu.com
www.baidu.com
route命令
yum install -y net-tools
查看系统中路由表信息
[root@xxx ~]# :route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.2 0.0.0.0 UG 100 0 0 ens33
10.0.0.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33
添加网段
[root@xxx ~]# :route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0