Key Takeaway

<aside> 💡

This is a follow-up to the previous article, 4. Understand Linux Routing System, presenting two interesting hands-on experiments. Through these experiments, we will attempt to interact with targets outside the Network Namespace, such as the eth0 interface on the local host, or external network services like Google DNS.

</aside>

For a better understanding, please refer to the previous articles on Namespaces, VETH, and ARP.

Experiment 2 - Direct route from a Network Namespace to Host eth0

<aside> 💡

In Experiment 2, we will initiate a ping command from the eth0 interface inside the network namespace ns1 to the Host eth0 interface. Since these two interfaces belong to different subnets, they cannot communicate directly. Therefore, we will explore how, by interacting with the Routing Table and utilizing the bridge br0, we can eventually succeed in pinging the Host eth0.

During the experiment, we will observe two interesting issues, and we will leave one additional question for the reader to ponder.

In addition, this environment does not have any default routing rules and does not use a gateway. Instead, it adopts a Direct Routing approach.

The architectural diagram is shown below.

</aside>

routing table - 2.drawio.svg

Experimental Environment Setup

<aside> 💡

This environment uses the Ubuntu 24.04 server provided by iximiuz Labs, which offers a fast and convenient online practice environment.

Reference: https://labs.iximiuz.com/

</aside>

Let’s begin the experiment!

1. Ping Host eth0 from ns1

截圖 2025-08-01 上午8.50.39.png

First, let’s check the routing table of ns1. At the moment, it contains only one entry:

10.22.33.0/24 dev eth0 proto kernel scope link src 10.22.33.4

Next, when we issue a ping command from ns1 to the Host, we can observe that it results in a “Network is unreachable” status.

2. Update ns1's routing table

截圖 2025-08-01 上午8.57.17.png

Since that’s the case, let’s try adding the Host’s **eth0** to ns1’s routing table.

Result: We get a different outcome — it’s no longer “Network is unreachable”, but the ping command becomes stuck (hangs)…

Why is that? Let’s debug it step by step.