For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > May 2007 > Net::BGP advise









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Net::BGP advise
Jeremy Kister

2007-05-26, 9:59 pm

I sent [most of] the below message to Net::BGP's author a small while
ago and haven't yet heard back. I'm hoping someone on the list can help.

I'm trying to use Net::BGP to inject a /32 into my iBGP.

What is the proper way to send a $peer->update?

If I do:

my $bgp = new Net::BGP::Process();
my $peer = new Net::BGP::Peer(
Start => 1,
ThisID => '10.115.0.126',
ThisAS => 65535,
PeerID => '10.115.5.52',
PeerAS => 65535,
);

$bgp->add_peer($peer);

my $update = new Net::BGP::Update (
NLRI => [ qw| 10.232.210.15/32 | ],
Aggregator => [ 65535, '10.115.0.126' ],
AtomicAggregate => 1,
LocalPref => 100,
MED => 200,
NextHop => '10.115.0.126',
Origin => INCOMPLETE,
);

$peer->update($update);
$bgp->event_loop;
__END__

Then the bgp session establishes, but the /32 is not injected.

If put
$peer->add_timer(\&foo, 20);
right before $bgp->event_loop, and put $peer->update inside sub foo,
then the injection works, but I resend the update every x seconds.

I'm sure I'm just using the code incorrectly, but can't figure the
right way to do it.

Thanks!

--

Jeremy Kister
http://jeremy.kister.net./

Jeremy Kister

2007-05-27, 4:00 am

On 5/26/2007 8:27 PM, Jeremy Kister wrote:
> I'm sure I'm just using the code incorrectly, but can't figure the
> right way to do it.


I've figured out the logic. $peer->update must go inside on of the peer
callbacks. I can simply add conditionals inside my timer callback.

I was previously trying to keep control of the program in my own loop,
but saw that the Process event_loop requires control.

Thanks,

--

Jeremy Kister
http://jeremy.kister.net./
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com