Configuring Outbound and Generated Routes on the Private Peer 2 Router
The Private Peer 2 router performs two main functions:
- Advertises routes local to AS 8000 to both the Exchange Peers and the ISP routers. The outbound-routes policy advertises the local static routes (that is, customers) on the router, and also advertises all routes learned by BGP that originated in either AS 8000 or AS 2468. These routes include other AS 8000 customer routes in addition to the AS 2468 customer. The AS routes are identified by an AS path regular expression match criteria in the policy.
- Advertises the
0.0.0.0/0default route to the AS 2468 customer router. To accomplish this, the Private Peer creates a generated route for0.0.0.0/0locally on the router. This generated route is further assigned a policy calledif-upstream-routes-exist, which allows only certain routes to contribute to the generated route, making it an active route in the routing table. Once the route is active, it can be sent to the AS 2468 router using BGP and the configured policies. Theif-upstream-routes-existpolicy accepts only the20.100.0.0/17route from Exchange Peer 2, and rejects all other routes. If the20.100.0.0/17route is withdrawn by the Exchange Peer, the Private Peer loses the0.0.0.0/0default route and withdraws the default route from the AS 2468 customer router.[edit]routing-options { # simulate local customer routesstatic {route 172.16.64.0/20 reject;route 172.16.80.0/20 reject;route 172.16.96.0/20 reject;route 172.16.112.0/20 reject;route 172.16.72.0/21 reject;route 172.16.88.0/21 reject;route 172.16.104.0/21 reject;route 172.16.120.0/21 reject;}generate {route 0.0.0.0/0 policy if-upstream-routes-exist;}autonomous-system 8000;}protocols {bgp {group External-Peers {type external;export outbound-routes;neighbor 10.222.44.1 {peer-as 22222;}neighbor 10.222.45.1 {peer-as 1000;}}group Customers {type external;export internal-routes;neighbor 10.222.6.1 {peer-as 2468;}}}}policy-options {policy-statement outbound-routes { # advertise local customer routesterm statics {from protocol static;then accept;}term allowed-bgp-routes {from { # advertise routesas-path [ my-own-routes AS2468-routes ];}then accept;}term no-transit {then reject; # do not advertise any other routes}}policy-statement internal-routes { # advertise local customer routesterm statics {from protocol static;then accept;}term default-route { # advertise just the default routefrom {route-filter 0.0.0.0/0 exact;}then accept;}term reject-all-other-routes { # do not advertise any other routesthen reject;}}policy-statement if-upstream-routes-exist {term as-22222-routes {from { # allow the 10.100.0.0/17 route to activate route-filter 10.100.0.0/17 exact; # the generated route the routing table}then accept;}term reject-all-other-routes {then reject; # do not allow any other route to activate } # the generated route in the routing table}as-path my-own-routes "()";as-path AS2468-routes "2468";}