Created
March 3, 2015 23:05
-
-
Save Mierdin/ccf78adeb42f8dc46f6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <configuration> | |
| {%- if bgp %} | |
| <routing-options> | |
| <autonomous-system operation="replace"> | |
| <as-number>{{ bgp.as }}</as-number> | |
| </autonomous-system> | |
| </routing-options> | |
| <protocols> | |
| <bgp operation="replace"> | |
| {%- if bgp.advertise is defined %} | |
| <export>BGP_NETWORK</export> | |
| {%- endif %} | |
| {% for groupname, grouplist in bgp.groups.iteritems() %} | |
| <group> | |
| <name>{{ groupname }}</name> | |
| <type>external</type> | |
| {% for neighbor in grouplist %} | |
| <neighbor> | |
| <name>{{ neighbor.addr }}</name> | |
| <peer-as>{{ neighbor.as }}</peer-as> | |
| </neighbor> | |
| {% endfor %} | |
| </group> | |
| {% endfor %} | |
| </bgp> | |
| </protocols> | |
| {%- if bgp.advertise is defined %} | |
| <policy-options operation="replace"> | |
| <policy-statement> | |
| <name>BGP_NETWORK</name> | |
| <term> | |
| <name>1</name> | |
| <from> | |
| {% for prefix in bgp.advertise %} | |
| <route-filter> | |
| <address>{{ prefix }}</address> | |
| <exact/> | |
| </route-filter> | |
| {% endfor %} | |
| </from> | |
| <then> | |
| <accept/> | |
| </then> | |
| </term> | |
| </policy-statement> | |
| </policy-options> | |
| {%- endif %} | |
| {%- endif %} | |
| </configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment