3
3
Like the diagram below, the physical network is 192.168.99.0/24. veth0
lives inside a separate network-namespace. I want it to directly connect into the physical network, thus node1
and veth0
can talk to each other through physical network without any NATs.
What I've tried is:
- create a linux bridge br0
- connect veth1 to br0
- connect eth0 (physical NIC of node2) to br0
Turns out, if we ping from 192.168.99.3 to 192.168.99.1, then arp
packets come from veth0
, traverse through veth1
to br0
, and then be broadcasted to node2
's eth0
, and finally get received by node1
's eth0
.
Howerver, when node1
replies, packet's dested to veth0
's mac address won't be received by node2's eth0
(mac mismatch I guess), thus veth0
won't get arp reply packets and ping fails.
So, if I'm not understanding this wrong, can anybody gives me any ideas on how to make this bridge network happen?
UPDATE
I rebuild this test environment on bare metal machines, turns out everything works fine. Maybe something wrong with virtualbox networking.
1This should work in theory, as bridging eth0 would switch it to promiscuous mode and disable MAC filtering. – user1686 – 2017-04-28T10:45:04.667
@grawity Unfortunately I didn't make this work. :( Can you take a try? – dastan – 2017-04-28T11:07:20.390
I just got this working on KVMs by using two veths on the bridge, one in the container namespace with the container's IP and one not, with the host IP. No IP on the bridge itself. Other nodes on the network see individual IPs and MACs. Biggest surprise was that moving things into namespaces erases the IP and such. – stolenmoment – 2019-10-02T16:46:57.833