0

The setup

My debian server at online.net is running a dual stack ipv4/ipv6

# /etc/network/interfaces

auto lo
iface lo inet loopback

source /etc/network/interfaces.d/*

There are 2 files in /etc/network/interfaces.d/

# /etc/network/interfaces.d/device-enp0s20-inet

auto enp0s20
iface enp0s20 inet dhcp

and

# /etc/network/interfaces.d/device-enp0s20-inet6

auto enp0s20
iface enp0s20 inet6 dhcp
  request_prefix 1
  accept_ra 2

I request my ipv6 delegated prefix using dhclient

# /etc/dhcp/dhclient.conf

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers;


interface "enp0s20" {                                                                                                                                                                                 
  send dhcp6.client-id XX:XX:XX:XX:XX:XX:XX:XX:XX:XX;
}

In the inet6 setup of enp0s20 I want accept_ra=2, because I have net.ipv6.conf.all.forwarding=1 in my kernel (I intend to setup a vpn).

The problem

Restarting the networking service fails every second attempt.

$ sudo serving networking restart # first attempt
Job for networking.service failed because a timeout was exceeded.
See "systemctl status networking.service" and "journalctl -xe" for details.
$ sudo service networking restart # second attempt works fine (this cycles)

Starting the networking service also always fails at boot.

The logs

I enabled this to better see what is happening

# /etc/default/networking
VERBOSE=yes

Here is what I get from journalctl when restarting fails:

Apr 03 12:38:37 boxname ifup[4135]: ifup: parsing file /etc/network/interfaces.d/device-enp0s20-inet
Apr 03 12:38:37 boxname ifup[4135]: ifup: parsing file /etc/network/interfaces.d/device-enp0s20-inet6
Apr 03 12:38:37 boxname ifup[4135]: /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
Apr 03 12:38:37 boxname ifup[4135]: ifup: configuring interface enp0s20=enp0s20 (inet)
Apr 03 12:38:37 boxname ifup[4135]: /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
Apr 03 12:38:37 boxname ifup[4135]: /sbin/dhclient -4 -v -pf /run/dhclient.enp0s20.pid -lf /var/lib/dhcp/dhclient.enp0s20.leases -I -df /var/lib/dhcp/dhclient6.enp0s20.leases enp0s20
Apr 03 12:38:37 boxname ifup[4135]: Internet Systems Consortium DHCP Client 4.3.5
Apr 03 12:38:37 boxname ifup[4135]: Copyright 2004-2016 Internet Systems Consortium.
Apr 03 12:38:37 boxname ifup[4135]: All rights reserved.
Apr 03 12:38:37 boxname ifup[4135]: For info, please visit https://www.isc.org/software/dhcp/
Apr 03 12:38:38 boxname ifup[4135]: Listening on LPF/enp0s20/<REDACTED>
Apr 03 12:38:38 boxname ifup[4135]: Sending on   LPF/enp0s20/<REDACTED>
Apr 03 12:38:38 boxname ifup[4135]: Sending on   Socket/fallback
Apr 03 12:38:38 boxname ifup[4135]: DHCPDISCOVER on enp0s20 to 255.255.255.255 port 67 interval 4
Apr 03 12:38:38 boxname ifup[4135]: DHCPREQUEST of 163.172.XX.XX on enp0s20 to 255.255.255.255 port 67
Apr 03 12:38:38 boxname ifup[4135]: DHCPOFFER of 163.172.XX.XX from 163.172.XX.1
Apr 03 12:38:38 boxname ifup[4135]: DHCPACK of 163.172.XX.XX from 163.172.XX.1
Apr 03 12:38:38 boxname ifup[4135]: bound to 163.172.XX.XX -- renewal in 2147483648 seconds.
Apr 03 12:38:38 boxname ifup[4135]: /bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
Apr 03 12:38:38 boxname ifup[4135]: run-parts: executing /etc/network/if-up.d/000resolvconf
Apr 03 12:38:38 boxname ifup[4135]: run-parts: executing /etc/network/if-up.d/openntpd
Apr 03 12:38:38 boxname ifup[4135]: run-parts: executing /etc/network/if-up.d/openssh-server
Apr 03 12:38:38 boxname ifup[4135]: run-parts: executing /etc/network/if-up.d/upstart
Apr 03 12:38:38 boxname ifup[4135]: ifup: configuring interface enp0s20=enp0s20 (inet6)
Apr 03 12:38:38 boxname ifup[4135]: /bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
Apr 03 12:38:38 boxname ifup[4135]: /sbin/modprobe -q net-pf-10 > /dev/null 2>&1 || true # ignore failure.
Apr 03 12:38:38 boxname ifup[4135]: /sbin/sysctl -q -e -w net.ipv6.conf.enp0s20.accept_ra=2
Apr 03 12:38:38 boxname ifup[4135]: /bin/ip link set dev enp0s20  up
Apr 03 12:38:38 boxname ifup[4135]: /lib/ifupdown/wait-for-ll6.sh
Apr 03 12:38:39 boxname ifup[4135]: /sbin/dhclient -6 -pf /run/dhclient6.enp0s20.pid -lf /var/lib/dhcp/dhclient6.enp0s20.leases -I -P -N -df /var/lib/dhcp/dhclient.enp0s20.leases enp0s20
Apr 03 12:38:50 boxname ifup[4135]: RTNETLINK answers: Invalid argument

The question

Can you help me find out what is wrong and fix it?

1 Answer 1

2

I found the problem!

After researching a little bit, I found out that dhcpv6 works in such a way that clients talk from port 546 and servers from port 547. I added the two following ip6tables rules which are making my box act as a client:

-A INPUT -p udp --sport 547 --dport 546 -j ACCEPT
-A OUTPUT -p udp --sport 546 --dport 547 -j ACCEPT

This fixed the issue.

This issue only happened because I was using a firewall and I unintentionally blocked dhcpv6. If you are not using a firewall, you do not need these rules and this post is not the answer to your problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .