[pve-devel] applied: [PATCH container] configure IPv6AcceptRA in systemd-networkd files
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed Oct 3 13:06:09 CEST 2018
On 9/13/18 9:53 AM, Wolfgang Bumiller wrote:
> Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
> ---
> src/PVE/LXC/Setup/Base.pm | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/src/PVE/LXC/Setup/Base.pm b/src/PVE/LXC/Setup/Base.pm
> index 2fd04ac..f5f8b0d 100644
> --- a/src/PVE/LXC/Setup/Base.pm
> +++ b/src/PVE/LXC/Setup/Base.pm
> @@ -242,6 +242,7 @@ DATA
> my @DHCPMODES = ('none', 'v4', 'v6', 'both');
> my ($NONE, $DHCP4, $DHCP6, $BOTH) = (0, 1, 2, 3);
> my $dhcp = $NONE;
> + my $accept_ra = 'false';
>
> if (defined(my $ip = $d->{ip})) {
> if ($ip eq 'dhcp') {
> @@ -261,12 +262,15 @@ DATA
> if (defined(my $ip = $d->{ip6})) {
> if ($ip eq 'dhcp') {
> $dhcp |= $DHCP6;
> + } elsif ($ip eq 'auto') {
> + $accept_ra = 'true';
> } elsif ($ip ne 'manual') {
> $has_ipv6 = 1;
> $data .= "Address = $ip\n";
> }
> }
> if (defined(my $gw = $d->{gw6})) {
> + $accept_ra = 'false';
> $data .= "Gateway = $gw\n";
> if ($has_ipv6 && !PVE::Network::is_ip_in_cidr($gw, $d->{ip6}, 6) &&
> !PVE::Network::is_ip_in_cidr($gw, 'fe80::/10', 6)) {
> @@ -275,6 +279,7 @@ DATA
> }
>
> $data .= "DHCP = $DHCPMODES[$dhcp]\n";
> + $data .= "IPv6AcceptRA = $accept_ra\n";
> $data .= $routes if $routes;
>
> $self->ct_file_set_contents($filename, $data);
>
applied for now, make sense in general independent of Debian networking/...
More information about the pve-devel
mailing list