TransWikia.com

Configuring Debian Buster (10) for IPv6 with DHCP

Unix & Linux Asked by chmike on February 13, 2021

I had a Debian Jessie server instance hosted by a provider. This instance had its IPv6 an IPv4 address defined statically. I upgraded my server to Debian Buster, and its IPv4 address is defined by DHCP. But the IPv6 address is not automatically set.

This is what I get with ifconfig:

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 151.80.**.**  netmask 255.255.255.0  broadcast 151.80.**.**
        inet6 fe80::eea8:6bff:****:****  prefixlen 64  scopeid 0x20<link>
        ether ec:a8:6b:f1:**:**  txqueuelen 1000  (Ethernet)
        RX packets 925  bytes 78623 (76.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 380  bytes 55091 (53.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf7c00000-f7c20000  

The IPv6 address of my server is 2001:41d0:e:::****. This is what I defined in my DNS as AAAA address. It was working perfectly with Jessie and a static configuration.

Why is the IPv6 address not set automatically by DHCP ? Is it because they don’t provide it with DHCP information ? Or is it because Debian ignores it and doesn’t set it ?

I can’t configure the IPv6 address because I’m lacking the gateway address.

2 Answers

Solved the problem.

I tried to apply the procedure provided by my hosting provider here: https://docs.ovh.com/fr/dedicated/network-ipv6/. Unfortunately it didn’t work.

The reason is that the network is named eno1 and not eth0 when I execute ifconfig.

Here is what I did.

In /etc/sysctl.conf I added the following at the end of the file:

net.ipv6.conf.all.autoconf = 0
net.ipv6.conf.default.autoconf = 0
net.ipv6.conf.eno1.autoconf = 0
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.default.accept_ra = 0
net.ipv6.conf.eno1.accept_ra = 0

In /etc/network/interfaces I added the following just after iface eth0 inet dhcp.

iface eno1 inet6 static
    address 2001:41d0:****:****:****:****
    netmask 128
    post-up /sbin/ip -family inet6 route add 2001:41d0:****:**ff:ff:ff:ff:ff dev eno1
    post-up /sbin/ip -family inet6 route add default via 2001:41d0:****:**ff:ff:ff:ff:ff
    pre-down /sbin/ip -family inet6 route del default via 2001:41d0:****:**ff:ff:ff:ff:ff
    pre-down /sbin/ip -family inet6 route del 2001:41d0:****:**ff:ff:ff:ff:ff dev eno1

I then restart the network with the command /etc/init.d/networking restart.

I then see the static IPv6 address shown in the output of ifconfig as expected.

Correct answer by chmike on February 13, 2021

I encountered the same problem. Your post helped me, thanks. here is my procedure.

verification ifconfig
nano /etc/sysctl.conf
nano /etc/network/interfaces
nano /etc/network/interfaces.d/50-cloud-init
/etc/init.d/networking restart
ok,

ipv6 config
create (see in /50-cloud-init)
nano /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
add
network: {config: disabled}

nano /etc/sysctl.conf
add
net.ipv6.conf.all.autoconf = 0 (doc ovh)
net.ipv6.conf.all.accept_ra = 0 (doc ovh)
net.ipv4.ip_forward=0 (webmin panel)
net.ipv6.conf.default.autoconf = 0 (your post)
net.ipv6.conf.eno1.autoconf = 0 (your post)
net.ipv6.conf.default.accept_ra = 0 (your post)
net.ipv6.conf.eno1.accept_ra = 0 (your post)

sh sysctl -p (doc ovh)
result
/usr/sbin/sysctl: /usr/sbin/sysctl: cannot execute binary file
(so i choose reboot)
systemctl reboot
ok

registration of ipv6 and routing
ip addr add IPV6/64 dev IF
ip -6 route add IPV6_GATEWAY dev IF
ip -6 route add default via IPV6_GATEWAY dev IF

nano /etc/network/interfaces

IPV6

iface IF inet6 static
address YOUR_IPv6
netmask 64 (or 128)

post-up /sbin/ip -f inet6 route add IPv6_GATEWAY dev IF
post-up /sbin/ip -f inet6 route add default via IPv6_GATEWAY
pre-down /sbin/ip -f inet6 route del IPv6_GATEWAY dev IF
pre-down /sbin/ip -f inet6 route del default via Ipv6_GATEWAY

/etc/init.d/networking restart
ok

(test ping)
date && ping -c 6 proof.ovh.net
ping6 -c 4 2001:4860:4860::8888 (doc ovh)
date && mtr -rbwz -c 10 -6 [ipv6 of my connection]
all ok

since my connection
date && ping6 -c 6 [server's ipv6]
date && mtr -rbwz -c 10 -6 [server's ipv6]
ok

systemctl reboot
ok
ifconfig ok
ip a ok
tests ping ok

?☺️?

Thanks for your post

Answered by BigMac-X on February 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP