1

I am attempting to add three interfaces to a KVM guest (required by my hosting provider) and having little luck! I can get only one at a time to work on the guest. If I enable an adapter inside nmtui while disabling others on the CentOS 7 guest it will work but other adapters will no longer even ping. I believe there is a problem with my understanding on how bridging works and would like some pointers.

Goal: Setup a bridge on Host and three interfaces on Guest (server provider assigns MAC addresses for me to use)

Info:

xxx.yyy.107.27 - assume main IP address of the Host machine
xxx.yyy.107.1 - gateway for the above
255.255.255.192 - netmask for the above
xxx.yyy.168.170 - IP address #1 for Guest
xxx.yyy.168.171 - IP address #2 for Guest
xxx.yyy.168.174 - IP address #3 for Guest
xxx.yyy.168.169 - Gateway for IPs 1-3 given by Provider
255.255.255.248 - Netmask for IPs 1-3 given by Provider
00:50:56:00:a4:33 - MAC for IP 1
00:50:56:00:9a:97 - MAC for IP 2
00:50:56:00:ad:04 - MAC for IP 3

Debian 8 host /etc/network/interfaces:

# Loopback device:
auto lo
iface lo inet loopback

# eth0
auto eth0
iface eth0 inet manual

iface eth0 inet6 static
  address 2a01:4f8:171:101a::2
  netmask 64
  gateway fe80::1

auto br0
iface br0 inet static
 address xxx.yyy.107.27
 netmask 255.255.255.192
 gateway xxx.yyy.107.1
 broadcast xxx.yyy.107.63
 bridge_ports eth0
 bridge_fd 0
 bridge_stp off
 bridge_waitport 0
 bridge_hello 2
 bridge_maxage 12

The Libvirt network:

<network>
  <name>Host</name>
  <forward mode='bridge'/>
  <bridge name='br0'/>
</network>

The XML configuration of Guest concerning the interfaces:

    <interface type='network'>
      <mac address='00:50:56:00:a4:33'/>
      <source network='Host'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='00:50:56:00:9a:97'/>
      <source network='Host'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='00:50:56:00:ad:04'/>
      <source network='Host'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>

CentOS 7 Guest /etc/sysconfig/network-interfaces/ifcfg-eth0-1:

HWADDR=00:50:56:00:A4:33
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=18f3808e-335a-4932-93e4-683b987ddc07
DEVICE=eth0
ONBOOT=yes
PREFIX=32
PEERDNS=yes
PEERROUTES=yes

CentOS 7 Guest /etc/sysconfig/network-interfaces/ifcfg-eth1:

HWADDR=00:50:56:00:9A:97
TYPE=Ethernet
BOOTPROTO=dhcp
DNS1=213.133.98.98
DNS2=213.133.99.99
DNS3=213.133.100.100
DEFROUTE=no
IPV4_FAILURE_FATAL=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
NAME=eth1
UUID=a2c6c1e3-bfb2-4401-99e0-40f723d6d713
DEVICE=eth1
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes

I don't see any file for the third interface, something to do with Network Manager?

Guest's /etc/sysconfig/network:

GATEWAY=xxx.yyy.107.1

route -n output on Guest:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         xxx.yyy.168.169 0.0.0.0         UG    100    0        0 ens8
0.0.0.0         xxx.yyy.168.169 0.0.0.0         UG    101    0        0 eth0
xxx.yyy.168.168 0.0.0.0         255.255.255.248 U     100    0        0 ens8
xxx.yyy.168.169 0.0.0.0         255.255.255.255 UH    100    0        0 eth0
xxx.yyy.168.170 0.0.0.0         255.255.255.255 UH    100    0        0 eth0
188.40.24.199   xxx.yyy.168.169 255.255.255.255 UGH   100    0        0 ens8

route -n output on Host:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         xxx.yyy.107.1   0.0.0.0         UG    0      0        0 br0
xxx.yyy.107.0   0.0.0.0         255.255.255.192 U     0      0        0 br0

It looks like my bridge only allows one of these interfaces to reach the outside world at any given time. I would like to fix this but I'm not sure if I have the setup & understanding correct. I've probably set it up horribly wrong and weird things are happening so appreciate any help.

EDIT 1: Current state of things on guest's ifconfig:

ens8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet xxx.yyy.168.174  netmask 255.255.255.248  broadcast xxx.yyy.168.175
        inet6 fe80::250:56ff:fe00:ad04  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:00:ad:04  txqueuelen 1000  (Ethernet)
        RX packets 6456  bytes 3735538 (3.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4987  bytes 548563 (535.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet xxx.yyy.168.170  netmask 255.255.255.248  broadcast xxx.yyy.168.170
        inet6 fe80::250:56ff:fe00:a433  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:00:a4:33  txqueuelen 1000  (Ethernet)
        RX packets 1012  bytes 75375 (73.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 47  bytes 5110 (4.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet xxx.yyy.168.171  netmask 255.255.255.248  broadcast xxx.yyy.168.175
        inet6 fe80::250:56ff:fe00:9a97  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:00:9a:97  txqueuelen 1000  (Ethernet)
        RX packets 1048  bytes 77065 (75.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 22  bytes 2808 (2.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 12243  bytes 1881497 (1.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12243  bytes 1881497 (1.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Right now only xxx.yyy.168.170 is accessible from outside the guest. The rest is not even on Host.

Host's ifconfig:

br0       Link encap:Ethernet  HWaddr f8:32:e4:71:a2:87
          inet addr:xxx.yyy.107.27  Bcast:xxx.yyy.107.63  Mask:255.255.255.192
          inet6 addr: fe80::fa32:e4ff:fe71:a287/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20661927 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14207667 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3370784779 (3.1 GiB)  TX bytes:2529369626 (2.3 GiB)

eth0      Link encap:Ethernet  HWaddr f8:32:e4:71:a2:87
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22402779 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15423843 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4010564000 (3.7 GiB)  TX bytes:2731403072 (2.5 GiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:21145 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21145 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2619801 (2.4 MiB)  TX bytes:2619801 (2.4 MiB)

vnet0     Link encap:Ethernet  HWaddr fe:50:56:00:a4:33
          inet6 addr: fe80::fc50:56ff:fe00:a433/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2028 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7634 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:1219855 (1.1 MiB)  TX bytes:692099 (675.8 KiB)

vnet1     Link encap:Ethernet  HWaddr fe:50:56:00:9a:97
          inet6 addr: fe80::fc50:56ff:fe00:9a97/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:49 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6348 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:5154 (5.0 KiB)  TX bytes:520891 (508.6 KiB)

vnet2     Link encap:Ethernet  HWaddr fe:50:56:00:ad:04
          inet6 addr: fe80::fc50:56ff:fe00:ad04/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5080 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12829 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:560230 (547.0 KiB)  TX bytes:4342111 (4.1 MiB)
  • Who is the service provider? And, why aren't there any IP addresses configured in your guests? – Michael Hampton Aug 4 '16 at 9:14
  • I have added ifconfig output showing correct IPs assigned by DHCP, the provider is Hetzner.de - they require virtual machines to connect to the network with MAC addresses they provide for IP addresses. – Paweł Adamski Aug 4 '16 at 10:50
  • Your masking of IP addresses is a bit inconsistent in the question. I would prefer that one masks only the first two octets consistently, something like: xxx.yyy.101.23, so that the last two octets match the actual configuration used. Also your broadcast addresses are inconsistent in the VM guest configurations. – Tero Kilkanen Aug 4 '16 at 11:49
  • Thank you. I've edited the addresses in hopefully all places to match this preference as it improves readability. – Paweł Adamski Aug 4 '16 at 13:01
  • Thanks. How many interfaces do you have on the host? What is the ifconfig of those? – Tero Kilkanen Aug 4 '16 at 13:44
0

Hetzner has (un)fortunately told me that due to their filtering only one IP address can be active in a virtual machine at a time (?). If you ever order Additional IP addresses from Hetzner for VM purposes, only one will work at any given time per VM. To have multiple IPs on a VM Hetzner provides Subnets (smallest /29 at the moment). I hope this helps anyone that would have a similar problem as this is not outlined in their documentation.

EDIT: This is "resolved" - I will need to wait a few hours before I can accept my answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.