OS & Linux Engineering / LINUX NETWORKING & SERVICE DIAGNOSIS / OSX-029

Binding Mystery

Explore concept graph

Latihan soal

Fixture Linux: bind dalam satu namespace

Jalankan pada Linux dengan Node 24:

node generation/fixtures/OSX-029/binding-mystery.mjs

Prediksi hasil:

loopback-self=connected
loopback-alias=ECONNREFUSED
wildcard-alias=connected

Koneksi ke 127.0.0.2 masih di network namespace yang sama. Fixture ini membuktikan matching tujuan IPv4, bukan akses antar-namespace, firewall, atau HTTP responses.

Konsep 1 / 3

Predict Linux IPv4 loopback and wildcard listening behavior without assuming remote reachability.

Coba prediksi atau perbaiki

A service bound to 127.0.0.1:8080 is unreachable at 10.200.30.1:8080. Is changing the URL path or adding a route enough?

Kalau jawabanmu berbeda

Kesalahan yang mungkin: Assuming 0.0.0.0 should be typed as the client URL or opens every firewall.

Mengapa tidak bekerja: 0.0.0.0 is a wildcard for binding the server socket, not a routable remote destination or firewall override.

Coba perbaiki: Use a real destination IP with curl, inspect the bound socket with ss, and check route/filter policy separately.

Periksa hasil sendiri

Hasil yang diharapkan: The local Node fixture accepts target 127.0.0.1 only with a loopback bind, and target 127.0.0.2 with a wildcard bind.

Kalau berbeda: Verify that you are on Linux and that 127.0.0.2 is inside the same namespace's loopback range.

Konsep 2 / 3

Use ip addr, ip route, ss and curl as independent reachability observations.

Coba prediksi atau perbaiki

ip addr confirms 10.200.30.1 on the host but ss shows only 127.0.0.1:8080. Has the host IP assignment proved the endpoint is listening there?

Kalau jawabanmu berbeda

Kesalahan yang mungkin: Treating the presence of an interface IP as proof that an application listens on that IP.

Mengapa tidak bekerja: A socket can be bound only to loopback even when a host has other usable interface addresses.

Coba perbaiki: Compare ss's listener local address with the client's destination IP and inspect each namespace's route.

Periksa hasil sendiri

Hasil yang diharapkan: You can explain each diagnostic command without confusing route availability with socket address matching.

Kalau berbeda: Run the command from the correct namespace and check permission to view process details in ss.

Konsep 3 / 3

Demonstrate that peer namespace localhost is not host localhost, then prove an interface-specific bind correction in a disposable lab.

Coba prediksi atau perbaiki

From cs101-peer, what does curl http://127.0.0.1:8080 contact?

Kalau jawabanmu berbeda

Kesalahan yang mungkin: Claiming local 127.0.0.2 fixture demonstrates a second namespace.

Mengapa tidak bekerja: 127.0.0.2 is another loopback destination inside the same Linux namespace, not an independent network stack.

Coba perbaiki: Run ip netns exec from a real peer with configured veth and record the actual observations.

Periksa hasil sendiri

Hasil yang diharapkan: Peer curl to host veth fails when the server is localhost-only and may succeed after interface-specific rebinding; teardown removes test netns and veth.

Kalau berbeda: If results differ, inspect privileges, veth link state, /30 assignments, host firewall and ss output; do not invent success.

Quiz: bind versus route

Jawab tanpa melihat pembahasan dulu. Kamu bisa memperbaiki jawaban dan mencoba lagi. Kuis ini latihan mandiri dan tidak menyimpan skor atau progres.

Peer netns menjalankan curl 127.0.0.1:8080. Server mana yang dituju?
Apa arti bind 0.0.0.0:8080 pada IPv4 Linux?
Perintah mana melihat bound address TCP listener?
Fixture membandingkan 127.0.0.1 dan 127.0.0.2. Apa yang dibuktikan?
Peer menargetkan host veth IP dan gagal sementara ss menunjukkan 127.0.0.1:8080. Langkah benar?