linux网络配置教程,linux连不上网检查修复

有的时候呢,我们的linux服务器出现一些网络问题,来看看linux网络配置教程,linux连不上网检查修复方法,这是一些最基本的网络修复方法,一般情况都是这些问题,大家可以试着看看。

步骤:查看网络IP、子网掩码、网管和DNS,如果网络连接不正常,连接外网的IP也不会正常显 示。

linux网络配置教程,linux连不上网检查修复插图

来看看实战修复

[root@localhost~]#ifconfig
ens33:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:0c:29:f5:f1:79 txqueuelen 1000 (Ethernet)
RX packets 204071 bytes 275132305(262.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 97644 bytes 6136451 (5.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo:flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 network 255.0.0.0
inet6::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1(Local Loopback)
RX packets 59101 bytes 4954093(4.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 59101 bytes 4954093(4.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0:flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 network 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:74:40:14 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0(0.0 B)
RX errors 0 dropped 0 overruns0 frame 0
TX packets 0 bytes 0(0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions0

 

排查是否正常,可以通过ping命令测试连通性。如下所示。

linux网络配置教程,linux连不上网检查修复插图1

[root@localhost~]#route-n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.87.2 0.0.0.0 UG 100 0 0 ens33
192.168.87.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33
192.168.122.00.0.0.0 255.255.255.0 U 0 0 0 virbr0

ping一下本地检查一下

LINGJICHU LINUX CONGRUMENDAOJINGTONG
[root@localhost~]#ping 192.168.87.2
PING 192.168.87.2(192.168.87.2)56(84) bytes of data.
64 bytes from 192.168.87.2: icmp_seq=1 ttl=128 time=0.233 ms
64 bytes from 192.168.87.2: icmp_seq=2 ttl=128 time=0.314ms
64 bytes from 192.168.87.2: icmp_seq=3 ttl=128 time=0.294 ms
^C
---192.168.87.2 ping statistics ---
3 packets transmitted, 3 received,0% packet loss, time 2001ms
rtt min/avg/max/mdev=0.233/0.280/0.314/0.037 ms

 

检查DNS解析是否正常,可以通过host命令检查,如下所示。

[root@localhost~]# host www.linux.org

www.linux.org has address 104.28.17.26

www.linux.org has address 104.28.16.26

www.linux.org has IPv6 address 2400:cb00:2048:1::681c:111a

www.linux.org has IPv6 address 2400:cb00:2048:1::681c:101a

作为初学者,排查网络故障可以先按照上述步骤进行网络配置、检查,查出问题后再对系统配置进行检查,基本上大部分问题都是这些问题,如果还是不行,那打开百度继续寻找方法。

© 版权声明
THE END
喜欢就亲吻一下吧
分享
评论 共1条
头像
评论一下幻城的文章吧
提交
头像

昵称

取消
昵称代码图片
    • 头像明月登楼的博客0