network bridge for KVM

Issues related to configuring your network
Post Reply
archiBXL
Posts: 5
Joined: 2020/03/08 11:00:01

network bridge for KVM

Post by archiBXL » 2020/03/08 11:14:15

Hi,

I'm trying to setup a Bridged networking (aka "shared physical device") for KVM. I'm on a freshly installed CENTOS8 server (virtualization server).

I'v configured my network-scripts as indicated below. But when I reboot the machnine, no network connections come up. How can I enable these settings?

> ifcfg-eth0
NAME=eno1
DEVICE=eno1
TYPE="Ethernet"
BOOTPROTO="none"
ONBOOT=yes
BRIDGE=br0
NM_CONTROLLED=no

> ifcfg-br0
NAME=br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
IPADDR="192.168.1.130"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
DNS1="192.168.1.1"
ONBOOT=yes
DELAY=0
NM_CONTROLLED=no
STP = no

User avatar
jlehtone
Posts: 2589
Joined: 2007/12/11 08:17:33
Location: Finland

Re: network bridge for KVM

Post by jlehtone » 2020/03/08 15:06:56

NM_CONTROLLED=no
Back in CentOS 6 and 7 that variable told the NetworkManager.service to not touch this configuration and leave it for the network.service. There does not seem to be "network.service" for CentOS 8 as such.

However,

Code: Select all

# sudo dnf info network-scripts
Description  : This package contains the legacy scripts for activating & deactivating of most
             : network interfaces. It also provides a legacy version of 'network' service.
             : 
             : The 'network' service is enabled by default after installation of this package,
             : and if the network-scripts are installed alongside NetworkManager, then the
             : ifup/ifdown commands from network-scripts take precedence over the ones provided
             : by NetworkManager.
             : 
             : If user has both network-scripts & NetworkManager installed, and wishes to
             : use ifup/ifdown from NetworkManager primarily, then they has to run command:
             :  $ update-alternatives --config ifup
             : 
             : Please note that running the command above will also disable the 'network'
             : service.
Is the use of "legacy" intentional from your part?

archiBXL
Posts: 5
Joined: 2020/03/08 11:00:01

Re: network bridge for KVM

Post by archiBXL » 2020/03/08 17:08:33

No, this was not intentional.

Disabling the “ NM_CONTROLLED=no “ does bring up both eno1 and br0, but I can’t connect to the internet. The connection was working fine before setting up the bridge.

archiBXL
Posts: 5
Joined: 2020/03/08 11:00:01

Re: network bridge for KVM

Post by archiBXL » 2020/03/08 18:11:35

I guess I should add an iptables rule?

-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT

User avatar
jlehtone
Posts: 2589
Joined: 2007/12/11 08:17:33
Location: Finland

Re: network bridge for KVM

Post by jlehtone » 2020/03/08 19:33:36

archiBXL wrote:
2020/03/08 18:11:35
I guess I should add an iptables rule?
No.

For one, bridget traffic never enters the kernel's filters, unless you have explicitly loaded a module for that.

Second, you probably have firewalld running and it does not like being bypassed. Furthermore, kernel does not have netfilter any more; there is nftables now and the user tool 'iptables' is a mere imperfect wrapper for 'nft'.

You say that "the internet does not connect". Does the link-local net appear to function?

What do you have now? Here are some commands to peek that:

Code: Select all

ip ad
ip ro
nmcli
nmcli d s
nmcli c s
PS. Why the manual config? Doesn't your router (192.168.1.1) have a DHCP server? Can't it allocate persistent IP for you?

archiBXL
Posts: 5
Joined: 2020/03/08 11:00:01

Re: network bridge for KVM

Post by archiBXL » 2020/03/08 20:47:57

“The internet does not connect” is perhaps not the best description ;) I basically don’t get a network connection. I tried dhcp but I don’t get an ip assigned from the firewall. I will check into detail tomorrow.

I always use fixed ip for servers.

archiBXL
Posts: 5
Joined: 2020/03/08 11:00:01

Re: network bridge for KVM

Post by archiBXL » 2020/03/09 08:32:02

I found out what the problem was. The port on my Cisco switch was blocked because of stp. I reenabled the port on my switch and everything is working fine now.

I don't think the problem was caused by the CENTOS server. I had a small smart switch between the server and the actual cisco switch which was causing the problem. I tried connecting the server directly to the port and everything seems to be working fine.

Thanks for your help!

Post Reply

Return to “CentOS 8 - Networking Support”