1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

Merge 'vlan filtering bridge + vxlan + mlag + vrr' support from internal

tree to external

This also combines python-ifupdown2 and python-ifupdown2-addons package
into a single python-ifupdown2 package
This commit is contained in:
Roopa Prabhu
2015-03-06 21:46:10 -08:00
parent 59bba4c97d
commit f82758bf2c
63 changed files with 13557 additions and 230 deletions

View File

@@ -6,6 +6,9 @@
# Except bridge-ports, none of the other attributes are required. Default
# values are documented in the ifupdown-addons-interfaces(5) man page.
#
# The bridge in the example below is a vlan unaware bridge (classic linux
# bridge)
#
auto br-300
iface br-300 inet static
address 12.0.0.3/24

View File

@@ -0,0 +1,25 @@
#
# vlan-aware bridge simple example
#
# 'bridge' is a vlan aware bridge with all ports (swp1-52).
# native vlan is by default 1
#
# 'bridge-vids' attribute is used to declare vlans.
# 'bridge-pvid' attribute is used to specify native vlans if other than 1
# 'bridge-access' attribute is used to declare access port
#
#
# ports swp1-swp52 are trunk ports which inherit vlans from 'bridge'
# ie vlans 310 700 707 712 850 910
#
# the following is a vlan aware bridge with ports swp1-swp52
# It has stp on
#
auto bridge
iface bridge
bridge-vlan-aware yes
bridge-ports glob swp1-52
bridge-stp on
bridge-vids 310 700 707 712 850 910

View File

@@ -0,0 +1,59 @@
#
# vlan-aware bridge access ports and pruned vlan example
#
# 'bridge' is a vlan aware bridge with all ports (swp1-52).
# native vlan is by default 1
#
# 'bridge-vids' attribute is used to declare vlans.
# 'bridge-pvid' attribute is used to specify native vlans if other than 1
# 'bridge-access' attribute is used to declare access port
#
#
# The following is an access port to vlan 310, no trunking
auto swp1
iface swp1
bridge-access 310
mstpctl-portadminedge yes
mstpctl-bpduguard yes
# The following is a truk port that is "pruned".
# native vlan is 1, but only .1q tags of 707, 712, 850 are
# sent and received
#
auto swp2
iface swp2
bridge-vids 707 712 850
mstpctl-portadminedge yes
mstpctl-bpduguard yes
# The following port is the trunk uplink and inherits all vlans
# from 'bridge'
auto swp49
iface swp49
mstpctl-portpathcost 10
# Enable bridge assurance on uplink port using 'portnetwork' attribute
mstpctl-portnetwork yes
# The following port is the trunk uplink and inherits all vlans
# from 'bridge'
auto swp50
iface swp50
mstpctl-portpathcost 0
# Enable bridge assurance on uplink port using 'portnetwork' attribute
mstpctl-portnetwork yes
#
# ports swp3-swp48 are trunk ports which inherit vlans from the 'bridge'
# ie vlans 310,700,707,712,850,910
#
# the following is a vlan aware bridge with ports swp1-swp52
# It has stp on
#
auto bridge
iface bridge
bridge-vlan-aware yes
bridge-ports glob swp1-52
bridge-stp on
bridge-vids 310 700 707 712 850 910

View File

@@ -0,0 +1,92 @@
#
# vlan-aware bridge with bonds example
#
# uplink1, peerlink and downlink are bond interfaces.
# 'bridge' is a vlan aware bridge with ports uplink1, peerlink
# and downlink (swp2-20).
#
# native vlan is by default 1
#
# 'bridge-vids' attribute is used to declare vlans.
# 'bridge-pvid' attribute is used to specify native vlans if other than 1
# 'bridge-access' attribute is used to declare access port
#
auto lo
iface lo
auto eth0
iface eth0 inet dhcp
# bond interface
auto uplink1
iface uplink1
bond-slaves swp32
bond-mode 802.3ad
bond-miimon 100
bond-use-carrier 1
bond-lacp-rate 1
bond-min-links 1
bond-xmit-hash-policy layer2
bridge-vids 2000-2079
# bond interface
auto peerlink
iface peerlink
bond-slaves swp30 swp31
bond-mode 802.3ad
bond-miimon 100
bond-use-carrier 1
bond-lacp-rate 1
bond-min-links 1
bond-xmit-hash-policy layer3+4
bridge-vids 2000-2079 4094
# bond interface
auto downlink
iface downlink
bond-slaves swp1
bond-mode 802.3ad
bond-miimon 100
bond-use-carrier 1
bond-lacp-rate 1
bond-min-links 1
bond-xmit-hash-policy layer3+4
bridge-vids 2000-2079
#
# Declare vlans for all swp ports
# swp2-20 get vlans from 2004 to 2022.
# The below uses mako templates to generate iface sections
# with vlans for swp ports
#
%for port, vlanid in zip(range(2, 20), range(2004, 2022)) :
auto swp${port}
iface swp${port}
bridge-vids ${vlanid}
%endfor
# svi vlan 4094
auto bridge.4094
iface bridge.4094
address 11.100.1.252/24
# l2 attributes for vlan 4094
auto bridge.4094
vlan bridge.4094
bridge-igmp-querier-src 172.16.101.1
#
# vlan aware bridge
#
auto bridge
iface bridge
bridge-vlan-aware yes
bridge-ports uplink1 peerlink downlink glob swp2-20
bridge-stp on
# svi peerlink vlan
auto peerlink.4094
iface peerlink.4094
address 192.168.10.1/30
broadcast 192.168.10.3

View File

@@ -0,0 +1,87 @@
#
# vlan-aware bridge with clag example
#
#
# 'bridge' is a vlan aware bridge with ports:
# 'peer-bond spine-bond glob host-bond-0[1-2]'
#
# All ports inherit 'vlans 10 20-23' from the 'bridge-vids' attribute
# under the bridge
#
# native vlan is by default 1
#
# 'bridge-vids' attribute is used to declare vlans.
# 'bridge-pvid' attribute is used to specify native vlans if other than 1
# 'bridge-access' attribute is used to declare access port
#
# 'spine-bond host-bond-0[1-2]' are clag bonds and will be considered by
# clagd for dual connection. clag-id has to be a non-zero and has to match
# across the peer switches for the bonds to become dual connected.
# spine bond
#
auto spine-bond
iface spine-bond
bond-slaves glob swp19-22
bond-mode 802.3ad
bond-miimon 100
bond-use-carrier 1
bond-lacp-rate 1
bond-min-links 1
bond-xmit-hash-policy layer3+4
clag-id 100
# mlag bond and peer interface
#
auto peer-bond
iface peer-bond
bond-slaves glob swp23-24
bond-mode 802.3ad
bond-miimon 100
bond-use-carrier 1
bond-lacp-rate 1
bond-min-links 1
bond-xmit-hash-policy layer3+4
# sub-interface for clagd communication
#
auto peer-bond.4094
iface peer-bond.4094
address 169.254.0.1/30
clagd-peer-ip 169.254.0.2
clagd-sys-mac 44:38:39:ff:00:01
#clagd-priority 4096
# Please see man clagd for more options
# clagd-args --peerTimeout 30
# host ports
#
auto host-bond-01
iface host-bond-01
bond-slaves swp1
bond-mode 802.3ad
bond-miimon 100
bond-use-carrier 1
bond-lacp-rate 1
bond-min-links 1
bond-xmit-hash-policy layer3+4
clag-id 1
auto host-bond-02
iface host-bond-02
bond-slaves swp2
bond-mode 802.3ad
bond-miimon 100
bond-use-carrier 1
bond-lacp-rate 1
bond-min-links 1
bond-xmit-hash-policy layer3+4
clag-id 2
# the bridge
auto bridge
iface bridge
bridge-vlan-aware yes
bridge-ports peer-bond spine-bond glob host-bond-0[1-2]
bridge-stp on
bridge-vids 10 20-23