Jump to content

Raspberry Pi 1 B+ Ipv6 help

Netratt

Hello guys,

 

I encountered a problem with raspberry pi not getting an ipv6 <global> ip address.I looked on the internet for like 2-3 weeks because the internet should provide the answers i was looking for and it turned out i'm out of luck.Could anyone more experienced with linux help figure out why i am not getting an ipv6 ip address?

I have a fresh install now because i don't want to have a forgotten command to cause any issues if someone is willing to help me figure this out.

 

I will use this raspberry for pi-hole.

Link to comment
Share on other sites

Link to post
Share on other sites

Can you provide a bit more info about your setup? I assume the Pi sits behind your ISPs router and the router's DHCP server is set up to hand out IPv6 addresses to your internal network? Meaning any other device on the network gets an IPv6 address?

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

Yes Pi sits behind my crappy dlink router(waiting for my ubiquiti router delivery) and every other device gets an IPv6 address except Pi . Pi only gets the internal IPv6 address,which is useless.Also Pi has been set as a static IP address inside the router settings in case of a power down i won't have to modify the settings for the DNS server and so on.

Link to comment
Share on other sites

Link to post
Share on other sites

The Pi-hole is supposed to act as your internal DNS server, so why exactly would it need an external IPv6 address? And since it is a server, giving it a static IP address is the correct way to do it. Your DHCP server should be handing out the Pi's address as the DNS server to use, so if you ever need to change its address there's only one configuration to update (that of your DHCP server).

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

On the Pi you need to edit /etc/network/interfaces and for your interface you need edit the file to add the following below or above the current IPv4 configuration. Replace ens160 with whatever your interface name is. Example:

# The primary network interface
# This is an autoconfigured IPv6 interface
auto ens160
iface ens160 inet6 auto
iface ens160 inet static
        address 172.31.7.68
        netmask 255.255.255.0
        network 172.31.7.0
        broadcast 172.31.7.255
        gateway 172.31.7.5
        dns-nameservers 172.31.7.55

 

Current Network Layout:

Current Build Log/PC:

Prior Build Log/PC:

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Eigenvektor said:

The Pi-hole is supposed to act as your internal DNS server, so why exactly would it need an external IPv6 address? And since it is a server, giving it a static IP address is the correct way to do it. Your DHCP server should be handing out the Pi's address as the DNS server to use, so if you ever need to change its address there's only one configuration to update (that of your DHCP server).

You are right in all those stated except the fact that if Pi doesn't get an external IPv6 address all the traffic through IPv6 doesn't get routed via pi-hole and also inside the web-interface the settings where i can choose whatever DNS server i want to use,let's say google/cloudflare i can check the IPv4 servers but IPv6 servers don't let me check them because it doesn't have an IPv6 address.

 

@Lurick i added 

auto eth0
iface eth0 inet6 auto

inside /etc/network/interfaces did a reboot no difference.
then added to /etc/dhcpcd.conf ,before that i removed it from  /etc/network/interfaces
but no difference.Then added to both of them the commands and still nothing

as a mention in /etc/modules i have the command ipv6 .

Link to comment
Share on other sites

Link to post
Share on other sites

32 minutes ago, Netratt said:

You are right in all those stated except the fact that if Pi doesn't get an external IPv6 address all the traffic through IPv6 doesn't get routed via pi-hole and also inside the web-interface the settings where i can choose whatever DNS server i want to use,let's say google/cloudflare i can check the IPv4 servers but IPv6 servers don't let me check them because it doesn't have an IPv6 address.

Pi-hole is not a router, it doesn't route anything. It is a DNS server that resolves domain names to IP addresses. It resolves known ad servers to "nxdomain", which is how it prevents your browser from loading their ads. It is basically a caching DNS server, which is why it needs its own DNS server(s) to forward requests it doesn't know the answer to (yet).

 

So as long as your computers can talk to it on port 53 to send DNS queries, Pi-hole can do its job. So long as Pi-hole can talk to any external DNS server, it can do its job.

 

Here's a rough diagram of how the setup looks like on my internal network:

Pi-hole_setup.thumb.png.12856000f4e90d3c1d44818af4fde3f4.png

 

~edit: @Netratt You may have to enable the kernel module for IPv6 on your Pi-hole. Check the output of the following command:

lsmod | grep ipv6

If you see nothing, that means the module isn't loaded/enabled. You can enable it manually with the following command:

sudo modprobe ipv6

Verify that this command works as expected. If it does, you can enable the module directly on boot, by adding it to your modules. Add "ipv6" into "/etc/modules" Also, verify that IPv6 hasn't been disabled. Edit "/etc/sysctl.conf" and check whether it contains an entry "net.ipv6.conf.all.disable_ipv6 = 1". If so, remove it or change it to "0".

 
 

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

I know all of the above,i have an old laptop used for diagnostics on cars and i installed Lubuntu on it and it works like a charm even with IPv6 and also Pi-Hole as a dhcp server for testing purposes only.In the router settings also added the IPv4 and IPv6 the Pi DNS. I need that laptop thats why i want to use the raspberry PI. I know the necessary knowledge about networks and how they work, my only issue is with Pi not getting that IPv6,i lack the skills about understanding how a linux works at a deep coding level.I can work my way arround making things work on any linux machine if i have the internet at my disposal but with this networking stuff on raspberry Pi i didn't manage to make it work at all,even if i tried numerous commands found on the internet where people tried to activate IPv6 or even reverse engineering disabling IPv6 and still no results.

 

edit: @Eigenvektor i checked and "net.ipv6.conf.all.disable_ipv6 = 1" was behind # so it should have been disabled but either way i deleted the entry,i already have "ipv6" inside /etc/modules.

did a reboot and    lsdmod | grep ipv6 returned: 

"ipv6      446464 20 "

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Lurick said:

On the Pi you need to edit /etc/network/interfaces

@OP

I could be wrong considering this is a Pi and I don't know what version of Lubuntu is being used but wasn't /etc/network/interfaces replaced by netplan a while ago? I don't believe the interfaces file does anything anymore until you modify some other file to make it valid again. You would need to edit /etc/netplan/*.yaml.

Link to comment
Share on other sites

Link to post
Share on other sites

48 minutes ago, Netratt said:

edit: @Eigenvektor i checked and "net.ipv6.conf.all.disable_ipv6 = 1" was behind # so it should have been disabled but either way i deleted the entry,i already have "ipv6" inside /etc/modules.

did a reboot and    lsdmod | grep ipv6 returned: 

"ipv6      446464 20 "

Yeah, I realized you had an internal IPv6 address after I posted this ? So clearly IPv6 in general is enabled.

 

I think @Windows7ge is on the right track. Otherwise, could this be a limitation by your ISP? Do you know what block size they hand out? (/56?)

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Windows7ge said:

@OP

I could be wrong considering this is a Pi and I don't know what version of Lubuntu is being used but wasn't /etc/network/interfaces replaced by netplan a while ago? I don't believe the interfaces file does anything anymore until you modify some other file to make it valid again. You would need to edit /etc/netplan/*.yaml.

It is a raspberryPi that i want IPv6 on.The Lubuntu is installed on a laptop that i use and was just for testing purposes.

When you enter /etc/network/interfaces 

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:

There is no /etc/netplan .

 

IPv6 block size provided by my ISP is /64.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Netratt said:

It is a raspberryPi that i want IPv6 on.The Lubuntu is installed on a laptop that i use and was just for testing purposes.

When you enter /etc/network/interfaces 

 

There is no /etc/netplan .

Ah, so I was wrong. I don't speak Pi very well. If this is their specific OS I can't really offer better help. DHCP is suppose to give you everything you need which I would expect you have enabled by default. You can reserve the IP in the router (as you said you did) so only that device gets that IP. Other than that I can't say why it's not getting all the information.

Link to comment
Share on other sites

Link to post
Share on other sites

9 minutes ago, Netratt said:

It is a raspberryPi that i want IPv6 on.The Lubuntu is installed on a laptop that i use and was just for testing purposes.

When you enter /etc/network/interfaces 

There is no /etc/netplan .

 

IPv6 block size provided by my ISP is /64.

Yeah, it seems netplan is the new default in Ubuntu, but Debian 10 still uses ifupdown, so by extension I suppose Raspbian does too.

 

Can you run "ping6 google.com" on the Pi? I've just tried to enable IPv6 on my own Pi-hole (not running on a RasPi) and it seems to work right away without any further configuration. At least I can see the correct IPv6 prefix when I enter "ip addr show".

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

@Eigenvektor ping6 google.com returns:

connect: Network is unreachable.

I tried to install pi-hole on an android TV box with Armbian on it but that OS is to unstable.I didn't mention this because after a week the OS gets corrupted by itself altho only Pi-hole is running on it.On that one i have IPv6 connection but it is based on the Ubuntu 18.04 just the interface is using lightweight programs.To much instability to be used on anything.

 

@Windows7ge that is a mystery to be solved hehe.It's something related to raspberry's OS 100% but i just have to figure out how.

 

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Netratt said:

@Eigenvektor ping6 google.com returns:

connect: Network is unreachable.

I tried to install pi-hole on an android TV box with Armbian on it but that OS is to unstable.I didn't mention this because after a week the OS gets corrupted by itself altho only Pi-hole is running on it.On that one i have IPv6 connection but it is based on the Ubuntu 18.04 just the interface is using lightweight programs.To much instability to be used on anything.

I don't have a RasPi here to test, unfortunately. My Pi-hole is running on Debian 10 on a mini-itx system (that doubles as a NAS of sorts).

 

I've found a post that says auto-configuration of IPv6 is disabled on RasPi by default, you may need to add the following to /etc/sysctl.conf:

net.ipv6.conf.all.accept_ra=1

 

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

It's not working,either way i will slowly walk away from raspberry and probably focus on building a pc based on linux that i can use as a server and why not add pi-hole as a bonus on it. I don't think it's worth wasting your time and even mine for an outdated raspberry pi 1 that is just to stubborn to do basic tasks.

 

Thanks for your help but i would say we should stop consuming energy on this. :D

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×