ifupdown-ng / ifupdown-ng

flexible ifup/ifdown implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IPv6 addresses without prefixes are not handled ideally

awilfox opened this issue · comments

Given an interfaces file:

auto eth0
iface eth0
    address 2001:470:1f10::1

./ifup -v -a yields:

+ configure_addresses add
+ for addr in ${IF_ADDRESSES}
++ addr_family 2001:470:1f10::1/24
++ '[' 2001:470:1f10::1/24 '!=' 2001:470:1f10::1/24 ']'
++ '[' 2001:470:1f10::1/24 '!=' 70:1f10::1/24 ']'
++ echo -6
+ addrfam=-6
+ '[' '' -a -6 = -4 ']'
+ PEER=
+ '[' -z '' -a add = del ']'
+ ip -6 addr add 2001:470:1f10::1/24 dev eth0

This is obviously not ideal. Further, using a Debian-style dual stack configuration doesn't work at all:

auto eth0
iface eth0 inet static
        address 172.16.1.13
        netmask 255.255.255.0
iface eth0 inet6 static
        address 2001:470:1f10::1
        netmask 112
+ ip -4 addr add 172.16.1.13/24 dev eth0
+ ip -6 addr add 2001:470:1f10::1/24 dev eth0

Even setting the netmask before the address doesn't seem to help:

auto eth0
iface eth0 inet static
        address 172.16.1.13
        netmask 255.255.255.0
iface eth0 inet6 static
        netmask 112
        address 2001:470:1f10::1
+ ip -4 addr add 172.16.1.13/24 dev eth0
+ ip -6 addr add 2001:470:1f10::1/24 dev eth0