Replace private AS path but keep the prepending
Hi i have kind of an unusual situation where i need to replace private asn to public asn but keep the asn prepend.
I have 3 FortiGate firewalls, FG11. FG2, and FG3.
I have a BGP between FG1 and FG2, and between FG1 and FG3.
fg1 asn is set to 1111 (Public ASN example)
fg2 asn is set to 64512 (Private ASN)
fg3 asn is set to 3333 (Public ASN example)
I have set as prepend on FG2 so now the advertisements include ASN 64512 64512 64512 64512.
I would like to manipulate the bgp settings so when FG1 re-advertise to FG3 a network learned from FG2 it would replace the asn so FG3 will see asn 1111 multiple times. how can i do it?
What i did so far is creating aspath-list:
config router aspath-list
edit "as-fg2"
config rule
edit 1
set action permit
set regexp "64512"
And then i have created a route map:
config router route-map
edit "ASPATH-REPLACE"
config rule
edit 1
set match-as-path "as-fg2"
set set-aspath-action replace
set set-aspath "1111"
I have assigned the route map to BGP peering towards FG3 (set route-map-out "ASPATH-REPLACE")
Before applying the route map i was able to see the AS prepending on FG3
*> 172.16.2.0/24 10.0.1.1 0 0 1111 64512 65412 65412 65412 i <-/->
After applying the route map:
*> 172.16.2.0/24 10.0.1.1 0 0 1111 1111 i <-/->
Desired result:
*> 172.16.2.0/24 10.0.1.1 0 0 1111 1111 1111 1111 1111 i <-/->
