On Mon, Sep 26, 2016 at 11:14:51PM +0200, Sebastian Benoit wrote: > If we do this, i think the as-path loop detection needs to also check for > these additional ASes. > > Otherwise we create a nice loop when we get our own route > from an ebgp neighbor with this as in the path. >
I know cisco has a similar feature. Can someone of you check how it detects AS loops? If it does at all. I guess people expect it to work similar to other vendors. > Peter Hessler(phess...@openbsd.org) on 2016.09.26 20:09:13 +0200: > > We already have a local AS saved per peer. Let's use it. This is very > > useful when one needs to change their local AS. > > > > " > > neighbor 192.0.2.1 { > > remote-as 65530 > > local-as 131000 > > } > > " > > > > OK? > > > > > > Index: parse.y > > =================================================================== > > RCS file: /cvs/openbsd/src/usr.sbin/bgpd/parse.y,v > > retrieving revision 1.288 > > diff -u -p -u -p -r1.288 parse.y > > --- parse.y 21 Jun 2016 21:35:24 -0000 1.288 > > +++ parse.y 26 Sep 2016 14:46:23 -0000 > > @@ -175,7 +175,7 @@ typedef struct { > > %token RDOMAIN RD EXPORTTRGT IMPORTTRGT > > %token RDE RIB EVALUATE IGNORE COMPARE > > %token GROUP NEIGHBOR NETWORK > > -%token REMOTEAS DESCR LOCALADDR MULTIHOP PASSIVE MAXPREFIX RESTART > > +%token LOCALAS REMOTEAS DESCR LOCALADDR MULTIHOP PASSIVE MAXPREFIX > > RESTART > > %token ANNOUNCE CAPABILITIES REFRESH AS4BYTE CONNECTRETRY > > %token DEMOTE ENFORCE NEIGHBORAS REFLECTOR DEPEND DOWN SOFTRECONFIG > > %token DUMP IN OUT SOCKET RESTRICTED > > @@ -1004,6 +1004,9 @@ peeroptsl : peeropts nl > > peeropts : REMOTEAS as4number { > > curpeer->conf.remote_as = $2; > > } > > + | LOCALAS as4number { > > + curpeer->conf.local_as = $2; > > + } > > | DESCR string { > > if (strlcpy(curpeer->conf.descr, $2, > > sizeof(curpeer->conf.descr)) >= > > @@ -2249,6 +2252,7 @@ lookup(char *s) > > { "key", KEY}, > > { "listen", LISTEN}, > > { "local-address", LOCALADDR}, > > + { "local-as", LOCALAS}, > > { "localpref", LOCALPREF}, > > { "log", LOG}, > > { "match", MATCH}, > > Index: printconf.c > > =================================================================== > > RCS file: /cvs/openbsd/src/usr.sbin/bgpd/printconf.c,v > > retrieving revision 1.97 > > diff -u -p -u -p -r1.97 printconf.c > > --- printconf.c 13 Jul 2016 20:07:38 -0000 1.97 > > +++ printconf.c 26 Sep 2016 17:41:58 -0000 > > @@ -365,6 +365,8 @@ print_peer(struct peer_config *p, struct > > printf("%s\trib \"%s\"\n", c, p->rib); > > if (p->remote_as) > > printf("%s\tremote-as %s\n", c, log_as(p->remote_as)); > > + if (p->local_as != conf->as) > > + printf("%s\tlocale-as %s\n", c, log_as(p->local_as)); > > if (p->down) > > printf("%s\tdown\n", c); > > if (p->distance > 1) > > Index: session.c > > =================================================================== > > RCS file: /cvs/openbsd/src/usr.sbin/bgpd/session.c,v > > retrieving revision 1.354 > > diff -u -p -u -p -r1.354 session.c > > --- session.c 3 Sep 2016 16:22:17 -0000 1.354 > > +++ session.c 26 Sep 2016 17:47:59 -0000 > > @@ -1461,7 +1461,7 @@ session_open(struct peer *p) > > if (p->capa.ann.as4byte) { /* 4 bytes data */ > > u_int32_t nas; > > > > - nas = htonl(conf->as); > > + nas = htonl(p->conf.local_as); > > errs += session_capa_add(opb, CAPA_AS4BYTE, sizeof(nas)); > > errs += ibuf_add(opb, &nas, sizeof(nas)); > > } > > @@ -2120,7 +2120,7 @@ parse_open(struct peer *peer) > > /* if remote-as is zero and it's a cloned neighbor, accept any */ > > if (peer->template && !peer->conf.remote_as && as != AS_TRANS) { > > peer->conf.remote_as = as; > > - peer->conf.ebgp = (peer->conf.remote_as != conf->as); > > + peer->conf.ebgp = (peer->conf.remote_as != peer->conf.local_as); > > if (!peer->conf.ebgp) > > /* force enforce_as off for iBGP sessions */ > > peer->conf.enforce_as = ENFORCE_AS_OFF; > > @@ -3074,7 +3074,7 @@ session_template_clone(struct peer *p, s > > > > if (as) { > > p->conf.remote_as = as; > > - p->conf.ebgp = (p->conf.remote_as != conf->as); > > + p->conf.ebgp = (p->conf.remote_as != p->conf.local_as); > > if (!p->conf.ebgp) > > /* force enforce_as off for iBGP sessions */ > > p->conf.enforce_as = ENFORCE_AS_OFF; > > Index: bgpd.conf.5 > > =================================================================== > > RCS file: /cvs/openbsd/src/usr.sbin/bgpd/bgpd.conf.5,v > > retrieving revision 1.146 > > diff -u -p -u -p -r1.146 bgpd.conf.5 > > --- bgpd.conf.5 17 Aug 2016 08:14:40 -0000 1.146 > > +++ bgpd.conf.5 26 Sep 2016 18:03:06 -0000 > > @@ -855,6 +855,10 @@ is given, > > .Xr bgpd 8 > > binds to this address first. > > .Pp > > +.It Ic local-as Ar as-number > > +Set the AS number sent to the remote system. > > +Intended to be used temporarily, for migrations to another AS. > > +.Pp > > .It Ic log no > > Disable neighbor specific logging. > > .Pp > > > > > > > > -- > > "But I don't like Spam!!!!" > > > -- :wq Claudio