I know what does localhost, 127.0.0.1
, means. It means loopback address, which can make a computer use as remote system. Of course, I know it is not possible that localhost cannot be accessed from another computer (node).
However, it happened. I am curious why this is happened..
Problem explain
Environment
- Node A: 192.168.9.21 (Windows 10)
- Node B: 192.168.9.22 (Centos 8 Stream)
I am keeping a blog with github pages, which use Jekyll with Ruby.
And this ran on Linux machine (Node B, 192.168.9.22) for test.
Below image is the description of my environment.
Situation
I execute Jekyll server with Ruby in my Node B (Linux machine)
[root@dev-desktop TyeolRik.github.io]# uname -a
Linux dev-desktop 4.18.0-408.el8.x86_64 #1 SMP Mon Jul 18 17:42:52 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@dev-desktop TyeolRik.github.io]# ifconfig | grep 'inet'
inet 172.21.0.1 netmask 255.255.0.0 broadcast 172.21.255.255
inet6 fe80::42:a8ff:fe12:6327 prefixlen 64 scopeid 0x20<link>
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:c4ff:fe87:1d10 prefixlen 64 scopeid 0x20<link>
inet 192.168.9.22 netmask 255.255.255.0 broadcast 192.168.9.255
inet6 fe80::b62e:99ff:fece:dbe3 prefixlen 64 scopeid 0x20<link>
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
inet6 fe80::e41b:acff:fe76:5180 prefixlen 64 scopeid 0x20<link>
inet6 fe80::3cc3:a1ff:feac:ec90 prefixlen 64 scopeid 0x20<link>
[root@dev-desktop TyeolRik.github.io]# bundle exec jekyll serve
Configuration file: /root/TyeolRik.github.io/_config.yml
Source: /root/TyeolRik.github.io
Destination: /root/TyeolRik.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 1.337 seconds.
Auto-regeneration: enabled for '/root/TyeolRik.github.io'
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
You can see that the IP of Node B (Linux machine) is 192.168.9.22.
And I ran the Jekyll server with the command bundle exec jekyll serve
.
On the Node A (Windows), I turn on Chrome and access 127.0.0.1:4000. And this works.
To prove that I access on Windows machine (without delusion),
I also show you my Network configuration which can be shown on Windows setting.
Question
How this is possible?
* At first, I wrote this question on "Network Engineering Stack Exchange". But, it was closed due to off-topic.
Added
[root@dev-desktop ~]# ss -tulpn
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
udp UNCONN 0 0 0.0.0.0:5353 0.0.0.0:* users:(("avahi-daemon",pid=1011,fd=13))
udp UNCONN 0 0 127.0.0.1:323 0.0.0.0:* users:(("chronyd",pid=1026,fd=5))
udp UNCONN 0 0 0.0.0.0:37490 0.0.0.0:* users:(("avahi-daemon",pid=1011,fd=15))
udp UNCONN 0 0 [::]:5353 [::]:* users:(("avahi-daemon",pid=1011,fd=14))
udp UNCONN 0 0 [::]:47088 [::]:* users:(("avahi-daemon",pid=1011,fd=16))
udp UNCONN 0 0 [::1]:323 [::]:* users:(("chronyd",pid=1026,fd=6))
udp UNCONN 0 0 *:49805 *:* users:(("java",pid=3818,fd=337))
tcp LISTEN 0 128 127.0.0.1:6013 0.0.0.0:* users:(("sshd",pid=3262,fd=13))
tcp LISTEN 0 128 127.0.0.1:6014 0.0.0.0:* users:(("sshd",pid=3472,fd=13))
tcp LISTEN 0 128 127.0.0.1:6015 0.0.0.0:* users:(("sshd",pid=45778,fd=13))
tcp LISTEN 0 128 127.0.0.1:4000 0.0.0.0:* users:(("bundle",pid=66201,fd=8))
tcp LISTEN 0 128 127.0.0.1:6016 0.0.0.0:* users:(("sshd",pid=47351,fd=13))
tcp LISTEN 0 128 127.0.0.1:6017 0.0.0.0:* users:(("sshd",pid=47502,fd=13))
tcp LISTEN 0 128 127.0.0.1:6018 0.0.0.0:* users:(("sshd",pid=65822,fd=13))
tcp LISTEN 0 128 127.0.0.1:40327 0.0.0.0:* users:(("node",pid=2263,fd=18))
tcp LISTEN 0 128 0.0.0.0:8629 0.0.0.0:* users:(("docker-proxy",pid=49044,fd=4))
tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=1099,fd=3))
tcp LISTEN 0 5 127.0.0.1:631 0.0.0.0:* users:(("cupsd",pid=1154,fd=7))
tcp LISTEN 0 128 127.0.0.1:6010 0.0.0.0:* users:(("sshd",pid=2120,fd=13))
tcp LISTEN 0 128 127.0.0.1:6011 0.0.0.0:* users:(("sshd",pid=2380,fd=13))
tcp LISTEN 0 128 127.0.0.1:6012 0.0.0.0:* users:(("sshd",pid=2464,fd=13))
tcp LISTEN 0 128 [::1]:6013 [::]:* users:(("sshd",pid=3262,fd=12))
tcp LISTEN 0 128 [::1]:6014 [::]:* users:(("sshd",pid=3472,fd=12))
tcp LISTEN 0 128 [::1]:6015 [::]:* users:(("sshd",pid=45778,fd=12))
tcp LISTEN 0 128 [::1]:6016 [::]:* users:(("sshd",pid=47351,fd=12))
tcp LISTEN 0 128 *:38080 *:* users:(("java",pid=47090,fd=132))
tcp LISTEN 0 128 [::1]:6017 [::]:* users:(("sshd",pid=47502,fd=12))
tcp LISTEN 0 128 [::1]:6018 [::]:* users:(("sshd",pid=65822,fd=12))
tcp LISTEN 0 128 *:8080 *:* users:(("java",pid=47090,fd=440))
tcp LISTEN 0 128 [::]:8629 [::]:* users:(("docker-proxy",pid=49052,fd=4))
tcp LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=1099,fd=4))
tcp LISTEN 0 5 [::1]:631 [::]:* users:(("cupsd",pid=1154,fd=6))
tcp LISTEN 0 128 [::1]:6010 [::]:* users:(("sshd",pid=2120,fd=12))
tcp LISTEN 0 128 [::1]:6011 [::]:* users:(("sshd",pid=2380,fd=12))
tcp LISTEN 0 128 [::1]:6012 [::]:* users:(("sshd",pid=2464,fd=12))