diff options
-rwxr-xr-x | Generate | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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']}" |