I have the following setup:
- A network namespace,
ns1
- A pair of virtual interfaces,
ns_ext1
andns_int1
.ns_ext
exists in the global namespace, andns_int1
exists inns1
. - A GRE device,
gre1
, which exists inns1
. - None of these devices are assigned IP addresses.
- The routing table in
ns1
is as follows10.0.2.0/24 -> gre1
0.0.0.0/0 -> ns_int1
- The routing table in the global namespace includes:
10.0.2.0/24 -> ns_ext1
When I try to ping 10.0.2.1
from the global namespace, which is an IP address that exists on the other end of the GRE tunnel, I get odd behavior. The traffic is forwarded to ns_ext1
. However, in ns1
, ns_int1
isn't forwarding this traffic to gre1
, as the routing table says it should. Instead, it's ARP'ing for 10.0.2.1
. My suspicion is that, by specifying the device ns_ext
as the next hop for the 10.0.2.0/24
subnet in the global routing table, I've made the kernel think that the subnet is directly connected to ns_ext1
. Is there any way I can get it to just forward through that interface instead of ARP'ing?