3

Linux下bond和br建立vlan的方法

 4 months ago
source link: https://bajie.dev/posts/20231227-vlan_bond_br/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Linux下bond和br建立vlan的方法

2023-12-27 1 分钟阅读

我们的宿主机上做了4网卡bonding,然后需要上升到br,两个网卡都需要做上vlan。

比如172.18.30.1,想在上面增加一个VLAN段202,然后在上面生产一台虚机172.18.19.2

就需要增加一个bond0.202以及br0.202

做法如下:

cd /etc/sysconfig/network-scripts

cp ifcfg-bond0.199 ifcfg-bond0.202

vi ifcfg-bond0.202
DEVICE=bond0.202
ONBOOT=yes
USERCTL=no
BRIDGE=br0.202
VLAN=yes

cp ifcfg-br0.199 ifcfg-br0.199

vi ifcfg-br0.202
DEVICE=br0.202
BOOTPROTO=static
ONBOOT=yes
TYPE=Bridge

然后启动这两个网卡,启动顺序很重要!!!

ifup bond0.202
ifup br0.202

注意,执行完以后务必检查一下两个网卡是否UP

然后产虚机就好

./vm.sh create -b br0.202 -c 4 -m 4096 -d 40  -i 172.18.19.2 -k 255.255.255.0 -g 172.18.19.254 -q 172.18.30.1 -r 172.18.30.2 ucarp-18-19-2

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK