Linux not preferring ipv6 on dhcpv6 network





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







3















On my home network, I'm using a (Raspbian) Raspberry Pi as a wifi router with hostapd, isc-dhcp-server, radvd, pihole, and dnscrypt-proxy installed. I do not use dhcpcd, I use dhclient. As I only get one ipv4 address and one ipv6 address from my ISP, I have both dhcp and dhcpv6 servers and NAT set up. When connecting to the wifi network, everything works perfectly and I can use both ipv4 and ipv6 to connect to the internet. However, if I ping a host, the ipv4 address is used:



$ ping google.com
PING google.com (216.58.212.174) 56(84) bytes of data.
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=1 ttl=55 time=16.1 ms
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=2 ttl=55 time=16.3 ms
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=3 ttl=55 time=16.5 ms


I want to use ipv6 by default. Without the Raspberry Pi, ping uses the ipv6 address:



$ ping google.com
PING google.com(ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e)) 56 data bytes
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=1 ttl=56 time=103 ms
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=2 ttl=56 time=18.5 ms
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=3 ttl=56 time=16.8 ms


This behaviour extends to browsers, curl, wget...



I've tested the network both with and without the Pihole DNS server, there's no difference in behaviour, so I don't think that would be the cause.





My local setup:



$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 30:65:ec:b8:45:66 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b2:a5:95:7c:58:a0 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.161/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp3s0
valid_lft 83213sec preferred_lft 83213sec
inet6 fd97:367f:e5b4:8c28:17e3:4ca9:b7b8:3150/64 scope global dynamic noprefixroute
valid_lft 86275sec preferred_lft 14275sec
inet6 fe80::755f:ab92:41fe:9872/64 scope link noprefixroute
valid_lft forever preferred_lft forever


/etc/gai.conf is empty.





My Raspberry Pi setup:



/etc/dhcp/dhcpd.conf:



default-lease-time 86400;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.254;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1;
}


/etc/dhcp/dhcpd6.conf:



default-lease-time 2592000;
authoritative;
subnet6 fd97:367f:e5b4:8c28::/64 {
range6 fd97:367f:e5b4:8c28:0000:0000:0000:2 fd97:367f:e5b4:8c28:ffff:ffff:ffff:fffe;
option dhcp6.name-servers fd97:367f:e5b4:8c28:0000:0000:0000:1;
}


/etc/network/interfaces:



auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
iface eth0 inet6 auto
privext 2

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.1
netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
iface wlan0 inet6 static
address fd97:367f:e5b4:8c28:0000:0000:0000:1
netmask 64
dad-attempts 0
up ip6tables-restore < /etc/iptables.ipv6.nat


/etc/radvd.conf:



interface wlan0 {
AdvSendAdvert on;
prefix fd97:367f:e5b4:8c28::/64 {};
};


/etc/iptables.ipv4.nat:



# Generated by iptables-save v1.6.0 on Fri Feb  8 13:46:33 2019
*filter
:INPUT ACCEPT [74:5800]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [96:7812]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Fri Feb 8 13:46:33 2019
# Generated by iptables-save v1.6.0 on Fri Feb 8 13:46:33 2019
*nat
:PREROUTING ACCEPT [1844:56256]
:INPUT ACCEPT [4:513]
:OUTPUT ACCEPT [6:492]
:POSTROUTING ACCEPT [1:48]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Feb 8 13:46:33 2019


/etc/iptables.ipv6.nat:



# Generated by ip6tables-save v1.6.0 on Fri Feb  8 13:59:43 2019
*filter
:INPUT ACCEPT [105:9056]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [63:7044]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Fri Feb 8 13:59:43 2019
# Generated by ip6tables-save v1.6.0 on Fri Feb 8 13:59:43 2019
*nat
:PREROUTING ACCEPT [7:584]
:INPUT ACCEPT [1:104]
:OUTPUT ACCEPT [1:140]
:POSTROUTING ACCEPT [1:140]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Feb 8 13:59:43 2019


net.ipv4.ip_forward and net.ipv6.conf.all.forwarding are set to 1 in /etc/sysctl.conf. dhcpcd is disabled and stopped.










share|improve this question

























  • I don't see any global IPv6 addresses in your configuration. Where are you expecting them to come from?

    – Michael Hampton
    Feb 8 at 23:37











  • The Raspberry Pi gets a single global ipv6 address on the ethernet interface, eth0. (See /etc/network/interfaces) NAT is used between eth0 and wlan0 both on ipv4 and ipv6 level. I'm sorry if this wasn't clear.

    – vw5E4opn
    Feb 9 at 9:09











  • The eth0 interface isn't even shown in your question at all. Nor is any interface from your Raspberry Pi, apparently.

    – Michael Hampton
    Feb 9 at 16:58











  • What do you mean? I posted the contents of /etc/network/interfaces? It contains the lo, eth0, and wlan0 interfaces?

    – vw5E4opn
    Feb 9 at 17:05











  • You did not post the output of ip a!

    – Michael Hampton
    Feb 9 at 17:06




















3















On my home network, I'm using a (Raspbian) Raspberry Pi as a wifi router with hostapd, isc-dhcp-server, radvd, pihole, and dnscrypt-proxy installed. I do not use dhcpcd, I use dhclient. As I only get one ipv4 address and one ipv6 address from my ISP, I have both dhcp and dhcpv6 servers and NAT set up. When connecting to the wifi network, everything works perfectly and I can use both ipv4 and ipv6 to connect to the internet. However, if I ping a host, the ipv4 address is used:



$ ping google.com
PING google.com (216.58.212.174) 56(84) bytes of data.
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=1 ttl=55 time=16.1 ms
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=2 ttl=55 time=16.3 ms
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=3 ttl=55 time=16.5 ms


I want to use ipv6 by default. Without the Raspberry Pi, ping uses the ipv6 address:



$ ping google.com
PING google.com(ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e)) 56 data bytes
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=1 ttl=56 time=103 ms
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=2 ttl=56 time=18.5 ms
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=3 ttl=56 time=16.8 ms


This behaviour extends to browsers, curl, wget...



I've tested the network both with and without the Pihole DNS server, there's no difference in behaviour, so I don't think that would be the cause.





My local setup:



$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 30:65:ec:b8:45:66 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b2:a5:95:7c:58:a0 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.161/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp3s0
valid_lft 83213sec preferred_lft 83213sec
inet6 fd97:367f:e5b4:8c28:17e3:4ca9:b7b8:3150/64 scope global dynamic noprefixroute
valid_lft 86275sec preferred_lft 14275sec
inet6 fe80::755f:ab92:41fe:9872/64 scope link noprefixroute
valid_lft forever preferred_lft forever


/etc/gai.conf is empty.





My Raspberry Pi setup:



/etc/dhcp/dhcpd.conf:



default-lease-time 86400;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.254;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1;
}


/etc/dhcp/dhcpd6.conf:



default-lease-time 2592000;
authoritative;
subnet6 fd97:367f:e5b4:8c28::/64 {
range6 fd97:367f:e5b4:8c28:0000:0000:0000:2 fd97:367f:e5b4:8c28:ffff:ffff:ffff:fffe;
option dhcp6.name-servers fd97:367f:e5b4:8c28:0000:0000:0000:1;
}


/etc/network/interfaces:



auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
iface eth0 inet6 auto
privext 2

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.1
netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
iface wlan0 inet6 static
address fd97:367f:e5b4:8c28:0000:0000:0000:1
netmask 64
dad-attempts 0
up ip6tables-restore < /etc/iptables.ipv6.nat


/etc/radvd.conf:



interface wlan0 {
AdvSendAdvert on;
prefix fd97:367f:e5b4:8c28::/64 {};
};


/etc/iptables.ipv4.nat:



# Generated by iptables-save v1.6.0 on Fri Feb  8 13:46:33 2019
*filter
:INPUT ACCEPT [74:5800]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [96:7812]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Fri Feb 8 13:46:33 2019
# Generated by iptables-save v1.6.0 on Fri Feb 8 13:46:33 2019
*nat
:PREROUTING ACCEPT [1844:56256]
:INPUT ACCEPT [4:513]
:OUTPUT ACCEPT [6:492]
:POSTROUTING ACCEPT [1:48]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Feb 8 13:46:33 2019


/etc/iptables.ipv6.nat:



# Generated by ip6tables-save v1.6.0 on Fri Feb  8 13:59:43 2019
*filter
:INPUT ACCEPT [105:9056]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [63:7044]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Fri Feb 8 13:59:43 2019
# Generated by ip6tables-save v1.6.0 on Fri Feb 8 13:59:43 2019
*nat
:PREROUTING ACCEPT [7:584]
:INPUT ACCEPT [1:104]
:OUTPUT ACCEPT [1:140]
:POSTROUTING ACCEPT [1:140]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Feb 8 13:59:43 2019


net.ipv4.ip_forward and net.ipv6.conf.all.forwarding are set to 1 in /etc/sysctl.conf. dhcpcd is disabled and stopped.










share|improve this question

























  • I don't see any global IPv6 addresses in your configuration. Where are you expecting them to come from?

    – Michael Hampton
    Feb 8 at 23:37











  • The Raspberry Pi gets a single global ipv6 address on the ethernet interface, eth0. (See /etc/network/interfaces) NAT is used between eth0 and wlan0 both on ipv4 and ipv6 level. I'm sorry if this wasn't clear.

    – vw5E4opn
    Feb 9 at 9:09











  • The eth0 interface isn't even shown in your question at all. Nor is any interface from your Raspberry Pi, apparently.

    – Michael Hampton
    Feb 9 at 16:58











  • What do you mean? I posted the contents of /etc/network/interfaces? It contains the lo, eth0, and wlan0 interfaces?

    – vw5E4opn
    Feb 9 at 17:05











  • You did not post the output of ip a!

    – Michael Hampton
    Feb 9 at 17:06
















3












3








3








On my home network, I'm using a (Raspbian) Raspberry Pi as a wifi router with hostapd, isc-dhcp-server, radvd, pihole, and dnscrypt-proxy installed. I do not use dhcpcd, I use dhclient. As I only get one ipv4 address and one ipv6 address from my ISP, I have both dhcp and dhcpv6 servers and NAT set up. When connecting to the wifi network, everything works perfectly and I can use both ipv4 and ipv6 to connect to the internet. However, if I ping a host, the ipv4 address is used:



$ ping google.com
PING google.com (216.58.212.174) 56(84) bytes of data.
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=1 ttl=55 time=16.1 ms
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=2 ttl=55 time=16.3 ms
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=3 ttl=55 time=16.5 ms


I want to use ipv6 by default. Without the Raspberry Pi, ping uses the ipv6 address:



$ ping google.com
PING google.com(ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e)) 56 data bytes
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=1 ttl=56 time=103 ms
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=2 ttl=56 time=18.5 ms
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=3 ttl=56 time=16.8 ms


This behaviour extends to browsers, curl, wget...



I've tested the network both with and without the Pihole DNS server, there's no difference in behaviour, so I don't think that would be the cause.





My local setup:



$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 30:65:ec:b8:45:66 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b2:a5:95:7c:58:a0 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.161/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp3s0
valid_lft 83213sec preferred_lft 83213sec
inet6 fd97:367f:e5b4:8c28:17e3:4ca9:b7b8:3150/64 scope global dynamic noprefixroute
valid_lft 86275sec preferred_lft 14275sec
inet6 fe80::755f:ab92:41fe:9872/64 scope link noprefixroute
valid_lft forever preferred_lft forever


/etc/gai.conf is empty.





My Raspberry Pi setup:



/etc/dhcp/dhcpd.conf:



default-lease-time 86400;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.254;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1;
}


/etc/dhcp/dhcpd6.conf:



default-lease-time 2592000;
authoritative;
subnet6 fd97:367f:e5b4:8c28::/64 {
range6 fd97:367f:e5b4:8c28:0000:0000:0000:2 fd97:367f:e5b4:8c28:ffff:ffff:ffff:fffe;
option dhcp6.name-servers fd97:367f:e5b4:8c28:0000:0000:0000:1;
}


/etc/network/interfaces:



auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
iface eth0 inet6 auto
privext 2

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.1
netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
iface wlan0 inet6 static
address fd97:367f:e5b4:8c28:0000:0000:0000:1
netmask 64
dad-attempts 0
up ip6tables-restore < /etc/iptables.ipv6.nat


/etc/radvd.conf:



interface wlan0 {
AdvSendAdvert on;
prefix fd97:367f:e5b4:8c28::/64 {};
};


/etc/iptables.ipv4.nat:



# Generated by iptables-save v1.6.0 on Fri Feb  8 13:46:33 2019
*filter
:INPUT ACCEPT [74:5800]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [96:7812]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Fri Feb 8 13:46:33 2019
# Generated by iptables-save v1.6.0 on Fri Feb 8 13:46:33 2019
*nat
:PREROUTING ACCEPT [1844:56256]
:INPUT ACCEPT [4:513]
:OUTPUT ACCEPT [6:492]
:POSTROUTING ACCEPT [1:48]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Feb 8 13:46:33 2019


/etc/iptables.ipv6.nat:



# Generated by ip6tables-save v1.6.0 on Fri Feb  8 13:59:43 2019
*filter
:INPUT ACCEPT [105:9056]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [63:7044]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Fri Feb 8 13:59:43 2019
# Generated by ip6tables-save v1.6.0 on Fri Feb 8 13:59:43 2019
*nat
:PREROUTING ACCEPT [7:584]
:INPUT ACCEPT [1:104]
:OUTPUT ACCEPT [1:140]
:POSTROUTING ACCEPT [1:140]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Feb 8 13:59:43 2019


net.ipv4.ip_forward and net.ipv6.conf.all.forwarding are set to 1 in /etc/sysctl.conf. dhcpcd is disabled and stopped.










share|improve this question
















On my home network, I'm using a (Raspbian) Raspberry Pi as a wifi router with hostapd, isc-dhcp-server, radvd, pihole, and dnscrypt-proxy installed. I do not use dhcpcd, I use dhclient. As I only get one ipv4 address and one ipv6 address from my ISP, I have both dhcp and dhcpv6 servers and NAT set up. When connecting to the wifi network, everything works perfectly and I can use both ipv4 and ipv6 to connect to the internet. However, if I ping a host, the ipv4 address is used:



$ ping google.com
PING google.com (216.58.212.174) 56(84) bytes of data.
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=1 ttl=55 time=16.1 ms
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=2 ttl=55 time=16.3 ms
64 bytes from ams15s22-in-f174.1e100.net (216.58.212.174): icmp_seq=3 ttl=55 time=16.5 ms


I want to use ipv6 by default. Without the Raspberry Pi, ping uses the ipv6 address:



$ ping google.com
PING google.com(ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e)) 56 data bytes
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=1 ttl=56 time=103 ms
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=2 ttl=56 time=18.5 ms
64 bytes from ams15s22-in-x0e.1e100.net (2a00:1450:400e:801::200e): icmp_seq=3 ttl=56 time=16.8 ms


This behaviour extends to browsers, curl, wget...



I've tested the network both with and without the Pihole DNS server, there's no difference in behaviour, so I don't think that would be the cause.





My local setup:



$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 30:65:ec:b8:45:66 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b2:a5:95:7c:58:a0 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.161/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp3s0
valid_lft 83213sec preferred_lft 83213sec
inet6 fd97:367f:e5b4:8c28:17e3:4ca9:b7b8:3150/64 scope global dynamic noprefixroute
valid_lft 86275sec preferred_lft 14275sec
inet6 fe80::755f:ab92:41fe:9872/64 scope link noprefixroute
valid_lft forever preferred_lft forever


/etc/gai.conf is empty.





My Raspberry Pi setup:



/etc/dhcp/dhcpd.conf:



default-lease-time 86400;
authoritative;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.254;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1;
}


/etc/dhcp/dhcpd6.conf:



default-lease-time 2592000;
authoritative;
subnet6 fd97:367f:e5b4:8c28::/64 {
range6 fd97:367f:e5b4:8c28:0000:0000:0000:2 fd97:367f:e5b4:8c28:ffff:ffff:ffff:fffe;
option dhcp6.name-servers fd97:367f:e5b4:8c28:0000:0000:0000:1;
}


/etc/network/interfaces:



auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
iface eth0 inet6 auto
privext 2

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.1
netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
iface wlan0 inet6 static
address fd97:367f:e5b4:8c28:0000:0000:0000:1
netmask 64
dad-attempts 0
up ip6tables-restore < /etc/iptables.ipv6.nat


/etc/radvd.conf:



interface wlan0 {
AdvSendAdvert on;
prefix fd97:367f:e5b4:8c28::/64 {};
};


/etc/iptables.ipv4.nat:



# Generated by iptables-save v1.6.0 on Fri Feb  8 13:46:33 2019
*filter
:INPUT ACCEPT [74:5800]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [96:7812]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Fri Feb 8 13:46:33 2019
# Generated by iptables-save v1.6.0 on Fri Feb 8 13:46:33 2019
*nat
:PREROUTING ACCEPT [1844:56256]
:INPUT ACCEPT [4:513]
:OUTPUT ACCEPT [6:492]
:POSTROUTING ACCEPT [1:48]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Feb 8 13:46:33 2019


/etc/iptables.ipv6.nat:



# Generated by ip6tables-save v1.6.0 on Fri Feb  8 13:59:43 2019
*filter
:INPUT ACCEPT [105:9056]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [63:7044]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Fri Feb 8 13:59:43 2019
# Generated by ip6tables-save v1.6.0 on Fri Feb 8 13:59:43 2019
*nat
:PREROUTING ACCEPT [7:584]
:INPUT ACCEPT [1:104]
:OUTPUT ACCEPT [1:140]
:POSTROUTING ACCEPT [1:140]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Feb 8 13:59:43 2019


net.ipv4.ip_forward and net.ipv6.conf.all.forwarding are set to 1 in /etc/sysctl.conf. dhcpcd is disabled and stopped.







linux networking wireless-networking iptables ipv6






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 8 at 21:49







vw5E4opn

















asked Feb 8 at 17:47









vw5E4opnvw5E4opn

163




163













  • I don't see any global IPv6 addresses in your configuration. Where are you expecting them to come from?

    – Michael Hampton
    Feb 8 at 23:37











  • The Raspberry Pi gets a single global ipv6 address on the ethernet interface, eth0. (See /etc/network/interfaces) NAT is used between eth0 and wlan0 both on ipv4 and ipv6 level. I'm sorry if this wasn't clear.

    – vw5E4opn
    Feb 9 at 9:09











  • The eth0 interface isn't even shown in your question at all. Nor is any interface from your Raspberry Pi, apparently.

    – Michael Hampton
    Feb 9 at 16:58











  • What do you mean? I posted the contents of /etc/network/interfaces? It contains the lo, eth0, and wlan0 interfaces?

    – vw5E4opn
    Feb 9 at 17:05











  • You did not post the output of ip a!

    – Michael Hampton
    Feb 9 at 17:06





















  • I don't see any global IPv6 addresses in your configuration. Where are you expecting them to come from?

    – Michael Hampton
    Feb 8 at 23:37











  • The Raspberry Pi gets a single global ipv6 address on the ethernet interface, eth0. (See /etc/network/interfaces) NAT is used between eth0 and wlan0 both on ipv4 and ipv6 level. I'm sorry if this wasn't clear.

    – vw5E4opn
    Feb 9 at 9:09











  • The eth0 interface isn't even shown in your question at all. Nor is any interface from your Raspberry Pi, apparently.

    – Michael Hampton
    Feb 9 at 16:58











  • What do you mean? I posted the contents of /etc/network/interfaces? It contains the lo, eth0, and wlan0 interfaces?

    – vw5E4opn
    Feb 9 at 17:05











  • You did not post the output of ip a!

    – Michael Hampton
    Feb 9 at 17:06



















I don't see any global IPv6 addresses in your configuration. Where are you expecting them to come from?

– Michael Hampton
Feb 8 at 23:37





I don't see any global IPv6 addresses in your configuration. Where are you expecting them to come from?

– Michael Hampton
Feb 8 at 23:37













The Raspberry Pi gets a single global ipv6 address on the ethernet interface, eth0. (See /etc/network/interfaces) NAT is used between eth0 and wlan0 both on ipv4 and ipv6 level. I'm sorry if this wasn't clear.

– vw5E4opn
Feb 9 at 9:09





The Raspberry Pi gets a single global ipv6 address on the ethernet interface, eth0. (See /etc/network/interfaces) NAT is used between eth0 and wlan0 both on ipv4 and ipv6 level. I'm sorry if this wasn't clear.

– vw5E4opn
Feb 9 at 9:09













The eth0 interface isn't even shown in your question at all. Nor is any interface from your Raspberry Pi, apparently.

– Michael Hampton
Feb 9 at 16:58





The eth0 interface isn't even shown in your question at all. Nor is any interface from your Raspberry Pi, apparently.

– Michael Hampton
Feb 9 at 16:58













What do you mean? I posted the contents of /etc/network/interfaces? It contains the lo, eth0, and wlan0 interfaces?

– vw5E4opn
Feb 9 at 17:05





What do you mean? I posted the contents of /etc/network/interfaces? It contains the lo, eth0, and wlan0 interfaces?

– vw5E4opn
Feb 9 at 17:05













You did not post the output of ip a!

– Michael Hampton
Feb 9 at 17:06







You did not post the output of ip a!

– Michael Hampton
Feb 9 at 17:06












1 Answer
1






active

oldest

votes


















0














So after googling some more about NAT66, I found this blog post: https://mcilloni.ovh/2018/01/20/oh-god-why-NAT66/



Indeed, the writer had the same problem as me, and the solution is to edit /etc/gai.conf in order to remove the label of the fc00::/7 subnet (i.e. handled the same as global IPv6 addresses). Unfortunately the issue is a combination of network and client interaction, so every client has to do the same configuration change.






share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1403613%2flinux-not-preferring-ipv6-on-dhcpv6-network%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    So after googling some more about NAT66, I found this blog post: https://mcilloni.ovh/2018/01/20/oh-god-why-NAT66/



    Indeed, the writer had the same problem as me, and the solution is to edit /etc/gai.conf in order to remove the label of the fc00::/7 subnet (i.e. handled the same as global IPv6 addresses). Unfortunately the issue is a combination of network and client interaction, so every client has to do the same configuration change.






    share|improve this answer




























      0














      So after googling some more about NAT66, I found this blog post: https://mcilloni.ovh/2018/01/20/oh-god-why-NAT66/



      Indeed, the writer had the same problem as me, and the solution is to edit /etc/gai.conf in order to remove the label of the fc00::/7 subnet (i.e. handled the same as global IPv6 addresses). Unfortunately the issue is a combination of network and client interaction, so every client has to do the same configuration change.






      share|improve this answer


























        0












        0








        0







        So after googling some more about NAT66, I found this blog post: https://mcilloni.ovh/2018/01/20/oh-god-why-NAT66/



        Indeed, the writer had the same problem as me, and the solution is to edit /etc/gai.conf in order to remove the label of the fc00::/7 subnet (i.e. handled the same as global IPv6 addresses). Unfortunately the issue is a combination of network and client interaction, so every client has to do the same configuration change.






        share|improve this answer













        So after googling some more about NAT66, I found this blog post: https://mcilloni.ovh/2018/01/20/oh-god-why-NAT66/



        Indeed, the writer had the same problem as me, and the solution is to edit /etc/gai.conf in order to remove the label of the fc00::/7 subnet (i.e. handled the same as global IPv6 addresses). Unfortunately the issue is a combination of network and client interaction, so every client has to do the same configuration change.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 9 at 12:56









        vw5E4opnvw5E4opn

        163




        163






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1403613%2flinux-not-preferring-ipv6-on-dhcpv6-network%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

            How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...