Two ISPs (local ISP and global ISP) will be peered with bgp router and form the multi-homing. We would like to seek for your comments on the configuration of the bgp router located in Hong Kong data center. Attached please find the logical design diagram and below please find the user requirements for your reference:
We would like the local traffics (all Hong Kong traffic) go to local ISP-A and the global traffics (other than Hong Kong traffic) go to ISP-B. Following is the configuration:
router bgp 100
# to ISP-A
neighbor 192.168.10.1 remote-as 100
neighbor 192.168.10.1 route-map LOCAL in
neighbor 192.168.20.1 remote-as 200
neighbor 192.168.10.1 route-map GLOBAL in
ip bgp-community new-format
# define the routes including hkix ASN
ip community-list 1 permit _4635_
# set the routes, which learn from local ISP and including HKIX ASN, to the 75, more preference to ISP-A for local traffic inside HK
route-map LOCAL permit 10
match community 1
set local-preference 75
route-map LOCAL permit 20
# set the routes, which learn from global ISP and including HKIX ASN, to the 125, less preference to ISP-B for local traffic inside HK
route-map GLOBAL permit 10
match community 1
set local-preference 125
route-map GLOBAL permit 20
According to above config, does it achieve my goal? Thanks
the question is more complex with this as-path access-list (2) you accept routes that are locally generated on HKIX directly connected providers but not those of customers of these providers.
However, also those customers are likely local to the Hong Kong area as they are carried to the HKIX.
Also some of the providers connected to HKIX are big providers so you should not accept all routes containing their AS number or the risk is to consider as local routes routes that are not local.
ip as-path access-list 2 permit _703$
This is UUNET ASIA now part of Verizon it may give you more then local routes if you match on _703_, so inthis case matching on _703$ can be a safe assumption.
On the other hand some providers that are local to that area will provide local routes also using _ASN_ (because they are local)
So you will need to tune the AS path access-list classifying local providers ( _ASN_) from global providers (_ASN$).
Now, the logic of route-maps is correct with correct use of local preference values
Be aware also that you will need to update this as-path access-list over time to reflect changes.
Hope to help