Allied Telesis X908 Network Router User Manual


 
Examples
Page 38 | Use Route Maps and Other Filters to Filter and Alter BGP and OSPF Routes
Example D Matching on a next-hop prefix-list
1. Create a prefix-list that matches on the neighbor's IP address:
awplus#ship prefix-list nh-test permit 45.45.45.46/32
2.
Create a route map with a permit entry that matches on this prefix-list as a next-hop:
awplus#shroute-map nh-test permit 1
awplus#shmatch ip next-hop prefix-list nh-test
3.
Apply this route map as the in route map on the neighbor:
awplus(config)#router bgp 34567
awplus(config-router)# neighbor 45.45.45.46 route-map nh-test in
4.
Shut down the neighbor, and then bring it up again:
awplus(config-router)# neighbor 45.45.45.46 shutdown
awplus(config-router)# neighbor 45.45.45.46 no shutdown
5.
All the routes are learnt OK from the neighbor:
awplus#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
* - candidate default
B 45.0.0.0/8 [20/0] via 45.45.45.46, vlan1, 00:00:03
C 45.45.45.0/24 is directly connected, vlan1
B 52.0.0.0/8 [20/0] via 45.45.45.46, vlan1, 00:00:03
C 64.0.0.0/4 is directly connected, vlan64
Example E Prepending AS numbers
1. Create a route map that prepends a list of AS numbers to the attribute field of outgoing
updates:
awplus(config)#route-map as-list-test permit 1
awplus(config-route-map)#match ip address 1
awplus(config-route-map)#set as-path prepend 11 22 33 44 55 66 77
88 99 1010 1111 1212 1313 1414 1515 1616
2.
Set this as the out route map for the neighbor 45.45.45.46
awplus(config-route-map)#router bgp 34567
awplus(config-router)# neighbor 45.45.45.46 route-map as-list-
test out
3.
Shut down the neighbor, and then bring it up again:
awplus(config-router)# neighbor 45.45.45.46 shutdown
awplus(config-router)# neighbor 45.45.45.46 no shutdown
4.
Now, check the routes learnt on the neighbor - note the long AS-path list:
Manager BGP peer> show bgp route