2

How it was before in good old times of network-scripts:

I've describing bridge and port in files:

/etc/sysconfig/network-scripts/ifcfg-br0
/etc/sysconfig/network-scripts/ifcfg-port0

than restart network by

systemctl restart network

and everything start working.

Now network-scripts is marked as deprecated, there is a warning that will be removed in one of the next major releases of RHEL., so I have to switch to NetworkManager, right?

But how to setup Open vSwitch with NetworkManager?

I've installed NetworkManager-ovs and trying this guide but described commands doing nothing, I mean nothing appears in output of ovs-vsctl show

nmcli networking off && nmcli networking on or systemctl restart NetworkManager has no any effect

ifup br0 also does not work:

Error: unknown connection '/etc/sysconfig/network-scripts/ifcfg-br0'.
Oleg Neumyvakin
  • 599
  • 4
  • 15

2 Answers2

4

Creating a Bridge with a single internal Interface

$ nmcli conn add type ovs-bridge conn.interface bridge0
Connection 'ovs-bridge-bridge0' (d10fc64d-1d48-4394-a1b8-e1aea72f27d5) successfully added.

$ nmcli conn add type ovs-port conn.interface port0 master bridge0
Connection 'ovs-port-port0' (5ae22bae-bba4-4815-9ade-7e635633e1f0) successfully added.

$ nmcli conn add type ovs-interface slave-type ovs-port conn.interface iface0 \
  master port0 ipv4.method manual ipv4.address 192.0.2.1/24
Connection 'ovs-interface-iface0' (3640d2a1-a2fd-4718-92f1-cffadb5b6cdc) successfully added.

You need to create a Port even for a single interface. Also, before you add the Interface, the Bridge and Port devices appear active, but are not configured in OVSDB yet. You can inspect the results with ovs-vsctl show.

Adding a Linux interface to a Bridge

$ nmcli conn add type ovs-port conn.interface port1 master bridge0
Connection 'ovs-port-port1' (67d041eb-8e7b-4458-afee-a1d07c9c4552) successfully added.
$ nmcli conn add type ethernet conn.interface eth0 master port1
Connection 'ovs-slave-eth0' (d459c45c-cf78-4c1c-b4b7-505e71379624) successfully added.

Now run ovs-vsctl show and check it.

Arvin
  • 41
  • 3
0

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.

  1. Install Open vSwitch plugin for NetworkManager and restart NetworkManager to load plugin:
dnf install NetworkManager-ovs 
systemctl restart NetworkManager
  1. 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
  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
  1. 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
  1. 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
  1. 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
  1. To apply all this stuff we need to reload connections:
nmcli conn reload
Oleg Neumyvakin
  • 599
  • 4
  • 15