Solved IPv6 Static IP for Device on Internal Network?

Currently reading
Solved IPv6 Static IP for Device on Internal Network?

Hello,

I'm trying to set up a pi-hole container on docker installed on a Raspberry Pi on my system.

I need to figure enter the machine's local IPv6 address in the docker-compose.yml file for pi-hole, and I'm stumped.

As far as I can tell, the machine has two IPv6 addresses on eth0:

Code:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 2605:6000:1521:83c4:e360:a8ba:fe5e:80bd/64 scope global dynamic noprefixroute
       valid_lft 604754sec preferred_lft 604754sec
    inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

I don't really understand why there are two, because I'm still not sure what the difference is between "scope global" and "scope link."

I do notice the "scope link" address is not dynamic. I'm hoping this means it's the machine's static IPv6 IP on the internal network link.

If neither of these are static, is there a way I can set a static IP to make pi-hole happy?
 
The first "global" one is just that. It is usable on the global internet and likely assigned by your router.

You are correct that the second "link" is a private, non-routable address that is only reachable on your local (physical) LAN. The give-away is the "fe80:" prefix, reserved for link-local addresses. These can be self-assigned and are commonly created by using the hardware MAC address. That should be a stable address.

As to manually assigning a static IPv6, how to do that will depend on your router.
 
The first "global" one is just that. It is usable on the global internet and likely assigned by your router.

You are correct that the second "link" is a private, non-routable address that is only reachable on your local (physical) LAN. The give-away is the "fe80:" prefix, reserved for link-local addresses. These can be self-assigned and are commonly created by using the hardware MAC address. That should be a stable address.

As to manually assigning a static IPv6, how to do that will depend on your router.

Thanks, @Seaprobe ! :) That's exactly what I was hoping.

The router is a Synology RT2600ac. It's a bit annoying because the 2600ac makes configuring static internal IPv4 addresses super easy, but doesn't expose that functionality at all for IPv6--or if it does, uses such a different way of doing it that I can't figure it out.

(Let's be real it's probably the latter.)

I'm going to edit the first post in this thread because I was apparently wearing my Moron Hat when I made it, and posted a MAC address.
 
Thanks, @Seaprobe ! :) That's exactly what I was hoping. The router is a Synology RT2600ac. It's a bit annoying because the 2600ac makes configuring static internal IPv4 addresses super easy, but doesn't expose that functionality at all for IPv6--or if it does, uses such a different way of doing it that I can't figure it out. (Let's be real it's probably the latter.) I'm going to edit the first post in this thread because I was apparently wearing my Moron Hat when I made it, and posted a MAC address.

Update: Sadly, that did not work.

The in-LAN server I'm attempting to set up needs a static IPv6 address with access to the internet. The global address definitely changes. It's not. tied to restarting the box, either. I'm guessing there's some equivalent of a DHCP lease and it eventually runs out.

The RT2600ac does not let me set static ipV6 addresses at all, which is, needless to say, very annoying. I'm looking at how to do it on the server itself--that is, set an IP and make sure it doesn't change. I'll likely need to do something on the router to block off a segment of v6 addresses so the router doesn't try to assign any of my "static" ones...
 
The RT2600ac does not let me set static ipV6 addresses at all, which is, needless to say, very annoying. I'm looking at how to do it on the server itself--that is, set an IP and make sure it doesn't change. I'll likely need to do something on the router to block off a segment of v6 addresses so the router doesn't try to assign any of my "static" ones...
While I cannot speak to the management console of your router, one is typically assigned a /64 block (at a minimum, some ISPs will provide a /60 or even a /48). Global addresses for a device are set through several mechanisms, often concurrently:
1. DHCPv6 (again, depends on your router). While not static, this tends to be "sticky" until and unless your ISP changes your IPv6 address block.
2. Stateless address, formed from the MAC address of the client's NIC, formed by the first 24 bits of the MAC, ff:fe, then the last 24 bits of the MAC, for example 2121::a1:b2:c3:ff:fe:d4:e5:f6 (where the MAC is a1:b2:c3:d4:e5:f6). This is also sticky and will only change if your ISP changes your address block or you replace your NIC.
3. Temporary addresses. Since stateless addresses are sticky and leak information, most OSs (iOS, Android, Mac OS, Windows) will self-assign random, rotating, temporary addresses. Most applications, such as email and browsers, will wind up using these as they are preferred by just about every OS to initiate an outbound connection.

Where does this take us?
1. If your router allows, set it to use a static DHCPv6 address. If it does change, it won't be often, and this is the best one to use as the router will have assigned it and will know how to route to it.
2. If you are certain your router will not allow you to do so, use the command line to set an address on your NAS:
ifconfig eth0 inet6 2001:db8:bdbd::123 prefixlen 64 alias
This is obviously an example; your prefix (and possibly prefix length) will be different. If you go this way, you'll need to set it up again after a reboot, preferably through a shell script.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

  • Question
What’s the network relationship between the motorola and 2600 in terms of their role in your lan? How are...
Replies
1
Views
1,769
Hi all, I am struggling with basic IPv6 config on my MR2200. I don't know a lot about this and have made...
Replies
0
Views
4,111
Hi, I'm looking for some help from the collective with a site to site VPN link. It's a satellite office...
Replies
0
Views
2,408
  • Question
I've just started using an RT6600ax running SRM 1.3.1-9346 Update 1. I received a report saying there was...
Replies
0
Views
1,265
Apparently iOS 14.x defaults to random MACs for ALL wifi connections (even pre-existing ones). If you're...
Replies
1
Views
2,484
On the RT2600, I use the regular network 10.86.173.X for most of my devices, including my NAS units, and...
Replies
0
Views
1,560

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top