# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
eth1:
dhcp4: no
dhcp6: no
optional: true
eth2:
dhcp4: no
dhcp6: no
optional: true
eth3:
dhcp4: no
dhcp6: no
optional: true
vlans:
vlan101:
accept-ra: no
id: 101
link: eth0
vlan102:
accept-ra: no
id: 102
link: eth0
vlan201:
accept-ra: no
id: 201
link: eth0
vlan202:
accept-ra: no
id: 202
link: eth0
bridges:
br0:
interfaces: [vlan101]
dhcp4: no
parameters:
stp: false
forward-delay: 0
br1:
interfaces: [vlan201]
dhcp4: no
parameters:
stp: false
forward-delay: 0
br2:
interfaces: [vlan102]
dhcp4: no
parameters:
stp: false
forward-delay: 0
br3:
interfaces: [vlan202]
dhcp4: no
parameters:
stp: false
forward-delay: 0
bonds:
bond0:
dhcp4: no
dhcp6: no
addresses: [172.28.101.240/24]
gateway4: 172.28.101.254
mtu: 9000
nameservers:
addresses: [223.6.6.6,223.5.5.5]
interfaces:
- eth2
- eth3
parameters:
mode: active-backup
配置二:
# cat /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
enp132s0f0:
dhcp4: no
dhcp6: no
optional: true
eno1:
dhcp4: no
dhcp6: no
optional: true
vlans:
vlan200:
accept-ra: no
id: 200
link: bond0
vlan201:
accept-ra: no
id: 201
link: bond0
vlan202:
accept-ra: no
id: 202
link: bond0
vlan203:
accept-ra: no
id: 203
link: bond0
vlan204:
accept-ra: no
id: 204
link: bond0
bridges:
br0:
interfaces: [bond0]
dhcp4: no
addresses: [10.33.240.211/24]
gateway4: 10.33.240.254
nameservers:
addresses: [223.6.6.6,223.5.5.5]
parameters:
stp: false
forward-delay: 0
br200:
interfaces: [vlan200]
dhcp4: no
parameters:
stp: false
forward-delay: 0
br201:
interfaces: [vlan201]
dhcp4: no
parameters:
stp: false
forward-delay: 0
bonds:
bond0:
dhcp4: no
dhcp6: no
mtu: 9000
interfaces:
- eno1
- enp132s0f0
parameters:
mode: active-backup
# mode: 802.3ad
# lacp-rate: fast
mii-monitor-interval: 100