conf, ndp: Disable router advertisements on --config-net

If we statically configure a default route, and also advertise it for
SLAAC, the kernel will try moments later to add the same route:

  ICMPv6: RA: ndisc_router_discovery failed to add default route

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2022-02-23 10:51:46 +01:00
parent ed58ad1a59
commit e5bd8dbb24
2 changed files with 6 additions and 1 deletions

3
conf.c
View file

@ -1255,6 +1255,9 @@ void conf(struct ctx *c, int argc, char **argv)
usage(argv[0]); usage(argv[0]);
} }
if (c->pasta_conf_ns)
c->no_ra = 1;
if (c->mode == MODE_PASTA && c->pasta_netns_fd == -1) if (c->mode == MODE_PASTA && c->pasta_netns_fd == -1)
pasta_start_ns(c); pasta_start_ns(c);

View file

@ -440,7 +440,9 @@ The default path is shown with --help.
.TP .TP
.BR \-\-config-net .BR \-\-config-net
Configure networking in the namespace: set up addresses and routes as configured Configure networking in the namespace: set up addresses and routes as configured
or sourced from the host, and bring up the tap interface. or sourced from the host, and bring up the tap interface. This option implies
\fB--no-ra\fR: the static configuration of the IPv6 address will not allow the
kernel to set up the default route using SLAAC.
.TP .TP
.BR \-\-ns-mac-addr " " \fIaddr .BR \-\-ns-mac-addr " " \fIaddr