[Xorp-users] Regular expressions in BGP policy
Atanu Ghosh
atanu at xorp.org
Wed Dec 10 10:36:08 PST 2008
Hi,
The "show bgp routes" command shows the routes in the BGP RIB-IN we don't
remove filtered routes from the RIB-IN. The routes are left in the
RIB-IN to allow the user the change a policy, in which case all the
routes in the RIB-IN are refiltered. It is true that we should probably
annotate the route so that "show bgp routes" marks filtered routes.
If a route has been filtered then it won't be sent to the RIB or the BGP
peers, so the simple way to check is to run "show route table ipv4
unicast ibgp" or "show route table ipv4 unicast ebgp" depending on the
type of peering.
Atanu.
>>>>> "Andreas" == Andreas Voellmy <andreas.voellmy at gmail.com> writes:
Andreas> Hi,
Andreas> I'm not sure how to match routes against an as-list regular expression
Andreas> in bgp policy. I have a simple example that is not behaving as I
Andreas> expect. In my example I have a single import policy, like this:
Andreas> policy-statement imppol {
Andreas> term impterm {
Andreas> from {
Andreas> as-path: "34567"
Andreas> }
Andreas> then {
Andreas> trace: 4
Andreas> reject
Andreas> }
Andreas> }
Andreas> }
Andreas> and I've connected this xorp router to another router, with AS 34567,
Andreas> exporting a single route. I would expect that this route would match
Andreas> the term in imppol, would be rejected, and would not be installed in
Andreas> the bgp table of the receiver. From the tracing messages, it does look
Andreas> like the route matches the term, and that the result is to reject the
Andreas> route. HOWEVER, the route show up in my bgp table. Here is the trace
Andreas> message when the route is received:
Andreas> SubnetRoute:
Andreas> Net: 10.10.11.0/24
Andreas> PAList:
Andreas> Next Hop Attribute 128.36.229.113
Andreas> Origin Path Attribute - IGP
Andreas> AS Path Attribute AsPath: [AS/34567]
Andreas> Multiple Exit Descriminator Attribute: MED=0
Andreas> Local Preference Attribute - 100: rejected
Andreas> Basic VarRW trace:
Andreas> Read 14: AsPath: [AS/34567]
Andreas> Write 0: 4
Andreas> Read 14: AsPath: [AS/34567]
Andreas> Write 0: 4
Andreas> Execution trace:
Andreas> Running policy: imppol
Andreas> Running term: impterm
Andreas> PUSH txt 34567
Andreas> LOAD 14: AsPath: [AS/34567]
Andreas> REGEX
Andreas> ONFALSE_EXIT: true
Andreas> PUSH u32 4
Andreas> STORE 0: 4
Andreas> REJECT
Andreas> Outcome of term: Reject
Andreas> Outcome of policy: Reject
Andreas> Outcome of whole filter: Reject
Andreas> End of trace
Andreas> And Here is my BGP route table:
>> show bgp routes
Andreas> Status Codes: * valid route, > best route
Andreas> Origin Codes: i IGP, e EGP, ? incomplete
Andreas> Prefix Nexthop Peer AS Path
Andreas> ------ ------- ---- -------
Andreas> * 10.10.11.0/24 128.36.229.113 128.36.229.113 34567 i
Andreas> I would greatly appreciate it if someone could point out what I've
Andreas> done wrong here. Thanks!
Andreas> Regards,
Andreas> Andreas Voellmy
Andreas> _______________________________________________
Andreas> Xorp-users mailing list
Andreas> Xorp-users at xorp.org
Andreas> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-users
More information about the Xorp-users
mailing list