[Xorp-users] Regular expressions in BGP policy

Andreas Voellmy andreas.voellmy at gmail.com
Thu Dec 4 14:03:03 PST 2008


Hi,

I'm not sure how to match routes against an as-list regular expression
in bgp policy. I have a simple example that is not behaving as I
expect. In my example I have a single import policy, like this:

policy-statement imppol {
	term impterm {
		from {
			as-path: "34567"
		}
		then {
			trace: 4
			reject
		}
	}
}


and I've connected this xorp router to another router, with AS 34567,
exporting a single route. I would expect that this route would match
the term in imppol, would be rejected, and would not be installed in
the bgp table of the receiver. From the tracing messages, it does look
like the route matches the term, and that the result is to reject the
route. HOWEVER, the route show up in my bgp table. Here is the trace
message when the route is received:

SubnetRoute:
  Net: 10.10.11.0/24
  PAList:
        Next Hop Attribute 128.36.229.113
        Origin Path Attribute - IGP
        AS Path Attribute AsPath: [AS/34567]
        Multiple Exit Descriminator Attribute: MED=0
        Local Preference Attribute - 100: rejected
Basic VarRW trace:
Read 14: AsPath: [AS/34567]
Write 0: 4
Read 14: AsPath: [AS/34567]
Write 0: 4
Execution trace:
Running policy: imppol
Running term: impterm
PUSH txt 34567
LOAD 14: AsPath: [AS/34567]
REGEX
ONFALSE_EXIT: true
PUSH u32 4
STORE 0: 4
REJECT
Outcome of term: Reject
Outcome of policy: Reject
Outcome of whole filter: Reject
End of trace

And Here is my BGP route table:

> show bgp routes
Status Codes: * valid route, > best route
Origin Codes: i IGP, e EGP, ? incomplete

   Prefix                Nexthop                    Peer            AS Path
   ------                -------                    ----            -------
*  10.10.11.0/24         128.36.229.113             128.36.229.113  34567 i

I would greatly appreciate it if someone could point out what I've
done wrong here. Thanks!

Regards,
Andreas Voellmy



More information about the Xorp-users mailing list