我需要从 PORT 3000 中的另一台机器访问软件,但我无法针对该机器的 IP 进行此操作,只能通过本地主机进行。
erick@erickmordecai:~$ ifconfig
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.103 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::4367:b9ff:87bb:2c8c prefixlen 64 scopeid 0x20<link>
ether 38:2c:4a:8c:a3:33 txqueuelen 1000 (Ethernet)
RX packets 147266 bytes 200775157 (200.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 76656 bytes 7752958 (7.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 00x10<host>
loop txqueuelen 1000 (Loopback Local),
RX packets 17420 bytes 4937968 (4.9 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17420 bytes 4937968 (4.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
erick@erickmordecai:-$ nmap localhost
Starting Nmap 7.60 ( https://nmap.org ) at 2018-10-05 22:47 -03
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000045s latency).
Not shown: 997 closed ports
PORT STATE SERVICE
80/tcp open http
631/tcp open ipp
3000/tcp open ppp
Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds
erick@erickmordecai:~$ nmap 192.168.103
Starting Nmap 7.60 ( https://nmap.org ) at 2018-10-05 22:47 -03
Nmap scan report for 192.168.103 (192.168.0.103)
Host is up (0.000051s latency).
rDNS record for 192.168.0.103: erickmordecai
Not shown: 999 closed ports
PORT STATE SERVICE
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds erick@erickmordecai:~$
我不明白为什么我为本地主机打开了一些端口,而为网络上机器的 IP 打开了其他端口。