151 lines
6.4 KiB
Django/Jinja
151 lines
6.4 KiB
Django/Jinja
{% if enable_bgp %}
|
|
### Communities ###
|
|
|
|
define self_net_v4 = [
|
|
{% for route in ospf.accepted_routes[4] %}
|
|
{{ route }}{{"," if not loop.last}}
|
|
{% endfor %}
|
|
];
|
|
define self_net_v6 = [
|
|
{% for route in ospf.accepted_routes[6] %}
|
|
{{ route }}{{"," if not loop.last}}
|
|
{% endfor %}
|
|
];
|
|
|
|
{% for community in bgp['communities'] %}
|
|
define lc_{{ community }} = {{ bgp['communities'][community]['num'] }};
|
|
{% endfor %}
|
|
|
|
define bogon_asns = [
|
|
0, # RFC 7607
|
|
23456, # RFC 4893 AS_TRANS
|
|
64496..64511, # RFC 5398 and documentation/example ASNs
|
|
64512..65534, # RFC 6996 Private ASNs
|
|
65535, # RFC 7300 Last 16 bit ASN
|
|
65536..65551, # RFC 5398 and documentation/example ASNs
|
|
65552..131071, # RFC IANA reserved ASNs
|
|
4200000000..4294967294, # RFC 6996 Private ASNs
|
|
4294967295 # RFC 7300 Last 32 bit ASN
|
|
];
|
|
|
|
define transit_asns = [
|
|
174, # Cogent
|
|
701, # UUNET
|
|
1299, # Telia
|
|
2914, # NTT Ltd.
|
|
3257, # GTT Backbone
|
|
3320, # Deutsche Telekom AG (DTAG)
|
|
3356, # Level3
|
|
3491, # PCCW
|
|
4134, # Chinanet
|
|
5511, # Orange opentransit
|
|
6453, # Tata Communications
|
|
6461, # Zayo Bandwidth
|
|
6762, # Seabone / Telecom Italia
|
|
6830, # Liberty Global
|
|
7018 # AT&T
|
|
];
|
|
|
|
define ipv4_bogons = [
|
|
0.0.0.0/0, # Default
|
|
0.0.0.0/32-, # RFC 5735 Special Use IPv4 Addresses
|
|
0.0.0.0/0{0,7}, # RFC 1122 Requirements for Internet Hosts -- Communication Layers 3.2.1.3
|
|
10.0.0.0/8+, # RFC 1918 Address Allocation for Private Internets
|
|
100.64.0.0/10+, # RFC 6598 IANA-Reserved IPv4 Prefix for Shared Address Space
|
|
127.0.0.0/8+, # RFC 1122 Requirements for Internet Hosts -- Communication Layers 3.2.1.3
|
|
169.254.0.0/16+, # RFC 3927 Dynamic Configuration of IPv4 Link-Local Addresses
|
|
172.16.0.0/12+, # RFC 1918 Address Allocation for Private Internets
|
|
192.0.0.0/24+, # RFC 6890 Special-Purpose Address Registries
|
|
192.0.2.0/24+, # RFC 5737 IPv4 Address Blocks Reserved for Documentation
|
|
192.168.0.0/16+, # RFC 1918 Address Allocation for Private Internets
|
|
198.18.0.0/15+, # RFC 2544 Benchmarking Methodology for Network Interconnect Devices
|
|
198.51.100.0/24+, # RFC 5737 IPv4 Address Blocks Reserved for Documentation
|
|
203.0.113.0/24+, # RFC 5737 IPv4 Address Blocks Reserved for Documentation
|
|
224.0.0.0/4+, # RFC 1112 Host Extensions for IP Multicasting
|
|
240.0.0.0/4+ # RFC 6890 Special-Purpose Address Registries
|
|
];
|
|
|
|
define ipv6_bogons = [
|
|
::/0, # Default
|
|
::/96, # IPv4-compatible IPv6 address - deprecated by RFC4291
|
|
::/128, # Unspecified address
|
|
::1/128, # Local host loopback address
|
|
::ffff:0.0.0.0/96+, # IPv4-mapped addresses
|
|
::224.0.0.0/100+, # Compatible address (IPv4 format)
|
|
::127.0.0.0/104+, # Compatible address (IPv4 format)
|
|
::0.0.0.0/104+, # Compatible address (IPv4 format)
|
|
::255.0.0.0/104+, # Compatible address (IPv4 format)
|
|
0000::/8+, # Pool used for unspecified, loopback and embedded IPv4 addresses
|
|
0100::/8+, # RFC 6666 - reserved for Discard-Only Address Block
|
|
0200::/7+, # OSI NSAP-mapped prefix set (RFC4548) - deprecated by RFC4048
|
|
0400::/6+, # RFC 4291 - Reserved by IETF
|
|
0800::/5+, # RFC 4291 - Reserved by IETF
|
|
1000::/4+, # RFC 4291 - Reserved by IETF
|
|
2001:10::/28+, # RFC 4843 - Deprecated (previously ORCHID)
|
|
2001:20::/28+, # RFC 7343 - ORCHIDv2
|
|
2001:db8::/32+, # Reserved by IANA for special purposes and documentation
|
|
2002:e000::/20+, # Invalid 6to4 packets (IPv4 multicast)
|
|
2002:7f00::/24+, # Invalid 6to4 packets (IPv4 loopback)
|
|
2002:0000::/24+, # Invalid 6to4 packets (IPv4 default)
|
|
2002:ff00::/24+, # Invalid 6to4 packets
|
|
2002:0a00::/24+, # Invalid 6to4 packets (IPv4 private 10.0.0.0/8 network)
|
|
2002:ac10::/28+, # Invalid 6to4 packets (IPv4 private 172.16.0.0/12 network)
|
|
2002:c0a8::/32+, # Invalid 6to4 packets (IPv4 private 192.168.0.0/16 network)
|
|
3ffe::/16+, # Former 6bone, now decommissioned
|
|
4000::/3+, # RFC 4291 - Reserved by IETF
|
|
5f00::/8+, # RFC 5156 - used for the 6bone but was returned
|
|
6000::/3+, # RFC 4291 - Reserved by IETF
|
|
8000::/3+, # RFC 4291 - Reserved by IETF
|
|
a000::/3+, # RFC 4291 - Reserved by IETF
|
|
c000::/3+, # RFC 4291 - Reserved by IETF
|
|
e000::/4+, # RFC 4291 - Reserved by IETF
|
|
f000::/5+, # RFC 4291 - Reserved by IETF
|
|
f800::/6+, # RFC 4291 - Reserved by IETF
|
|
fc00::/7+, # Unicast Unique Local Addresses (ULA) - RFC 4193
|
|
fe80::/10+, # Link-local Unicast
|
|
fec0::/10+, # Site-local Unicast - deprecated by RFC 3879 (replaced by ULA)
|
|
ff00::/8+ # Multicast
|
|
];
|
|
|
|
define ixp_lans = [
|
|
{% for ixp in ixp_map %}
|
|
{{ ixp_map[ixp]['ipv6_prefix'] }}{{"," if not loop.last}} # {{ ixp }}
|
|
{% endfor %}
|
|
];
|
|
|
|
define t_localpref_50 = [
|
|
{% for asn in bgp['localpref']['50'] %}
|
|
{{ asn }}{{"," if not loop.last}}
|
|
{% endfor %}
|
|
];
|
|
define t_localpref_30 = [
|
|
{% for asn in bgp['localpref']['30'] %}
|
|
{{ asn }}{{"," if not loop.last}}
|
|
{% endfor %}
|
|
];
|
|
define t_localpref_10 = [
|
|
{% for asn in bgp['localpref']['10'] %}
|
|
{{ asn }}{{"," if not loop.last}}
|
|
{% endfor %}
|
|
];
|
|
|
|
define t_prepend_once = [
|
|
{% for asn in bgp['prepends']['once'] %}
|
|
{{ asn }}{{"," if not loop.last}}
|
|
{% endfor %}
|
|
];
|
|
define t_prepend_twice = [
|
|
{% for asn in bgp['prepends']['twice'] %}
|
|
{{ asn }}{{"," if not loop.last}}
|
|
{% endfor %}
|
|
];
|
|
define t_prepend_three = [
|
|
{% for asn in bgp['prepends']['three'] %}
|
|
{{ asn }}{{"," if not loop.last}}
|
|
{% endfor %}
|
|
];
|
|
|
|
{% else %}
|
|
# bgp is not enabled
|
|
{% endif %}
|