🔫
Debian 12 の bonding を試す
前提
https://zenn.dev/mnod/articles/3888b5cb9a4591 の続編。
Debian 12 の bonding を利用して、Cisco スイッチと接続してみる。
Active-Standby の bonding を試す
Cisco スイッチでの作業
vlan を作成
vlan 10
name 0010
vlan 20
name 0020
vlna10 のアクセスポート
int range fa1/0 - 3
switchport mode access
switchport access vlan 10
vlna20 のアクセスポート
int range fa1/4 - 7
switchport mode access
switchport access vlan 20
Etherchannel を作成して、vlan10 のアクセスポートとする。
int range fa1/2 -3
channel-group 1 mode on
int po1
switchport mode access
確認
ESW1#show etherchannel summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
R - Layer3 S - Layer2
U - in use
Group Port-channel Ports
-----+------------+-----------------------------------------------------------
1 Po1(SU) Fa1/2(P) Fa1/3(P)
ESW1#show etherchannel detail
Channel-group listing:
-----------------------
Group: 1
----------
Group state = L2
Ports: 2 Maxports = 8
Port-channels: 1 Max Port-channels = 1
Ports in the group:
-------------------
Port: Fa1/2
------------
Port state = Up Mstr In-Bndl
Channel group = 1 Mode = On/FEC Gcchange = 0
Port-channel = Po1 GC = 0x00010001 Pseudo port-channel = Po1
Port index = 0
Age of the port in the current state: 00d:00h:00m:42s
Port: Fa1/3
------------
Port state = Up Mstr In-Bndl
Channel group = 1 Mode = On/FEC Gcchange = 0
Port-channel = Po1 GC = 0x00010001 Pseudo port-channel = Po1
Port index = 1
Age of the port in the current state: 00d:00h:00m:42s
Port-channels in the group:
----------------------
Port-channel: Po1
------------
Age of the Port-channel = 00d:00h:00m:43s
Logical slot/port = 8/0 Number of ports = 2
GC = 0x00010001 HotStandBy port = null
Port state = Port-channel Ag-Inuse
Ports in the Port-channel:
Index Port EC state
------+------+------------
0 Fa1/2 on
1 Fa1/3 on
Time since last port bundled: 00d:00h:00m:43s Fa1/3
ESW1#show vlan-s
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa1/8, Fa1/9, Fa1/10, Fa1/11
Fa1/12, Fa1/13, Fa1/14, Fa1/15
10 vlan0010 active Fa1/0, Fa1/1, Po1
20 vlan0020 active Fa1/4, Fa1/5, Fa1/6, Fa1/7
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 1002 1003
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 1 1003
1003 tr 101003 1500 1005 0 - - srb 1 1002
1004 fdnet 101004 1500 - - 1 ibm - 0 0
1005 trnet 101005 1500 - - 1 ibm - 0 0
Linux での作業
Active-Standbyの bonding設定
auto bond0
iface bond0 inet static
address 10.2.0.254
netmask 255.255.255.0
network 10.2.0.0
#gateway x.x.x.x
bond-slaves ens3 ens4
bond-mode 0
bond-miimon 100
bond-downdelay 200
#bond-updelay 200
#bond-lacp-rate 0
#bond-xmit-hash-policy layer2+3
bond-xmit-hash-policy layer2
systemctl restart networking
を実行後に確認
# ip a show bond0
27: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 0c:8f:23:a9:00:00 brd ff:ff:ff:ff:ff:ff
inet 10.2.0.254/24 brd 10.2.0.255 scope global bond0
valid_lft forever preferred_lft forever
inet6 fe80::e8f:23ff:fea9:0/64 scope link
valid_lft forever preferred_lft forever
疎通確認
同一VLANから疎通確認
PC1> ip 10.2.0.2 255.255.255.0
Checking for duplicate address...
PC1 : 10.2.0.2 255.255.255.0
PC1> ping 10.2.0.254
84 bytes from 10.2.0.254 icmp_seq=1 ttl=64 time=1.024 ms
84 bytes from 10.2.0.254 icmp_seq=2 ttl=64 time=1.067 ms
84 bytes from 10.2.0.254 icmp_seq=3 ttl=64 time=1.019 ms
84 bytes from 10.2.0.254 icmp_seq=4 ttl=64 time=0.974 ms
84 bytes from 10.2.0.254 icmp_seq=5 ttl=64 time=0.963 ms
ラウンドロビンによるロードバランスを試す
Linux での作業
トランクポートとして設定してみる。
vlan10、vlan20 を設定する。
auto bond0
iface bond0 inet manual
#address 10.2.0.254
#netmask 255.255.255.0
#network 10.2.0.0
#gateway x.x.x.x
bond-slaves ens3 ens4
bond-mode 0
#bond-mode 802.3ad
bond-miimon 100
bond-downdelay 200
bond-updelay 200
#bond-lacp-rate 0
bond-xmit-hash-policy layer2+3
up ifconfig bond0 0.0.0.0 up
auto bond0.10
iface bond0.10 inet static
address 10.2.10.254
netmask 255.255.255.0
vlan-raw-device bond0
auto bond0.20
iface bond0.20 inet static
address 10.2.20.254
netmask 255.255.255.0
vlan-raw-device bond0
# ip a show bond0
28: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 0c:8f:23:a9:00:00 brd ff:ff:ff:ff:ff:ff
inet6 fe80::e8f:23ff:fea9:0/64 scope link
valid_lft forever preferred_lft forever
# ip a show bond0.10
29: bond0.10@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 0c:8f:23:a9:00:00 brd ff:ff:ff:ff:ff:ff
inet 10.2.10.254/24 brd 10.2.10.255 scope global bond0.10
valid_lft forever preferred_lft forever
inet6 fe80::e8f:23ff:fea9:0/64 scope link
valid_lft forever preferred_lft forever
# ip a show bond0.20
30: bond0.20@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 0c:8f:23:a9:00:00 brd ff:ff:ff:ff:ff:ff
inet 10.2.20.254/24 brd 10.2.20.255 scope global bond0.20
valid_lft forever preferred_lft forever
inet6 fe80::e8f:23ff:fea9:0/64 scope link
valid_lft forever preferred_lft forever
Cisco スイッチの設定
Etherchannel をトランクポートとして利用する。
int range fa1/2 - 3
no channel-group 1 mode on
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode on
int po1
switchport trunk encapsulation dot1q
switchport mode trunk
確認
ESW1#show int trunk
Port Mode Encapsulation Status Native vlan
Po1 on 802.1q trunking 1
Port Vlans allowed on trunk
Po1 1-4094
Port Vlans allowed and active in management domain
Po1 1,10,20
Port Vlans in spanning tree forwarding state and not pruned
Po1 none
ESW1#show etherchannel summary
Flags: D - down P - in port-channel
I - stand-alone s - suspended
R - Layer3 S - Layer2
U - in use
Group Port-channel Ports
-----+------------+-----------------------------------------------------------
1 Po1(SU) Fa1/2(P) Fa1/3(P)
ESW1#show etherchannel detail
Channel-group listing:
-----------------------
Group: 1
----------
Group state = L2
Ports: 2 Maxports = 8
Port-channels: 1 Max Port-channels = 1
Ports in the group:
-------------------
Port: Fa1/2
------------
Port state = Up Mstr In-Bndl
Channel group = 1 Mode = On/FEC Gcchange = 0
Port-channel = Po1 GC = 0x00010001 Pseudo port-channel = Po1
Port index = 0
Age of the port in the current state: 00d:00h:00m:45s
Port: Fa1/3
------------
Port state = Up Mstr In-Bndl
Channel group = 1 Mode = On/FEC Gcchange = 0
Port-channel = Po1 GC = 0x00010001 Pseudo port-channel = Po1
Port index = 1
Age of the port in the current state: 00d:00h:00m:45s
Port-channels in the group:
----------------------
Port-channel: Po1
------------
Age of the Port-channel = 00d:00h:05m:11s
Logical slot/port = 8/0 Number of ports = 2
GC = 0x00010001 HotStandBy port = null
Port state = Port-channel Ag-Inuse
Ports in the Port-channel:
Index Port EC state
------+------+------------
0 Fa1/2 on
1 Fa1/3 on
Time since last port bundled: 00d:00h:00m:46s Fa1/3
Time since last port Un-bundled: 00d:00h:01m:32s Fa1/3
疎通確認
Vlan10 から
PC1> ip 10.2.10.2 255.255.255.0
Checking for duplicate address...
PC1 : 10.2.10.2 255.255.255.0
PC1> ping 10.2.10.254
84 bytes from 10.2.10.254 icmp_seq=1 ttl=64 time=2.423 ms
84 bytes from 10.2.10.254 icmp_seq=2 ttl=64 time=1.278 ms
84 bytes from 10.2.10.254 icmp_seq=3 ttl=64 time=2.318 ms
84 bytes from 10.2.10.254 icmp_seq=4 ttl=64 time=1.242 ms
84 bytes from 10.2.10.254 icmp_seq=5 ttl=64 time=1.490 ms
Vlan20 から
PC2> ip 10.2.20.2 255.255.255.0
Checking for duplicate address...
PC2 : 10.2.20.2 255.255.255.0
PC2> ping 10.2.20.254
84 bytes from 10.2.20.254 icmp_seq=1 ttl=64 time=3.917 ms
84 bytes from 10.2.20.254 icmp_seq=2 ttl=64 time=5.371 ms
84 bytes from 10.2.20.254 icmp_seq=3 ttl=64 time=1.332 ms
84 bytes from 10.2.20.254 icmp_seq=4 ttl=64 time=1.417 ms
84 bytes from 10.2.20.254 icmp_seq=5 ttl=64 time=1.358 ms
こまったら、Ciscoのインタフェースを shut / no shut してみる。
Discussion