]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
Change names and s/br/bridge/
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Wed, 26 Nov 2014 05:53:38 +0000 (21:53 -0800)
committerRoopa Prabhu <roopa@cumulusnetworks.com>
Wed, 26 Nov 2014 21:07:12 +0000 (13:07 -0800)
Ticket: CM-3346
Reviewed By:
Testing Done: Tested ifupdown2 sanity with all example files
(cherry picked from commit 40a3f646548c35bda34f4d41adb2e935374bb029)

docs/examples/vlan_aware_bridges/interfaces.basic [new file with mode: 0644]
docs/examples/vlan_aware_bridges/interfaces.vlan_prune_and_access_ports [new file with mode: 0644]
docs/examples/vlan_aware_bridges/interfaces.with_bonds [new file with mode: 0644]
docs/examples/vlan_aware_bridges/interfaces.with_clag [new file with mode: 0644]

diff --git a/docs/examples/vlan_aware_bridges/interfaces.basic b/docs/examples/vlan_aware_bridges/interfaces.basic
new file mode 100644 (file)
index 0000000..0c64835
--- /dev/null
@@ -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 the bridge br
+# 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
diff --git a/docs/examples/vlan_aware_bridges/interfaces.vlan_prune_and_access_ports b/docs/examples/vlan_aware_bridges/interfaces.vlan_prune_and_access_ports
new file mode 100644 (file)
index 0000000..95b6400
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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-portautoedge 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-portautoedge yes
+      mstpctl-bpduguard yes
+     
+# The following port is the trunk uplink and inherits all vlans
+# from bridge br
+auto swp49
+iface swp49
+      mstpctl-portpathcost 10
+
+# The following port is the trunk uplink and inherits all vlans
+# from bridge br
+auto swp50
+iface swp50
+      mstpctl-portpathcost 0
+
+#
+# ports swp3-swp48 are trunk ports which inherit vlans from the bridge br
+# 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
diff --git a/docs/examples/vlan_aware_bridges/interfaces.with_bonds b/docs/examples/vlan_aware_bridges/interfaces.with_bonds
new file mode 100644 (file)
index 0000000..7a1781a
--- /dev/null
@@ -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 br
+#
+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
diff --git a/docs/examples/vlan_aware_bridges/interfaces.with_clag b/docs/examples/vlan_aware_bridges/interfaces.with_clag
new file mode 100644 (file)
index 0000000..e57b734
--- /dev/null
@@ -0,0 +1,83 @@
+#
+# 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
+#
+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
+
+# 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
+
+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
+
+# 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