Hi All, I am having a few problems getting my BGP filtering to work - and am experiencing some strange results.. I have two routers connected to a peering point, we have decided that we want to set local preferences of 110 to 1-deep AS-paths (as-path ACL 1) 100 to 2-deep AS-paths (as-path ACL 2) and 90 to 3-deep AS-paths (as-path ACL 3) and to not accept 4-deep AS-paths (as-path ACL 4) I have the following as-path ACLs to try to set that and am using route maps. ip as-path access-list 1 permit ^[0-9]*$ ip as-path access-list 2 permit ^[0-9]*_[0-9]*$ ip as-path access-list 3 permit ^[0-9]*_[0-9]*_[0-9]*$ ip as-path access-list 4 permit .* This appears to have failed miserably....It is not setting local prefs correctly if they are 3-deep and have a repetition of an AS number it sees it as 4-deep If they are 4 AS's deep it doesn't apply a local preference but if it knows it from our other core router it sets a local pref of 100 but prefers the direct route? (ALSO: If I do a sh ip bgp reg ^[0-9]*_[0-9]*$ it lists both 1-deep and 2-deep AS's....surely it should just list 2-deep?) Any help would be greatly appreciated!...... Thanks in advance.. Ally email - alison.gudgeon@kingston-internet.net ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. The views expressed in the email and files transmitted with it are those of the individual, not the company. If you have received this email in error please notify admin@kingston-internet.net +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I see two problems. 1. _ matches the beginning of the string, the end of the string, space, braces, comma, underscore or parentheses. What you probably wanted in your regexp is a normal space. 2. * matches zero or more of the previous pattern, what you probably wanted was a + (you want to force it to have at least one digit.) Fixing either one of these will produce the results you are looking for. I recommend fixing both. Also, note that you can stack "beginning of string" or "end of string". The following produce the same result. sho ip bgp reg ^_^^[0-9]*^^_^^_^[0-9]*$_$$ sho ip bgp reg ^_^^[0-9]*$___$__[0-9]*$$_$ sho ip bgp reg ^[0-9]*$ the point? Be careful with * and _. pete On Fri, May 26, 2000 at 10:07:50AM +0100, Ally Gudgeon wrote:
Hi All,
I am having a few problems getting my BGP filtering to work - and am experiencing some strange results..
I have two routers connected to a peering point, we have decided that we want to set local preferences of
110 to 1-deep AS-paths (as-path ACL 1) 100 to 2-deep AS-paths (as-path ACL 2) and 90 to 3-deep AS-paths (as-path ACL 3) and to not accept 4-deep AS-paths (as-path ACL 4)
I have the following as-path ACLs to try to set that and am using route maps.
ip as-path access-list 1 permit ^[0-9]*$ ip as-path access-list 2 permit ^[0-9]*_[0-9]*$ ip as-path access-list 3 permit ^[0-9]*_[0-9]*_[0-9]*$ ip as-path access-list 4 permit .*
This appears to have failed miserably....It is not setting local prefs correctly if they are 3-deep and have a repetition of an AS number it sees it as 4-deep If they are 4 AS's deep it doesn't apply a local preference but if it knows it from our other core router it sets a local pref of 100 but prefers the direct route?
(ALSO: If I do a sh ip bgp reg ^[0-9]*_[0-9]*$ it lists both 1-deep and 2-deep AS's....surely it should just list 2-deep?)
Any help would be greatly appreciated!......
Thanks in advance..
Ally
email - alison.gudgeon@kingston-internet.net ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. The views expressed in the email and files transmitted with it are those of the individual, not the company. If you have received this email in error please notify admin@kingston-internet.net +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
At 06:40 26/05/00 -0500, Peter T. Whiting wrote:
I see two problems.
1. _ matches the beginning of the string, the end of the string, space, braces, comma, underscore or parentheses. What you probably wanted in your regexp is a normal space.
2. * matches zero or more of the previous pattern, what you probably wanted was a + (you want to force it to have at least one digit.)
Fixing either one of these will produce the results you are looking for. I recommend fixing both. Also, note that you can stack "beginning of string" or "end of string". The following produce the same result.
sho ip bgp reg ^_^^[0-9]*^^_^^_^[0-9]*$_$$ sho ip bgp reg ^_^^[0-9]*$___$__[0-9]*$$_$ sho ip bgp reg ^[0-9]*$
the point? Be careful with * and _.
Be careful with too complex regeg's cuz you may be the only one who understands what it is to do and once you leave [and we all know the state of documenting as-path lists on each router] no one is gonna know what your intention was with such an as-path filter. -Hank
pete
On Fri, May 26, 2000 at 10:07:50AM +0100, Ally Gudgeon wrote:
Hi All,
I am having a few problems getting my BGP filtering to work - and am experiencing some strange results..
I have two routers connected to a peering point, we have decided that we want to set local preferences of
110 to 1-deep AS-paths (as-path ACL 1) 100 to 2-deep AS-paths (as-path ACL 2) and 90 to 3-deep AS-paths (as-path ACL 3) and to not accept 4-deep AS-paths (as-path ACL 4)
I have the following as-path ACLs to try to set that and am using route maps.
ip as-path access-list 1 permit ^[0-9]*$ ip as-path access-list 2 permit ^[0-9]*_[0-9]*$ ip as-path access-list 3 permit ^[0-9]*_[0-9]*_[0-9]*$ ip as-path access-list 4 permit .*
This appears to have failed miserably....It is not setting local prefs correctly if they are 3-deep and have a repetition of an AS number it sees it as 4-deep If they are 4 AS's deep it doesn't apply a local preference but if it knows it from our other core router it sets a local pref of 100 but prefers the direct route?
(ALSO: If I do a sh ip bgp reg ^[0-9]*_[0-9]*$ it lists both 1-deep and 2-deep AS's....surely it should just list 2-deep?)
Any help would be greatly appreciated!......
Thanks in advance..
Ally
email - alison.gudgeon@kingston-internet.net ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. The views expressed in the email and files transmitted with it are those of the individual, not the company. If you have received this email in error please notify admin@kingston-internet.net +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Hi, Sorry for pick up the historic thread. But why not a more simple and clear one? ip as-path access-list 1 permit ^[0-9]+$ ip as-path access-list 2 permit ^([0-9]+) ([0-9]+)$ ip as-path access-list 3 permit ^([0-9]+) ([0-9]+)([0-9]+)$ ip as-path access-list 4 permit .* It's quite clear, and you can expand it to whichever level you want. Correct me if i were wrong. regards, Yu Ning ------------------------------------------- (Mr.) Yu(2) Ning(2) ChinaNet Backbone Operation Networking Dep.,Datacom Bureau China Telecom.,Beijing(100088),P.R.C +86-10-66418105/66418121/66418123(fax) ------------------------------------------- ----- Original Message ----- From: "Peter T. Whiting" <pwhiting@fury.ittc.ukans.edu> To: "Ally Gudgeon" <alison.gudgeon@kingston-internet.net> Cc: <nanog@merit.edu> Sent: Friday, May 26, 2000 7:40 PM Subject: Re: Regular Expressions ......
I see two problems.
1. _ matches the beginning of the string, the end of the string, space, braces, comma, underscore or parentheses. What you probably wanted in your regexp is a normal space.
2. * matches zero or more of the previous pattern, what you probably wanted was a + (you want to force it to have at least one digit.)
Fixing either one of these will produce the results you are looking for. I recommend fixing both. Also, note that you can stack "beginning of string" or "end of string". The following produce the same result.
sho ip bgp reg ^_^^[0-9]*^^_^^_^[0-9]*$_$$ sho ip bgp reg ^_^^[0-9]*$___$__[0-9]*$$_$ sho ip bgp reg ^[0-9]*$
the point? Be careful with * and _.
pete
On Fri, May 26, 2000 at 10:07:50AM +0100, Ally Gudgeon wrote:
Hi All,
I am having a few problems getting my BGP filtering to work - and am experiencing some strange results..
I have two routers connected to a peering point, we have decided that we want to set local preferences of
110 to 1-deep AS-paths (as-path ACL 1) 100 to 2-deep AS-paths (as-path ACL 2) and 90 to 3-deep AS-paths (as-path ACL 3) and to not accept 4-deep AS-paths (as-path ACL 4)
I have the following as-path ACLs to try to set that and am using route maps.
ip as-path access-list 1 permit ^[0-9]*$ ip as-path access-list 2 permit ^[0-9]*_[0-9]*$ ip as-path access-list 3 permit ^[0-9]*_[0-9]*_[0-9]*$ ip as-path access-list 4 permit .*
This appears to have failed miserably....It is not setting local prefs correctly if they are 3-deep and have a repetition of an AS number it sees it as 4-deep If they are 4 AS's deep it doesn't apply a local preference but if it knows it from our other core router it sets a local pref of 100 but prefers the direct route?
(ALSO: If I do a sh ip bgp reg ^[0-9]*_[0-9]*$ it lists both 1-deep and 2-deep AS's....surely it should just list 2-deep?)
Any help would be greatly appreciated!......
Thanks in advance..
Ally
email - alison.gudgeon@kingston-internet.net ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. The views expressed in the email and files transmitted with it are those of the individual, not the company. If you have received this email in error please notify admin@kingston-internet.net +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
On Fri, 26 May 2000, Ally Gudgeon wrote:
(ALSO: If I do a sh ip bgp reg ^[0-9]*_[0-9]*$ it lists both 1-deep and 2-deep AS's....surely it should just list 2-deep?)
Any help would be greatly appreciated!......
Thanks in advance..
Ally
If sh ip bgp regexp "your regexp" doesn't do what you expect it to do, it is certainly not going to work in an as-path access-list. I am not the regexp master so, I can only tell you to tinker at the command line with your regexp and when the output meets what you want, THAT's the regexp you should then use in your access-list. John
I'm looking into UUNet for some connectivity and after the past couple of days I get the impression this may be a mistake. I was wondering if I could get some feedback about UUNet from any that actually have connectivity through them. What are you thoughts about their service, latency, packetloss, throughput, etc? How about their tech support. Do they ever inform you of outage issues and explain just what is going on? Reply off-list please. Thanks in advance.
participants (6)
-
Ally Gudgeon
-
dies
-
Hank Nussbacher
-
John Fraizer
-
Peter T. Whiting
-
Yu Ning