From aee49d16a978c3d6b3386a6bb173b89ba50d3e1e Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 8 Mar 2016 17:26:00 +0100 Subject: [PATCH] Define pref-src for AMPR routes By defining the pref-src for AMPR routes the Mikrotik router will source requests sent via AMPR routes and tunnels from a 44net address instead of a private RFC1918 or a commercial IP address. --- updateros.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/updateros.py b/updateros.py index 2308cc0..d37c9fe 100755 --- a/updateros.py +++ b/updateros.py @@ -28,6 +28,7 @@ ssh_port = 22 username = None distance = 30 +ampr_source = "44.128.0.1" # replace with a 44net address which exists on your host # blacklist BGP-announced networks with direct-routing agreements bgp_networks = [ @@ -157,7 +158,7 @@ def main(): edge_router_ip, interface, entry['gatewayIP'], "AMPR last updated %s, added %s" % ( entry['updated'].date(), date.today()))) - commands.append("/ip route add dst-address=%s gateway=%s distance=%s" % (entry.network(), interface, distance)) + commands.append("/ip route add dst-address=%s gateway=%s distance=%s pref-src=%s" % (entry.network(), interface, distance, ampr_source)) commands.append("/ip neighbor discovery set %s discover=no" % (interface)) if "-v" in sys.argv: