Newbie question - create filter for prefixes to export and also modify bgp next hop
Hi As said, I'm new to BIRD and struggling a bit with the config syntax. I'll try to explain what I want to do. I have a few prefixes, lets say 10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24. I want to announce these (and only these) in a BGP session, but with a modified next hop. How would I do this? Any help is much appreciated. /Tias
On 2.3.2011 10:36, Mathias Wolkert wrote:
Hi
As said, I'm new to BIRD and struggling a bit with the config syntax.
I'll try to explain what I want to do.
I have a few prefixes, lets say 10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24. I want to announce these (and only these) in a BGP session, but with a modified next hop.
How would I do this?
Add this export filter to you BGP session: export filter { if net ~ [10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24] then { bgp_next_hop = X.X.X.X; accept; } else reject; }; (I did not check syntax, maybe some ';' is missing. Ondrej
Any help is much appreciated.
/Tias
Hi On 3/2/11 11:32 , Ondrej Filip wrote:
On 2.3.2011 10:36, Mathias Wolkert wrote:
Hi
As said, I'm new to BIRD and struggling a bit with the config syntax.
I'll try to explain what I want to do.
I have a few prefixes, lets say 10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24. I want to announce these (and only these) in a BGP session, but with a modified next hop.
How would I do this?
Add this export filter to you BGP session:
export filter { if net ~ [10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24] then { bgp_next_hop = X.X.X.X; accept; } else reject; };
(I did not check syntax, maybe some ';' is missing. Ondrej
Working fine, thanks a lot. Now say I want to do this for all my +100 peers could I do the filtering once in a filter and call that in every session? Another thing. One of these prefixes I want to originate from a different AS. In IOS and quagga I can do this with "set as-path prepend" and get: prefix/mask <local_as> <prepended_as> i Doing this in BIRD gives me a different behavior and I get: prefix/mask <prepended_as> <local_as> i A little bird told me about this not beeing wrong, but closer to what the standard states. Do you agree? How would I get around this, another table and pipes? /Tias
Any help is much appreciated.
/Tias
On 2.3.2011 14:55, Mathias Wolkert wrote:
Hi
On 3/2/11 11:32 , Ondrej Filip wrote:
On 2.3.2011 10:36, Mathias Wolkert wrote:
Hi
As said, I'm new to BIRD and struggling a bit with the config syntax.
I'll try to explain what I want to do.
I have a few prefixes, lets say 10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24. I want to announce these (and only these) in a BGP session, but with a modified next hop.
How would I do this?
Add this export filter to you BGP session:
export filter { if net ~ [10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24] then { bgp_next_hop = X.X.X.X; accept; } else reject; };
(I did not check syntax, maybe some ';' is missing. Ondrej
Working fine, thanks a lot.
Now say I want to do this for all my +100 peers could I do the filtering once in a filter and call that in every session?
Sure, you can just: filter bgp_out { if net ~ [10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24] then { bgp_next_hop = X.X.X.X; accept; } else reject; }; And at every BGP session e.g.: protocol bgp AAAA { local as myas; neighbor XX.XX.XX.XX as YYYY; import all; export filter bgp_out; rs client; } Or you can use function that accepts parameters etc.
Another thing.
One of these prefixes I want to originate from a different AS. In IOS and quagga I can do this with "set as-path prepend" and get:
prefix/mask <local_as> <prepended_as> i
Are you sure? This looks wrong to me.
Doing this in BIRD gives me a different behavior and I get:
prefix/mask <prepended_as> <local_as> i
A little bird told me about this not beeing wrong, but closer to what the standard states.
Do you agree? How would I get around this, another table and pipes?
So you would like to change originator? Which way? YOU would like to be an originator? Ondrej
/Tias
Any help is much appreciated.
/Tias
On 3/2/11 15:57 , Ondrej Filip wrote:
On 2.3.2011 14:55, Mathias Wolkert wrote:
Hi
On 3/2/11 11:32 , Ondrej Filip wrote:
On 2.3.2011 10:36, Mathias Wolkert wrote:
Hi
As said, I'm new to BIRD and struggling a bit with the config syntax.
I'll try to explain what I want to do.
I have a few prefixes, lets say 10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24. I want to announce these (and only these) in a BGP session, but with a modified next hop.
How would I do this?
Add this export filter to you BGP session:
export filter { if net ~ [10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24] then { bgp_next_hop = X.X.X.X; accept; } else reject; };
(I did not check syntax, maybe some ';' is missing. Ondrej
Working fine, thanks a lot.
Now say I want to do this for all my +100 peers could I do the filtering once in a filter and call that in every session?
Sure, you can just:
filter bgp_out { if net ~ [10.1.1.0/24, 10.2.2.0/24, 10.3.3.0/24] then { bgp_next_hop = X.X.X.X; accept; } else reject; };
And at every BGP session e.g.:
protocol bgp AAAA { local as myas; neighbor XX.XX.XX.XX as YYYY; import all; export filter bgp_out; rs client; }
Perfect, that is exactly what I want. I realize that it's the tildes and types of brackets part that makes me uncertain.
Or you can use function that accepts parameters etc.
Another thing.
One of these prefixes I want to originate from a different AS. In IOS and quagga I can do this with "set as-path prepend" and get:
prefix/mask<local_as> <prepended_as> i
Are you sure? This looks wrong to me.
Doing this in BIRD gives me a different behavior and I get:
prefix/mask<prepended_as> <local_as> i
A little bird told me about this not beeing wrong, but closer to what the standard states.
Do you agree? How would I get around this, another table and pipes?
So you would like to change originator? Which way? YOU would like to be an originator?
Yes, I'd like to change the originator to "prepended_as" and also have "local_as" in the path like I have on quagga/IOS. I've been told Cisco is breaking the standard by not appending but replace the as-path when originating prefixes. Not sure myself...
Ondrej
/Tias
Any help is much appreciated.
/Tias
/Tias
On Wed, Mar 02, 2011 at 04:15:48PM +0100, Mathias Wolkert wrote:
Another thing.
One of these prefixes I want to originate from a different AS. In IOS and quagga I can do this with "set as-path prepend" and get:
prefix/mask<local_as> <prepended_as> i
Are you sure? This looks wrong to me.
Doing this in BIRD gives me a different behavior and I get:
prefix/mask<prepended_as> <local_as> i
A little bird told me about this not beeing wrong, but closer to what the standard states.
Do you agree? How would I get around this, another table and pipes?
So you would like to change originator? Which way? YOU would like to be an originator?
Yes, I'd like to change the originator to "prepended_as" and also have "local_as" in the path like I have on quagga/IOS.
Probably something like this: bgp_path = + empty +; bgp_path.prepend(PREP_ASN); bgp_path.prepend(LOCAL_ASN); would help. The first line (which is probably undocumented syntax) will reset bgp_path, so you could prepend PREP_ASN and than prepend LOCAL_ASN. -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Hi On 3/2/11 20:16 , Ondrej Zajicek wrote:
On Wed, Mar 02, 2011 at 04:15:48PM +0100, Mathias Wolkert wrote:
Another thing.
One of these prefixes I want to originate from a different AS. In IOS and quagga I can do this with "set as-path prepend" and get:
prefix/mask<local_as> <prepended_as> i
Are you sure? This looks wrong to me.
Doing this in BIRD gives me a different behavior and I get:
prefix/mask<prepended_as> <local_as> i
A little bird told me about this not beeing wrong, but closer to what the standard states.
Do you agree? How would I get around this, another table and pipes?
So you would like to change originator? Which way? YOU would like to be an originator?
Yes, I'd like to change the originator to "prepended_as" and also have "local_as" in the path like I have on quagga/IOS.
Probably something like this:
bgp_path = + empty +; bgp_path.prepend(PREP_ASN); bgp_path.prepend(LOCAL_ASN);
would help. The first line (which is probably undocumented syntax) will reset bgp_path, so you could prepend PREP_ASN and than prepend LOCAL_ASN.
That worked out fine. Thanks a lot! /Tias
participants (3)
-
Mathias Wolkert -
Ondrej Filip -
Ondrej Zajicek