Zum Inhalt springen

Linux/Netzwerk/Konfiguration/VLAN Bonding: Unterschied zwischen den Versionen

Aus Foxwiki
K Textersetzung - „ “ durch „ “
 
Zeile 16: Zeile 16:


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




Zeile 40: Zeile 40:
  auto bond0
  auto bond0
  iface bond0 inet manual
  iface bond0 inet manual
  up ifconfig bond0 0.0.0.0 up
up ifconfig bond0 0.0.0.0 up
  slaves eth1 eth0
slaves eth1 eth0
  auto vlan10
  auto vlan10
  iface vlan10 inet static
  iface vlan10 inet static
  address 10.10.10.12/24
address 10.10.10.12/24
  vlan-raw-device bond0
vlan-raw-device bond0
  gateway 10.10.0.1
gateway 10.10.0.1
  dns-search hup.hu
dns-search hup.hu
  dns-nameservers 10.10.0.2
dns-nameservers 10.10.0.2
  auto vlan20
  auto vlan20
  iface vlan20 inet static
  iface vlan20 inet static
  address 10.20.10.12/24
address 10.20.10.12/24
  vlan-raw-device bond0
vlan-raw-device bond0
  auto vlan30
  auto vlan30
  iface vlan30 inet static
  iface vlan30 inet static
  address 10.30.10.12/24
address 10.30.10.12/24
  vlan-raw-device bond0
vlan-raw-device bond0
   
   
* In Debian Buster, you must use interface names for VLANs in the form of: <tt>bond0.10</tt>, <tt>bond0.20</tt>, and <tt>bond0.30</tt> instead of <tt>vlan10</tt>, <tt>vlan20</tt>, <tt>vlan30</tt>
* In Debian Buster, you must use interface names for VLANs in the form of: <tt>bond0.10</tt>, <tt>bond0.20</tt>, and <tt>bond0.30</tt> instead of <tt>vlan10</tt>, <tt>vlan20</tt>, <tt>vlan30</tt>
Zeile 68: Zeile 68:
  auto bond0
  auto bond0
  iface bond0 inet manual
  iface bond0 inet manual
  up ifconfig lacptrunk0 0.0.0.0 up
up ifconfig lacptrunk0 0.0.0.0 up
  slaves eth0 eth1
slaves eth0 eth1
  # bond-mode 4 = 802.3ad
  # bond-mode 4 = 802.3ad
  bond-mode 4
bond-mode 4
  bond-miimon 100
bond-miimon 100
  bond-downdelay 200
bond-downdelay 200
  bond-updelay 200
bond-updelay 200
  bond-lacp-rate 1
bond-lacp-rate 1
  bond-xmit-hash-policy layer2+3
bond-xmit-hash-policy layer2+3
  post-up ifconfig eth0 mtu 9000 && ifconfig eth1 mtu 9000 && ifconfig bond0 mtu 9000
post-up ifconfig eth0 mtu 9000 && ifconfig eth1 mtu 9000 && ifconfig bond0 mtu 9000
   
   
  #vlan devices will use the MTU set on bond0 device
  #vlan devices will use the MTU set on bond0 device

Aktuelle Version vom 14. Juni 2026, 00:47 Uhr

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