stretch network config for kvm doesn't work

Discussion in 'Installation/Configuration' started by jeensg, Jul 26, 2017.

  1. jeensg

    jeensg New Member

    Hey, I'v been trying all around, reading guides for installation and so long, always loose connection to our root-server after changing network setup. We did this before on debian8 and all worked well, now it doesn't want to work ... hope somebody can help. We have seperate IPs for virtual machines and want to get in bridged mode, as we had before...

    Server: hetzner root-Server
    Installation: Debian-90-stretch-64-minimal
    2 drives with RAID 1, partitions as follows: swap 16G, /boot 1G, / 10G, /home 10G, /var/log 1G

    After plain installation, I do check network-setup: ifconfig
    Code:
    enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
      inet <main-ip>  netmask <given-from-hetzner>  broadcast <given-from-hetzner>
    and so on

    /etc/network/interfaces reads as follows:
    Code:
    ### Hetzner Online GmbH installimage
    
    source /etc/network/interfaces.d/*
    
    auto lo
    iface lo inet loopback
    iface lo inet6 loopback
    
    auto enp4s0
    iface enp4s0 inet static
      address <main-IP>
      netmask <given-from-hetzner>
      gateway <given-from-hetzner>
      # route <given-from-hetzner>/27 via <given-from-hetzner>
      up route add -net <given-from-hetzner> netmask <given-from-hetzner> gw <given-from-hetzner> dev enp4s0
    
    iface enp4s0 inet6 static
      address <given-from-hetzner>::2
      netmask 64
      gateway <given-from-hetzner>
    Afterwards I follow the steps from debian-wiki: Setting_up_your_Bridge

    To get a bridge up and running, I do install bridge-utils:
    Code:
    apt update
    apt upgrade
    apt install bridge-utils
    I do add a bridge:
    Code:
    brctl addbr br0
    Result is:
    Code:
    ip address show
    3: br0: <BROADCAST,MULTICAST>
    besides 1: lo and 2: enp4s0 (if you'd need more info here, I could post more)

    Next one is:
    Code:
    brctl addif br0 enp4s0
    and check, it's gone! Can't get any connection, ping is suddenly lost. If I do a soft reboot, everything is fine since the changes before were not static.

    I also did try to do same things with /etc/network/interfaces, (re-)added stuff, took something away, and so on. Tried different guides from debian-, hetzner- and other wikis, always with the same result of loosing connectiong / server not coming up...

    Normally I can go back via rescue-sonsole, but sometimes it can't even start anymore, although I put exact config from beginning in /etc/network/interfaces and reboot ... any ideas? please help!
     
  2. jeensg

    jeensg New Member

    The following guides, besides others, were tried:
    debian-wiki KVM#Between_VM_host.2C_guests_and_the_world
    hetzner-wiki Netzkonfiguration_Debian/en#Bridged
    hetzner-wiki KVM_mit_Nutzung_aller_IPs_-_the_easy_way#Host
     
  3. jeensg

    jeensg New Member

    Spocky, it works.
    If so, one need to add MAC-address in /etc/network/interfaces for br0!
    Code:
    hwaddress ether c8:xx:00:xx:xx:xx
     
  4. jeensg

    jeensg New Member

    Now my complete /etc/network/interfaces looks like this:
    Code:
    ### Hetzner Online GmbH installimage
    
    #source /etc/network/interfaces.d/*
    
    auto lo
    iface lo inet loopback
    iface lo inet6 loopback
    
    #auto enp4s0
    #iface enp4s0 inet static
    #  address <main-IP>
    #  netmask <given-from-hetzner>
    #  gateway <given-from-hetzner>
    #  # route .../27 via ...
    #  up route add -net ... netmask ... gw ... dev enp4s0
    
    #iface enp4s0 inet6 static
    #  address .....::2
    #  netmask 64
    #  gateway fe80::1
    
    auto  br0
    iface br0 inet static
      address <main-IP>
      netmask <given-from-hetzner>
      gateway <given-from-hetzner>
      hwaddress ether <your-MAC>
      bridge_ports enp4s0
      bridge_stp off
      bridge_fd 1
      bridge_hello 2
      bridge_maxage 12
    
    iface br0 inet6 static
      address <main-IPv6>::2
      netmask 64
      gateway fe80::1
     

Share This Page