2

I am trying to set both a static ipv4 address and a static ipv6 address on a home hosted Debian 11 server (it's actually just a PC).

Here is my /etc/network/interfaces :

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

The loopback network interface

auto lo iface lo inet loopback

The primary network interface

auto eno1 iface eno1 inet static address 192.168.1.149 netmask 24 gateway 192.168.1.1

iface eno1 inet6 static address 2a01:xxxx:xxxx:xxxx::1234 netmask 56 gateway fe80::712a:e39b:d35a:3ea4

After restarting networking service with `sudo service netowrking restart" Here is the result (exactyly what i want):

sept. 15 00:07:56 omen-debian systemd[1]: Starting Raise network interfaces...
sept. 15 00:08:07 omen-debian ifup[785]: Waiting for DAD... Timed out
sept. 15 00:08:07 omen-debian ifup[637]: ifup: failed to bring up eno1
sept. 15 00:08:07 omen-debian systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
sept. 15 00:08:07 omen-debian systemd[1]: networking.service: Failed with result 'exit-code'.
sept. 15 00:08:07 omen-debian systemd[1]: Failed to start Raise network interfaces.
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether c8:d3:ff:e6:b5:59 brd ff:ff:ff:ff:ff:ff
    altname enp5s0
    inet 192.168.1.149/24 brd 192.168.1.255 scope global eno1
       valid_lft forever preferred_lft forever
    inet6 2a01:xxxx:xxxx:xxxx::1234/56 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::cad3:ffff:fee6:b559/64 scope link 
       valid_lft forever preferred_lft forever

As you see my networking service produces an error. What am i doing wrong ?

2 Answers2

1

this is @asktyagi answer but I added here to be clear to others

On Debian 11 , after booting, systemctl status networking.service would show failure to add ipv6 addr to an interface that had ipv4 addr.
Even it was set to /etc/network/interface that interface did not have ipv6 address

Jan 30 14:07:48 debian11 systemd[1]: Starting Raise network interfaces...
Jan 30 14:07:48 debian11 ifup[543]: RTNETLINK answers: Permission denied
Jan 30 14:07:48 debian11 ifup[478]: ifup: failed to bring up ens192

so the error is RTNETLINK answers: Permission denied

none of these worked

ip -6 addr add IPv6/64  dev ens192 metric 1

and showed permission denied

then

route -A inet6 add IPv6/64  dev ens192

was also showed permission denied

changing /etc/sysctl.conf with these options did not solved link

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

and

net.ipv6.conf.all.disable_ipv6=1

or reordering the configuration did not help either link

worked

net.ipv6.conf.<interface name>.accept_dad = 0

and reboot.
After reboot there was no error on networking and ipv6 was added to the interface.

0

I'm curious about that is this problem exists on debian9? Similarly, I configure ipv4 and ipv6 addr and route in /etc/network/interfaces.

eth1's configuration like:

auto eth1
iface eth1 inet static
address 192.168.0.1/24
up ip route add default via 192.168.0.254 dev eth1 table 101
up ip rule add pref 20000 from 192.168.0.1/32 lookup 101

auto eth1 iface eth1 inet6 static address fdbd::1234/64 up ip -6 route add default via fdbd::1 dev eth1 table 101 up ip -6 rule add pref 20000 from fdbd::1234/128 lookup 101 down ip -6 route del default via fdbd::1 dev eth1 table 101 down ip -6 rule del pref 20000 from fdbd::1234/128 lookup 101

After a reboot, I found out that ipv4 is normal, but ipv6 only had addr configured and no ipv6 route is configured. The error is the same

Waiting for DAD... Timed out
ifup: failed to bring up eth1