Dear List,
I'm using some post-up commands for additinal ip routes within /etc/network/interfaces. For many years and several debian versions this was fine. Like for example with (sanetized version):
iface eth0 inet6 static
address aaaa:bbbb:10:60:11::4
netmask 80
gateway aaaa:bbbb:10:60:11::2
post-up ip -6 route add aaaa:bbbb:10:60:105::/80 dev eth0 src aaaa:bbbb:10:60:11::4 via aaaa:bbbb:10:60:11::3
With trixie this does no longer work. It seems the ip address gets valid several seconds AFTER the post-up script gets run. The logs show some error: “Error: Invalid source address”
Does anybody know the reason for this?
regards
hede
Some more information. The following commands get run by ifup:
ip addr flush dev eth0 mngtmpaddr
ip link set dev eth0 up
ip -6 addr add aaaa:bbbb:10:60:11::4/80 dev eth0
ip -6 route replace default via aaaa:bbbb:10:60:11::2 dev eth0 onlink
ip -6 route add aaaa:bbbb:10:60:13::/80 dev eth0 src aaaa:bbbb:10:60:11::4 via aaaa:bbbb:10:60:11::3
The following shows that it needs about 2 seconds for the address to get valid / the route gets applied only after two one-seconds sleeps:
root@system:~# ip addr flush dev eth0 mngtmpaddr && ip link set dev eth0 up && ip -6 addr add aaaa:bbbb:10:60:11::4/80 dev eth0 && ip -6 route replace default via aaaa:bbbb:10:60:11::2 dev eth0 onlink && echo iface is up; echo first: ; ip -6 route add aaaa:bbbb:10:60:13::/80 dev eth0 src aaaa:bbbb:10:60:11::4 via aaaa:bbbb:10:60:11::3 ; sleep 1; echo second: ; ip -6 route add aaaa:bbbb:10:60:13::/80 dev eth0 src aaaa:bbbb:10:60:11::4 via aaaa:bbbb:10:60:11::3 ; sleep 1; echo third: ; ip -6 route add aaaa:bbbb:10:60:13::/80 dev eth0 src aaaa:bbbb:10:60:11::4 via aaaa:bbbb:10:60:11::3 ; sleep 1; echo forth: ; ip -6 route add aaaa:bbbb:10:60:13::/80 dev eth0 src aaaa:bbbb:10:60:11::4 via aaaa:bbbb:10:60:11::3 ; sleep 1; echo fifth: ; ip -6 route add aaaa:bbbb:10:60:13::/80 dev eth0 src aaaa:bbbb:10:60:11::4 via aaaa:bbbb:10:60:11::3 ;
iface is up
first:
Error: Invalid source address.
second:
Error: Invalid source address.
third:
forth:
RTNETLINK answers: File exists
fifth:
RTNETLINK answers: File exists
and btw: I do have my solution now, simply by running a postup-script some seconds after ifup finishes. But I'm still interested why this happens.