0

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.

Network description

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.

Chrome Access

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))
2
  • Caching????????
    – davidgo
    Commented Dec 27, 2022 at 3:31
  • @davidgo No. I've never turn on the server on windows machine and also, I pressed "Ctrl + F5" on Chrome which is shortcut of Refreshing cache.
    – TyeolRik
    Commented Dec 27, 2022 at 3:53

2 Answers 2

2

Sound like you are doing local port forwarding. I guess you are using putty and have it configured similar to the following command:ssh -L 4000:127.0.0.1:4000 [email protected].

If you do not have a SSH connection or something similar open, it could also be a reverse proxy. In this case please append the output of ss -tulpn to your question.

5
  • I edited my question as you said. Of course, Node A and B are connected with ssh (and also authorized with pubkey)
    – TyeolRik
    Commented Dec 27, 2022 at 7:34
  • 1
    @TyeolRik Well, there's your answer. You're forwarding that port. Making it available as if it was local is exactly what forwarding does.
    – gronostaj
    Commented Dec 27, 2022 at 7:36
  • And also I am not using putty. I am just using Windows terminal ( Actually Powershell ) with normal ssh. There is no putty installed in Node A (Windows machine)
    – TyeolRik
    Commented Dec 27, 2022 at 7:36
  • @gronostaj Would you tell me more specifically? I can't see where is hint of forwarding that port. The code snippet, which shows the result of ss -tulpn, is captured in Node B(Linux machine). And Chrome is opened in Node A (Windows machine)
    – TyeolRik
    Commented Dec 27, 2022 at 7:39
  • 1
    WOW.... Thanks to @dirdi. There is "Auto forwarded" by VScode (remote ssh).. I got a popup menu. and it said "Origin: Auto Forwarded". VS Code forward What a magnificent technology!!
    – TyeolRik
    Commented Dec 27, 2022 at 7:48
0

Check your proxy settings.

Unless 192.168.9.22:4000 is set up as proxy, there's some real magic going on.

You've got duplicate 192.168.9.22 addresses here, so the setup's already a mess.

1
  • Well.. I don't know how to make proxy setting. But, If there is, company network would make it work. But the truth is, my co-worker, whose IP address is 192.168.9.**23**, cannot access on 127.0.0.1:4000 unsurprisingly...
    – TyeolRik
    Commented Dec 27, 2022 at 7:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .