Key Takeaway

<aside> 💡

This is a follow-up to the previous article, 04. 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>

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.

3. Observe two questions

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

Question 2: At this point we observe that br0 receives the ICMP Request packets but no ICMP Reply packets. Why is that?

4. Solve the Question 2

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

Let’s answer Question 2 first.

5. Result of solving the Question 2

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

After adding the route, we issue the ping command again — and this time, it succeeds. We can also observe that the br0 interface now carries both ICMP Request and ICMP Reply packets.

<aside> 💡

Through this small experiment, we learned that in order to successfully send and receive packets, every point the packet passes through must have the appropriate routing in place.

</aside>