Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

stretch network config for kvm doesn't work [solved]

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
jeensg
Posts: 8
Joined: 2016-08-31 13:52

stretch network config for kvm doesn't work [solved]

#1 Post by jeensg »

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: Select all

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: Select all

### 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 wiki: https://wiki.debian.org/BridgeNetworkCo ... our_Bridge

To get a bridge up and running, I do install bridge-utils:

Code: Select all

apt update
apt upgrade
apt install bridge-utils
I do add a bridge:

Code: Select all

brctl addbr br0
Result is:

Code: Select all

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: Select all

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 the following guides, always with the same result of loosing connectiong / server not coming up:
https://wiki.debian.org/KVM#Between_VM_ ... _the_world
https://wiki.hetzner.de/index.php/Netzk ... en#Bridged
https://wiki.hetzner.de/index.php/KVM_m ... y_way#Host

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!
Last edited by jeensg on 2017-08-01 20:20, edited 1 time in total.

jeensg
Posts: 8
Joined: 2016-08-31 13:52

Re: stretch network config for kvm doesn't work

#2 Post by jeensg »

Spocky, it works.
If so, one need to add MAC-address in /etc/network/interfaces for br0! Now my complete /etc/network/interfaces looks like this:

Code: Select all

### 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

Post Reply