Allied Telesis x908, X8100 manual Using AS path lists as path filters, Example AS path filters

Page 18
Using AS path lists as path filters

BGP: Configuring AS Path Filters

Implicitly exclude a neighbor

Using AS path lists as path filters

When an AS path list has been created, it can be applied to filter incoming or outgoing update messages for a particular BGP peer, by using the following commands in BGP router mode for the AS.

Filter incoming updates (received from a particular neighbor):

awplus(config-router)#neighbor <neighbor> filter-list <list-name> in

Filter outgoing updates (destined for a particular neighbor):

awplus(config-router)# neighbor <neighbor> filter-list<list-name> out

The router will then compare the AS path attribute in BGP update packets with each entry in the AS path list until a match is found. If the AS path list entry that matches has the parameter permit, then the update packet will be allowed through by the filter. If the matching entry has the parameter deny, then the update packet will be blocked by the filter.

Note: All update packets whose AS paths do not explicitly match an entry in the AS path list will be dropped, because the list ends in an implicit deny all entry.

Example: AS path filters

Discard or allow routes from a neighbor

This example expands on the basic configuration in "BGP: Example" on page 8.

First, it creates an AS path filter on the AlliedWare Plus switch that explicitly includes only AS 23456. AS path filters end in an implicit deny clause, so this filter implicitly excludes

AS 34568. After demonstrating that AS 34568 is excluded, the example then adds an entry to the filter to explicitly allow AS 34568.

1.If you previously configured a distribute filter, as shown in "Example: Distribute filters" on page 12, remove it from the neighbor definition.

awplus(config)# router bgp 34567

awplus(configrouter)# no neighbor 45.45.45.46 distribute-list1301 in

2.Create an AS path access list that includes AS 23456. awplus(config)# ip as-path access-list list1 permit 23456

3.Set that access list as the in-filter for the BGP neighbor 45.45.45.46.

awplus(config)# router bgp 34567

awplus(config-router)#neighbor 45.45.45.46 filter-list list1 in

Page 18 Use Route Maps and Other Filters to Filter and Alter BGP and OSPF Routes

Image 18
Contents Introduction Technical GuideWhich products and software version does it apply to? ContentsIntroduction BGP Applying Route Maps to Imported RoutesRelated How To Notes Which products and software version does it apply to?BGP updates BGP Concepts and TerminologyBGP peers AS-path Update attributesOrigin Next-hopFilter types Access Control List ACL filtersBGP Overview of the Available Filter Types Distribute filtersExamples for filtering BGP Update messages Difference and Relationship in BGP Example Distribute filters on page Hierarchy of the Different FiltersBGP Example  Example AS path filters on page  Example Prefix filters on pageBasic configuration Confirming the neighbor relationship AlliedWare switchawplus#show ip route BGP Configuring Distribute Filters About ACLsUsing ACLs as filters Example Distribute filtersFilter out one particular route from a neighbor Filter out a range of prefix lengths awplusconfig# neighbor 45.45.45.46 distribute-list list2 in 3. Check that the IP route table now includes all the routes6. Shut down the neighbor, and then bring it up again Use a numbered ACL instead of a named ACL awplusconfig-router# do show ip route BGP Configuring AS Path Filters AS path listsUsing AS path lists as path filters Example AS path filtersDiscard or allow routes from a neighbor 4. Shut down the neighbor, and then bring it up again a neighbor7. Shut down the neighbor, and then bring it up again Another example An outgoing filter that uses an AS-path listBGP Configuring AS Path Filters BGP Configuring Prefix Filters About prefix listsMask length awplusconfig-router# neighbor neighbor prefix-list list-name in Using prefix lists as prefix filtersExample Prefix filters awplusconfig-router# neighbor neighbor prefix-list list-name outFilter out a range of different prefix lengths BGP Configuring Prefix Filters BGP Configuring Route Maps Structure of a route mapConfiguring a match clause ClausesAn AS path list A community list CaseOne or more prefixes, by using a prefix list One or more prefixes, by using an ACLAn origin Configuring a set clauseA next hop address A metric the MED attributeset community community-values additive set extcommunity rtsoo ext-comm-number set weightset atomic-aggregate set ip next-hop ipaddNo match clause and one or more set clauses The effect of different combinations of clausesOne match clause with an action A match clause and one or more set clausesUpdate 2 to Peer Update from PeerUpdate 1 to Peer Router ASFirst, enter BGP router mode for the AS. The prompt should look like awplusconfig#ip prefix-list test1 permit 52.0.0.0/8 ExamplesExample B Match on a prefix-list that denies an entry awplusconfig-route-map#set metric4. Apply this route map as the in route map on the neighbor awplusconfig-route-map#match ip address Example D Matching on a next-hop prefix-listExample E Prepending AS numbers awplusconfig-route-map#router bgpadd ip routem=com entry=1 set commmun=8989 1. Configure the AW peer to send out a community numberThe routes coming from that peer has community set bgp peer=45.45.45.45 outroutemap=com sendcommunity=yesBGP#show ip route set bgp peer=45.45.45.45 outroutemap=mixed sendcommunity=yes 8. Add that ACL as a distribute-list in-filter on the neighbor route-map marker permit Examples ACLs Path filters Prefix filters Route mapsBGP Applying Route Maps to Imported Routes Syntaxneighbor unsuppress-map neighbor default-originateOther Uses of Route Maps networkBGP configuration Route map configurationBGP Route Map Filtering Example set local-preference route-map outdef permit OSPF Configuring Route Maps for Filtering and Modifying OSPF Routes MetricInterface A prefix, by using a prefix list A prefix, by using an ACLExternal route type OSPF Applying Route Maps  Set the metric, by using the command set metric
Related manuals
Manual 8 pages 39.31 Kb Manual 21 pages 8.63 Kb