V
V
Vladimir Kivva2015-11-12 01:26:48
Computer networks
Vladimir Kivva, 2015-11-12 01:26:48

Why does the network break when restarting on Proxmox?

eth0 - physical card
vmbr0 - bridge to it
vmbr1 - bridge for virtual machines
Everything works fine until the first network restart, after that virtual machines from 192.168.1.x stop pinging
Interface configuration:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static
  address  a.b.c.d
  broadcast e.f.g.h
  netmask  255.255.255.224
  gateway  k.l.m.n
  bridge_ports eth0
  bridge_stp off
  bridge_fd 1
  bridge_hello 2
  bridge_maxage 12

auto vmbr1
iface vmbr1 inet static
  address  192.168.1.1
  netmask  255.255.255.0
  bridge_ports none
  bridge_stp off
  bridge_fd 0
  post-up echo 1 > /proc/sys/net/ipv4/ip_forward
  post-up iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE
  post-up iptables-restore /etc/network/firewall.rules
  post-down iptables -t nat -D POSTROUTING -s '192.168.1.0/24' -o vmbr0 -j MASQUERADE

What happens when you try to lower and raise vmbr1:
[email protected] ~ # ifup vmbr1
Waiting for vmbr1 to get ready (MAXWAIT is 2 seconds).
RTNETLINK answers: File exists
Failed to bring up vmbr1.
[email protected] ~ # ifdown vmbr1
ifdown: interface vmbr1 not configured

This shows vmbr1 as UP but doesn't work. Pings only 192.168.1.1 (himself)
vmbr1     Link encap:Ethernet  HWaddr 5e:12:36:ca:29:84  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::5c12:36ff:feca:2984/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1966 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:82924 (80.9 KiB)

RX bytes = 0 and there is no internet on the VMs.
I tried this - the bridges are removed normally, but the effect is the same, there is no connection:
ip link set vmbr1 down
ip link set vmbr0 down
brctl delbr vmbr1
brctl delbr vmbr0
service networking restart

On the Internet they write - "reboot and everything will be fine", but I'm not satisfied with this approach to the hypervisor. Where is the mistake?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrew, 2015-11-12
@drevil

why do you need this garden with nat and 2nd bridge?

P
Puma Thailand, 2015-11-12
@opium

Well, why stop him?
And why are you virtualok interfaces then into it after you threw them out. That is, they must magically appear there themselves

A
alegzz, 2015-11-12
@alegzz

if there is static on virtual machines, it makes sense to prescribe allow-hotplug, not auto

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question