On Mon, Jul 03, 2006 at 03:58:13PM +0200, Andrea Cocito wrote: > Hi, > > after googling, rereading the manuals and lurking into the code I > really could > not find a way to do this, unless I am missing something really simple! > > I have two BGP routers on a small subnet where they peer with a transit > provider, the two routers have a carp shared IP aswell, thus each of > them has > in there a $myip a $carpip and a $peerip > > I wish that each of them when announcing the network I have in > configuration > as "network x.x.x.x/19" sends the announcement stating that $peerip > is the > nexthop, I am not using "depend" options on carp, what I want is that > the > traffic form the peer AS goes straight to the CARP IP (which > failovers in 50 ms, > much faster than anything BGP can ever do..). >
Are you sure that you want to set the nexthop to $peerip. You send a update to your peer with himself as nexthop?! -- this will not work. I guess you want to set the nexthop to the $carpip instead. > I have tried: > > - Having inside the "neighbor" configuration block a "set nexthop > $carpip", > but this seems to be plainly ignored > This will change the incomming routes and not the outgoing ones. See man page almost all set options inside neighbor statements work on incomming updates. You can verify that with bgpd -nvv where these set roules are expanded to real filter rules. > - Having an explicit "match to $peerip set nexthop $carpip", but that > seems > to affect only routes re-announched to the peer and not routes coming > from my "network a.b.c.d/19" option. > match to + set nexthop was "broken" until recently. The problem is that nexthops are added and verified asynchronously and so setting them on outgoing rules did not work. I fixed this by preloading nexthops that are used by the filters. > - Checking into the code, from what I see into mrt.c, function > mrt_dump_bgp_msg(), lines 123-124, the address placed into the BGP > message > is abruptly ((struct sockaddr_in *)&peer->sa_local)- > >sin_addr.s_addr) which > confirms why any option does not work. > This has nothing to do with what is set as nexthop. mrt_dump_bgp_msg() dumps a BGP message and in the header both the local and remote IP address is stored. This header is written by mrt_dump_bgp_msg(). Have you tried network a.b.c.d/19 set nexthop $carpip this should already work with -stable. > I think that the possibility to announce an explicit nexthop to a > peer for > our AS's network(s) would be useful not only with this specific setup > but also > for all those who run BGP on an IP that is not the one of the > "router" that > has to receive the traffic. > > I am more than willing to change the code myself but an hint would be > very > appreciated: am I missing something ? Is mrt_dump_bgp_msg() the right > place to > do it ? Hints on how to make it configurable (I would say an option > into the > peer or group configuration block). > First try the "network a.b.c.d/19 set nexthop $carpip" option if that does not help you need to run a -current bgpd. Additionally mrt_dump_bgp_msg() is totaly the wrong spot to fix this. The code is more in rde_update.c and rde_filter.c plus some parts in rde_rib.c. > Thank you for your attention and help. > No problem. -- :wq Claudio

