我在本地网络上运行着一个 NGINX 服务器,作为测试,它只返回单词“holding”。但是,我无法从网络上的任何其他 PC 访问它,尽管它看起来运行正常。
在我的服务器上:
$ ip -4 a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic noprefixroute enp2s0
valid_lft 79059sec preferred_lft 79059sec
$ netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 enp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 enp2s0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 enp2s0
$ sudo netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 747/systemd-resolve
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 853/cupsd
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 994/mongod
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1037/nginx: master
tcp6 0 0 ::1:631 :::* LISTEN 853/cupsd
tcp6 0 0 :::80 :::* LISTEN 1037/nginx: master
$ sudo ufw status
Status: active
To Action From
-- ------ ----
Nginx Full ALLOW Anywhere
80/tcp ALLOW Anywhere
Nginx Full (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
$ curl 192.168.1.100
holding
在我的客户上:
$ping 192.168.1.100
PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
64 bytes from 192.168.1.100: icmp_seq=1 ttl=64 time=3.47 ms
64 bytes from 192.168.1.100: icmp_seq=2 ttl=64 time=2.33 ms
$ ip -4 a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
inet 192.168.1.215/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp2s0
valid_lft 86007sec preferred_lft 86007sec
$ netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlp2s0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlp2s0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp2s0
$ sudo netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 13013/systemd-resol
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 31016/cupsd
tcp6 0 0 ::1:631 :::* LISTEN 31016/cupsd
$ curl 192.168.1.100
curl: (7) Failed to connect to 192.168.1.100 port 80: No route to host
$ traceroute 192.168.1.1
traceroute 192.168.1.100
traceroute to 192.168.1.100 (192.168.1.100), 30 hops max, 60 byte packets
1 192.168.1.100 (192.168.1.100) 4.125 ms !X 4.069 ms !X 4.052 ms !X
$ sudo traceroute -T -p 80 192.168.1.100
traceroute to 192.168.1.100 (192.168.1.100), 30 hops max, 60 byte packets
1 192.168.1.100 (192.168.1.100) 2.821 ms !X 3.137 ms !X 3.132 ms !X
我完全被难住了……