summaryrefslogtreecommitdiff
path: root/Generate
diff options
context:
space:
mode:
Diffstat (limited to 'Generate')
-rwxr-xr-xGenerate8
1 files changed, 7 insertions, 1 deletions
diff --git a/Generate b/Generate
index 9de41fa..a17b9a1 100755
--- a/Generate
+++ b/Generate
@@ -426,6 +426,13 @@ hostlist.each{ |host|
host['networks6'].each_key{ |net|
outmaps << "ipv6 prefix-list pl#{ net.tr(':./', '-_') } seq 10 permit #{net} #{net =~ /\/128/ ? '' : "le 128"}"
}
+ hostlist.each{ |otherhost|
+ next if host['name'] == otherhost['name']
+ next unless otherhost['bgp_preference']
+ inmaps << "!"
+ inmaps << "! Create an ACL for anything that passes through AS#{otherhost['asn']} (#{otherhost['name']})"
+ inmaps << "ip as-path access-list passthruAS#{otherhost['asn']} permit _#{otherhost['asn']}_"
+ }
mapdups = {}
host['peer_map_name'] = {}
peers.each{ |peer|
@@ -468,7 +475,6 @@ hostlist.each{ |host|
next unless otherhost['bgp_preference']
inmaps << "!"
inmaps << "! Anything that passes through AS#{otherhost['asn']} (#{otherhost['name']}) gets a lower preference"
- inmaps << "ip as-path access-list passthruAS#{otherhost['asn']} permit _#{otherhost['asn']}_"
inmaps << "route-map IN#{mapname} permit #{seq}"; seq = seq + 1
inmaps << " match as-path passthruAS#{otherhost['asn']}"
inmaps << " set local-preference #{otherhost['bgp_preference']}"