Here how end-to-end process of configuring Open vSwitch with NetworkManager looks for me. I have main network interface eth0
, I'm going to create br-ext
and connect eth0
to it, than I'll create br-int
and br-routed
, than connect br-ext
and br-int
with patch ports.
- Install Open vSwitch plugin for NetworkManager and restart NetworkManager to load plugin:
dnf install NetworkManager-ovs
systemctl restart NetworkManager
- Let's create a bridge
br-ext
:
nmcli conn add type ovs-bridge conn.interface br-ext con-name br-ext
nmcli conn add type ovs-port conn.interface br-ext master br-ext con-name ovs-port-br-ext
nmcli conn add type ovs-interface slave-type ovs-port con.interface br-ext master ovs-port-br-ext \
con-name ovs-if-br-ext ipv4.method manual ipv4.addresses 10.54.1.98/21 ipv4.gateway 10.54.0.1
- To add
eth0
to the bridge br-ext
, pay attention that you may still have config file /etc/sysconfig/network-scripts/ifcfg-eth0
, this config file has to be deleted before nmcli reload
:
nmcli conn add type ovs-port conn.interface eth0 master br-ext con-name ovs-port-eth0
nmcli conn add type ethernet conn.interface eth0 master ovs-port-eth0 con-name ovs-if-eth0
- Sometimes we need to put additional settings for bridge like we do it before by
OVS_EXTRA
, now we can use pass settings like ovs-bridge.rstp-enable true
. You can check which options can be set with nmcli conn show br-ext
. Pay attention for ipv4.method disabled ipv6.method disabled
this is required to bring up br-routed
after server reboot:
nmcli conn add type ovs-bridge conn.interface br-routed ovs-bridge.rstp-enable true con-name br-routed
nmcli conn add type ovs-port conn.interface br-routed master br-routed con-name ovs-port-br-routed
nmcli conn add type ovs-interface slave-type ovs-port conn.interface br-routed \
master ovs-port-br-routed con-name ovs-if-br-routed ipv4.method disabled ipv6.method disabled
- Create
br-int
, nothing special here:
nmcli conn add type ovs-bridge conn.interface br-int con-name br-int
nmcli conn add type ovs-port conn.interface br-int master br-int con-name ovs-port-br-int
nmcli conn add type ovs-interface slave-type ovs-port conn.interface br-int
master ovs-port-br-int con-name ovs-if-br-int ipv4.method disabled ipv6.method disabled
- Sometimes we need to connect to Open vSwitch bridged with patch ports, following commands connect
br-int
with br-ext
:
# create patch-br-int
nmcli conn add type ovs-port conn.interface patch-br-int master br-int con-name patch-br-int
nmcli conn add type ovs-interface slave-type ovs-port conn.interface patch-br-int master patch-br-int \
con-name ovs-if-patch-br-int ovs-interface.type patch ovs-patch.peer patch-br-ext
# create patch-br-ext
nmcli conn add type ovs-port conn.interface patch-br-ext master br-ext con-name patch-br-ext
nmcli conn add type ovs-interface slave-type ovs-port conn.interface patch-br-ext master patch-br-ext \
con-name ovs-if-patch-br-ext ovs-interface.type patch ovs-patch.peer patch-br-int
- To apply all this stuff we need to reload connections:
nmcli conn reload