[solved] openvswitch + missing port

Issues related to applications and software problems
Post Reply
darthbolek
Posts: 12
Joined: 2019/03/17 11:48:21

[solved] openvswitch + missing port

Post by darthbolek » 2019/03/17 12:55:49

Fresh Centos 7 (in KVM, netinstall, today) and openvswitch 2.10.1
Problem: after adding extra port and restarting network service the port is gone. I need this port to be permanent. Obviously I am missing something...
Log (/var/log/openvswitch/ovs-vswitchd.log) confirms that all 3 ports were removed, but only 2 were recreated

Code: Select all

[aaa@bbb ~]$ sudo ovs-vsctl add-port ovs-main mgmt0 -- set interface mgmt0 type=internal
[aaa@bbb ~]$ sudo ovs-vsctl show
aa7f6b61-54c2-4ed6-8033-c2ba881283e6
    Bridge ovs-main
        Port "mgmt0"
            Interface "mgmt0"
                type: internal
        Port "eth0"
            Interface "eth0"
        Port ovs-main
            Interface ovs-main
                type: internal
    ovs_version: "2.10.1"
[aaa@bbb ~]$ sudo systemctl restart network
[aaa@bbb ~]$ sudo ovs-vsctl show
aa7f6b61-54c2-4ed6-8033-c2ba881283e6
    Bridge ovs-main
        Port "eth0"
            Interface "eth0"
        Port ovs-main
            Interface ovs-main
                type: internal
    ovs_version: "2.10.1"
cat /var/log/openvswitch/ovs-vswitchd.log|grep ovs-main

Code: Select all

2019-03-17T12:14:31.347Z|00036|bridge|INFO|bridge ovs-main: added interface mgmt0 on port 2
2019-03-17T12:15:46.120Z|00037|bridge|INFO|bridge ovs-main: deleted interface eth0 on port 1
2019-03-17T12:15:46.295Z|00038|bridge|INFO|bridge ovs-main: deleted interface mgmt0 on port 2
2019-03-17T12:15:46.295Z|00039|bridge|INFO|bridge ovs-main: deleted interface ovs-main on port 65534
2019-03-17T12:15:46.918Z|00057|bridge|INFO|bridge ovs-main: added interface ovs-main on port 65534
2019-03-17T12:15:46.919Z|00058|bridge|INFO|bridge ovs-main: using datapath ID 00001628c1d93546
2019-03-17T12:15:46.919Z|00059|connmgr|INFO|ovs-main: added service controller "punix:/var/run/openvswitch/ovs-main.mgmt"
2019-03-17T12:15:51.244Z|00060|bridge|INFO|bridge ovs-main: added interface eth0 on port 1
network scripts

Code: Select all

[aaa@bbb ~]$ sudo cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=ovs-main
ONBOOT=yes
HWADDR=52:54:00:9a:31:5d
[aaa@bbb ~]$ sudo cat /etc/sysconfig/network-scripts/ifcfg-mgmt0
DEVICE=mgmt0
DEVICETYPE=ovs
TYPE=OVSBridge
SLAVE=yes
ONBOOT=yes
BOOTPROTO=dhcp
[aaa@bbb ~]$ sudo cat /etc/sysconfig/network-scripts/ifcfg-ovs-main 
DEVICE=ovs-main
DEVICETYPE=ovs
TYPE=OVSBridge
SLAVE=yes
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.122.149
PREFIX=24
GATEWAY=192.168.122.1
IPV6INIT=no
[aaa@bbb ~]$ sudo cat /etc/sysconfig/network
# Created by anaconda
Last edited by darthbolek on 2019/03/21 11:50:54, edited 1 time in total.

hunter86_bg
Posts: 1707
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: openvswitch + missing port

Post by hunter86_bg » 2019/03/18 00:17:10

And what happens when you restart NetworkManager.service ?

darthbolek
Posts: 12
Joined: 2019/03/17 11:48:21

Re: openvswitch + missing port

Post by darthbolek » 2019/03/18 01:32:06

NetworkManager is disabled and not used.

darthbolek
Posts: 12
Joined: 2019/03/17 11:48:21

Re: openvswitch + missing port

Post by darthbolek » 2019/03/21 11:50:31

Answering my own question:
Reading The Friendly Manual is better that following questionable guides from internet...

Code: Select all

[aaa@bbb ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=ovs-main
ONBOOT=yes
HWADDR=52:54:00:9a:31:5d
HOTPLUG=no
[aaa@bbb ~]$ cat /etc/sysconfig/network-scripts/ifcfg-mgmt0
DEVICE=mgmt0
DEVICETYPE=ovs
OVS_BRIDGE=ovs-main
TYPE=OVSIntPort
ONBOOT=yes
OVSBOOTPROTO=dhcp
OVSDHCPINTERFACES=eth0
HOTPLUG=no
[aaa@bbb ~]$ cat /etc/sysconfig/network-scripts/ifcfg-ovs-main
DEVICE=ovs-main
DEVICETYPE=ovs
TYPE=OVSBridge
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.122.149
PREFIX=24
GATEWAY=192.168.122.1
IPV6INIT=no
HOTPLUG=no

Post Reply