forked from ksator/openconfig-demo-with-juniper-devices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bgp.j2
65 lines (65 loc) · 1.41 KB
/
bgp.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
interfaces {
{% for item in topology %}
{{ item.interface }} {
unit 0 {
family inet {
address {{ item.address }}/24;
}
}
}
{% endfor %}
}
replace:
openconfig-bgp:bgp {
neighbors {
{% for item in bgp_neighbors %}
neighbor {{ item.address }} {
config {
peer-as {{ item.as }};
peer-group {{ item.group }} ;
neighbor-address {{ item.address }};
enabled true;
}
}
{% endfor %}
}
peer-groups {
{% for item in bgp_groups %}
peer-group {{ item.name }} {
config {
local-as {{ item.local_as }};
peer-type {{ item.type }};
peer-group-name {{ item.name }};
}
apply-policy {
config {
import-policy {{ item.import_policy }};
export-policy {{ item.export_policy }};
}
}
}
{% endfor %}
}
}
protocols {
replace:
lldp {
{% for item in topology %}
interface "{{ item.interface }}";
{% endfor %}
interface fxp0 {
disable;
}
}
}
replace:
policy-options {
{% for item in bgp_groups %}
policy-statement {{ item.import_policy }} {
then accept;
}
policy-statement {{ item.export_policy }} {
then accept;
}
{% endfor %}
}