Zum Inhalt springen

Linux/Netzwerk/Konfiguration/VLAN Bonding

Aus Foxwiki

Linux/Netzwerk/Konfiguration/VLAN Bonding

Bescheibung

Howto create fault tolerant bonding with vlan

"debian_bonding.png"

debian_bonding.dia

How to configure one of the above server active backup bonding 3 vlan {vlan10,vlan20,vlan30} Debian networking without SPOF without native vlan.

aptitude install vlan ifenslave-2.6


Network config

Cisco switch interface example config

interface GigabitEthernet1/2
description eth1
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20,30
switchport mode trunk
no ip address
no cdp enable
spanning-tree portfast trunk


bonding with active backup

Create a file /etc/modprobe.d/bonding.conf containing:

alias bond0 bonding
options bonding mode=active-backup miimon=100 downdelay=200 updelay=200 primary=eth1


/etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto bond0
iface bond0 inet manual
up ifconfig bond0 0.0.0.0 up
slaves eth1 eth0
auto vlan10
iface vlan10 inet static
address 10.10.10.12/24
vlan-raw-device bond0
gateway 10.10.0.1
dns-search hup.hu
dns-nameservers 10.10.0.2
auto vlan20
iface vlan20 inet static
address 10.20.10.12/24
vlan-raw-device bond0
auto vlan30
iface vlan30 inet static
address 10.30.10.12/24
vlan-raw-device bond0


How to set the MTU (Max transfer unit / packet size) with VLANS over a bonded interface

MTU needs to be configured on the bonding interface and slave interfaces after the reset of the configuration has been applied to the bonding interfaces. This is done using a post-up line in the bonding interface configuration.

auto bond0
iface bond0 inet manual
up ifconfig lacptrunk0 0.0.0.0 up
slaves eth0 eth1
# bond-mode 4 = 802.3ad
bond-mode 4
bond-miimon 100
bond-downdelay 200
bond-updelay 200
bond-lacp-rate 1
bond-xmit-hash-policy layer2+3
post-up ifconfig eth0 mtu 9000 && ifconfig eth1 mtu 9000 && ifconfig bond0 mtu 9000

#vlan devices will use the MTU set on bond0 device
auto vlan101
iface vlan101 inet static

address 10.101.60.123/24
gateway 10.155.60.1
vlan-raw-device bond0

auto vlan151
iface vlan151 inet static

address 192.168.1.1/24
vlan-raw-device bond0