I have an Ubuntu 20.04 server with four Ethernet interfaces: eno5, eno6, eno7, and eno8. The first two belong to the root netns, and the last two belong to a new netns called netns1. An ethernet cable physically interconnects eno6 with eno8.
I have created two OVS bridges (br0 and br1) like this:
sudo ovs-vsctl add-br br0
sudo ovs-vsctl add-port br0 eno7
sudo ovs-vsctl add-port br0 eno8
sudo ovs-vsctl add-br br1
sudo ovs-vsctl add-port br1 eno5
sudo ovs-vsctl add-port br1 eno6
I want to be able to ping from eno6 in br1 (10.0.0.6/24) to eno8 in br0 (10.0.0.8/24) by traveling through the ethernet cable rather than internally. According to this answer, this can be achieved by using separate network namespaces.
However, OVS complains that it cannot find eno7 and eno8, which are in the netns1 network namespace:
$ sudo ovs-vsctl show
7b1ef2bc-b596-4214-879e-144d45c6a8df
Bridge br0
Controller "tcp:10.98.1.85:6653"
is_connected: true
Port eno7
Interface eno7
error: "could not open network device eno7 (No such device)"
Port eno8
Interface eno8
error: "could not open network device eno8 (No such device)"
Port br0
Interface br0
type: internal
Bridge br1
Controller "tcp:10.98.1.85:6653"
is_connected: true
Port br1
Interface br1
type: internal
Port eno6
Interface eno6
Port eno5
Interface eno5
ovs_version: "2.13.8"
Hence, my SDN controller is unable to discover the ports associated to eno7 and eno8 and I can't ping between 10.0.0.6 and 10.0.0.8.
This is what I have tried:
- Creating the br0 bridge using "ip netns exec netns1" like this: sudo ip netns exec netns1 sudo ovs-vsctl add-br br0. There is no difference. br0 is still visible in the root namespace and adding eno7 and eno8 to br0 leads to the same error.
- Manually adding br0 to the netns1 namespace like this: sudo ip link set br0 netns netns1. Now br0 is visible only in the netns1 namespace, however the error when adding eno7 and eno8 to the bridge is the same, regardless of whether I add them before or after setting br0 to the netns1 namespace.
I want to ask, is it possible to add ports from a custom network namespace to an ovs bridge? If so, how to proceed?