Bridge setup for KVM odity - no IPADDR in main interface but there is one shown in 'if ADDR'

General support questions
Post Reply
User avatar
ben_tvpp
Posts: 62
Joined: 2018/12/04 13:28:51

Bridge setup for KVM odity - no IPADDR in main interface but there is one shown in 'if ADDR'

Post by ben_tvpp » 2020/05/16 23:53:00

This is odd, the main interface (enp7s0) has an IP address. There is no IP address in the ifcfg-enp7s0, its in ifcfg-br0. Things seems to be working but when I set this up on my test server I did not get a IP on the main interface. Any ideas?

UPDATE: actually almost all is working. When I do virt-install I lose ssh access to the server. The existing terminals connected via ssh still work, its the new ones that will not connect, 22 time out error. If I kill the virt-install I can ssh in on new term.

ifcfg-enp7s0

Code: Select all

DEVICE="enp7s0"
NM_CONTROLLED="no"
ONBOOT=yes
#HWADDR=2c:4d:54:43:92:df
TYPE=Ethernet
BOOTPROTO=none
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System enp7s0"
BRIDGE=br0
ifcfg-br0

Code: Select all

DEVICE="br0"
NM_CONTROLLED="no"
ONBOOT=yes
#HWADDR=2c:4d:54:43:92:df
TYPE=Bridge
BOOTPROTO=static
IPADDR=xxx.171.204.107
NETMASK=255.255.252.0
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
route-br0

Code: Select all

xxx.171.204.1 dev br0
default via xxx.171.204.1
ip addr

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether 2c:4d:54:43:92:df brd ff:ff:ff:ff:ff:ff
    inet xxx.171.204.107/22 brd 213.171.207.255 scope global enp7s0
       valid_lft forever preferred_lft forever
    inet6 fe80::2e4d:54ff:fe43:92df/64 scope link
       valid_lft forever preferred_lft forever
3: enp8s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 2c:4d:54:43:92:e0 brd ff:ff:ff:ff:ff:ff
5: br-369501bb177f: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:22:7c:d4:52 brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global br-369501bb177f
       valid_lft forever preferred_lft forever
    inet6 fe80::42:22ff:fe7c:d452/64 scope link
       valid_lft forever preferred_lft forever
32: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:56:31:0e brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
33: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:56:31:0e brd ff:ff:ff:ff:ff:ff
36: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 2c:4d:54:43:92:df brd ff:ff:ff:ff:ff:ff
    inet xxx.171.204.107/22 brd 213.171.207.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::2e4d:54ff:fe43:92df/64 scope link
       valid_lft forever preferred_lft forever

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

Re: Bridge setup for KVM odity - no IPADDR in main interface but there is one shown in 'if ADDR'

Post by jlehtone » 2020/05/17 09:55:33

Please show

Code: Select all

nmcli c s
systemctl status NetworkManager.service
chkconfig --list network

User avatar
ben_tvpp
Posts: 62
Joined: 2018/12/04 13:28:51

Re: Bridge setup for KVM odity - no IPADDR in main interface but there is one shown in 'if ADDR'

Post by ben_tvpp » 2020/05/17 12:14:39

Server is not currently using NetworkManager. Decided to keep it that way as learning kvm is enough, for now, don't want to also learn NetworkManager (I want to have a fairly good understanding of things before I use them in production).

Code: Select all

$ systemctl status NetworkManager.service
● NetworkManager.service - Network Manager
   Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:NetworkManager(8)

May 01 01:48:55 zzzz.net systemd[1]: Network Manager is not active.

Code: Select all

$ chkconfig --list network

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

network         0:off   1:off   2:on    3:on    4:on    5:on    6:off

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

Re: Bridge setup for KVM odity - no IPADDR in main interface but there is one shown in 'if ADDR'

Post by jlehtone » 2020/05/17 14:22:54

Ok, NetworkManager is not involved.

There should be no route-br0 file.
Route to xxx.171.204.1 makes no sense, because the ifcfg-br0 should set "xxx.171.204.0/22 dev br0" automatically and that covers xxx.171.204.1.
GATEWAY=xxx171.204.1 in file /etc/sysconfig/network should set the default route.

The virbr0 is created by libvirt. If you will not add any VM's to that network, then disable and stop it:

Code: Select all

virsh net-autostart default --disable
virsh net-destroy default
There is no apparent reason for the address xxx.171.204.107/22 on the enp7s0.
Some other script outside of normal network configuration (rc.local?) does set that address.
Last edited by jlehtone on 2020/05/18 06:32:59, edited 1 time in total.

User avatar
ben_tvpp
Posts: 62
Joined: 2018/12/04 13:28:51

Re: Bridge setup for KVM odity - no IPADDR in main interface but there is one shown in 'if ADDR'

Post by ben_tvpp » 2020/05/17 23:04:25

So I could use virbr0 instead of br0 but if I am using br0 I should delete virbr0.

GATEWAY goes on the bridge not enp7s0?

Ben

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

Re: Bridge setup for KVM odity - no IPADDR in main interface but there is one shown in 'if ADDR'

Post by jlehtone » 2020/05/18 06:59:21

The virbr0, the virtual network "default" has subnet 192.168.122.0/24. Libvirtd defines it and runs an instance of dnsmasq for it. The dnsmasq acts as both DHCP and DNS server for the VM's in that subnet. The host routes between 192.168.122.0/24 and other subnets and masquerades traffic coming from 192.168.122.0/24.

According to your previous threads, you don't want that route&NAT network.


The 'ifup' script of network.service does source config files, including the ifcfg-devicename and /etc/sysconfig/network.
The /etc/sysconfig/network is sourced with every device. Defining GATEWAY only in that file ensures that there is only one gateway.
See https://access.redhat.com/documentation ... tic-routes

The default gateway must be reachable. All members of 172.18.0.0/16, 192.168.122.0/24, and xxx.171.204.0/22 are link-local and thus reachable.


To have same address (xxx.171.204.107/22) on multiple interfaces (enp2s0 and br0) is a configuration error.
Where is xxx.171.204.107 mentioned?

Code: Select all

grep -r "171.204.107" /etc

User avatar
ben_tvpp
Posts: 62
Joined: 2018/12/04 13:28:51

Re: Bridge setup for KVM odity - no IPADDR in main interface but there is one shown in 'if ADDR'

Post by ben_tvpp » 2020/05/20 10:01:45

171.204.107 is mentions a LOT of times. As well as KVM the host is running Virtualmin with several websites.

Things have moved on a bit. I had to tell my hosting company the MAC address, as setup network per there instructions. But now I have same IP twice on br0 as well as enp7s0.

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether 2c:4d:54:43:92:df brd ff:ff:ff:ff:ff:ff
    inet xxx.171.204.107/22 brd 213.171.207.255 scope global enp7s0
       valid_lft forever preferred_lft forever
    inet6 fe80::2e4d:54ff:fe43:92df/64 scope link 
       valid_lft forever preferred_lft forever
3: enp8s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 2c:4d:54:43:92:e0 brd ff:ff:ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 2c:4d:54:43:92:df brd ff:ff:ff:ff:ff:ff
    inet xxx.171.204.107/32 brd 213.171.204.107 scope global br0
       valid_lft forever preferred_lft forever
    inet xxx.171.204.107/22 brd 213.171.207.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::2e4d:54ff:fe43:92df/64 scope link 
       valid_lft forever preferred_lft forever
5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:56:31:0e brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
6: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:56:31:0e brd ff:ff:ff:ff:ff:ff
12: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:3e:e4:07 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fe3e:e407/64 scope link 
       valid_lft forever preferred_lft forever
I did try removing the route-br0, and lost all access to the server. This is how Fasthosts network setup works.

So what I have is

Bridge

Code: Select all

DEVICE="br0"
NM_CONTROLLED="no"
ONBOOT=yes
#HWADDR=2c:4d:54:43:92:df
TYPE=Bridge
BOOTPROTO=static
IPADDR=xxx.171.204.107
NETMASK=255.255.255.255
DNS1=212.227.123.16
DNS2=212.227.123.17
DNS3=8.8.8.8
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System br0"
Route

Code: Select all

10.255.255.1 dev br0
default via 10.255.255.1 dev br0
NIC

Code: Select all

DEVICE="enp7s0"
NM_CONTROLLED="no"
ONBOOT=yes
#HWADDR=2c:4d:54:43:92:df
TYPE=Ethernet
BOOTPROTO=none
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System enp7s0"
BRIDGE=br0
I am starting to lose hope;).

Post Reply

Return to “CentOS 7 - General Support”