1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00
CumulusNetworks-ifupdown2/docs/examples/interfaces_bridge_template_func
Roopa Prabhu ff50f301d5 move ifupdown2/* .
ifupdown2 code was one level deeper because ifupdown2 initially
had ifupdown2 and ifupdown2-addons as two separate packages.
Since they were combined into one package, it makes sense to
move all combined code under the top level directory

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2015-08-02 05:05:52 -07:00

34 lines
1006 B
Plaintext

#
# mako template function to create a bridge
#
# mako defs provide the advantage of declaring predefined functions in
# separate files.
#
# Below is an example that illustrates how to define such functions and use
# them in the /etc/network/interfaces file to create bridges
#
# This file defines a function makebr to create a bridge. The arguments to the
# function are vlan and ip address of the bridge.
#
# The default directory for template functions is
# /etc/network/ifupdown2/templates/. Copy this file under the template
# dir (create the directory if does not exist)
#
# To use this template function in /etc/network/interfaces, add the following
# to the /etc/network/interfaces file:
#
# <%namespace name="bridge" file="/bridge_template"/>
#
# ${bridge.makebr(1096, "10.0.23.2/24")}
# ${bridge.makebr(1097, "10.0.23.3/24")}
#
#
<%def name="makebr(vlan, addr)">
auto br${vlan}
iface br${vlan} inet static
address ${addr}
bridge-ports swp1.${vlan} swp2.${vlan}
bridge-stp on
</%def>