服务器不能访问的原因

例如

[root@client ~]# curl http://192.168.99.100/
curl: (7) Failed to connect to 192.168.99.100: Network is unreachable

底层网络是否通

[root@client ~]# ping 192.168.99.100
connect: Network is unreachable
[root@client ~]# ip a s #检查IP地址
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:34:14:90 brd ff:ff:ff:ff:ff:ff
inet 192.168.88.10/24 brd 192.168.88.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe34:1490/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:34:14:9a brd ff:ff:ff:ff:ff:ff
[root@client ~]# route -n#检查网关
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.88.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0

[root@client ~]# nmcli connection modify eth0 ipv4.gateway 192.168.88.5
[root@client ~]# nmcli connection down eth0

Connection ‘eth0’ successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
[root@client ~]# nmcli connection up eth0
[root@web1 ~]# nmcli connection modify eth1 ipv4.gateway 192.168.99.5
[root@web1 ~]# nmcli connection down eth1

Connection ‘eth1’ successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)
[root@web1 ~]#nmcli connection up eth1
[root@web2 ~]# nmcli connection modify eth1 ipv4.gateway 192.168.99.5
[root@web2 ~]# nmcli connection down eth1

Connection ‘eth1’ successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)
[root@web2 ~]# nmcli connection up eth1

检查防火墙

[root@web1 ~]# systemctl status firewalld
Unit firewalld.service could not be found.#没有防火墙==防火墙已关闭

检查selinux

[root@web1 ~]# getenforce #查看当前运行模式
Disabled

检查服务是否开启

[root@web1 ~]# ss -tlnp | grep :80
LISTEN 0 128 :::80 ::😗 users:((“httpd”,pid=1381,fd=4),(“httpd”,pid=1380,fd=4),(“httpd”,pid=1379,fd=4),(“httpd”,pid=1378,fd=4),(“httpd”,pid=1377,fd=4),(“httpd”,pid=1376,fd=4))

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值