Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ To prepare a Debian machine to build Kees:
sudo apt install python3-pip bgpq3 python3-jinja2
sudo pip3 install rtrsub
sudo pip3 install numpy
sudo pip3 install ipaddr
sudo pip3 install pyyaml
sudo pip install jinja2
sudo pip install hiyapyco
Expand Down
10 changes: 5 additions & 5 deletions peering_filters
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ from subprocess import Popen
from hashlib import sha256
from jinja2 import Environment, FileSystemLoader
from numpy import base_repr
import ipaddr
import ipaddress
import json
import os
import requests
Expand Down Expand Up @@ -125,8 +125,8 @@ ixp_map = {}
router_map = {}
for ixp in generic['ixp_map']:
ixp_map[ixp] = {}
ixp_map[ixp]['subnets'] = [ipaddr.IPNetwork(generic['ixp_map'][ixp]['ipv4_range']),
ipaddr.IPNetwork(generic['ixp_map'][ixp]['ipv6_range'])]
ixp_map[ixp]['subnets'] = [ipaddress.IPv4Network(generic['ixp_map'][ixp]['ipv4_range']),
ipaddress.IPv6Network(generic['ixp_map'][ixp]['ipv6_range'])]

# Set a default bgp_local_pref of 100, allow for IXP based override
ixp_map[ixp]['bgp_local_pref'] = 100
Expand Down Expand Up @@ -255,7 +255,7 @@ def config_snippet(asn, peer, description, ixp, router, no_filter,
sys.exit(2)
global seen_router_policy
vendor = vendor_map[router]
v = ipaddr.IPAddress(peer).version
v = ipaddress.IPAddress(peer).version
policy_name = "AUTOFILTER:%s:IPv%s" % (asn, v)

if vendor == "bird":
Expand Down Expand Up @@ -410,7 +410,7 @@ for asn in peerings:
continue

for session in sessions:
session_ip = ipaddr.IPAddress(session)
session_ip = ipaddress.IPAddress(session)
for ixp in ixp_map:
for subnet in ixp_map[ixp]['subnets']:
bgp_local_pref = ebgp_local_pref(asn, ixp, session_ip)
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# TODO: this file should provide package version information.

hiyapyco # https://github.com/zerwes/hiyapyco
ipaddr # https://github.com/google/ipaddr-py
jinja2 # https://jinja.palletsprojects.com/en/master/
numpy # https://numpy.org/
requests # https://requests.readthedocs.io/en/master/
Expand Down