Community discussions

MikroTik App
 
jhbarrantes
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Wed Aug 21, 2019 2:56 pm

How to split dynamic IPv6 pool into subnets

Tue Aug 08, 2023 4:55 pm

Hi!

I read several posts and still don't understand if I'm doing something wrong or simply this feature is not implemented in current ROS 7.x version

Question: how in earth do you assign /64 addresses (subnets) to different interfaces when having a /56 dynamic prefix delivered to a pool by dhcp-client?

My curren provider delegates to me a /56 address pool, so I've got 8 bits to play for subnetting, for then delivering a standard /64 per interface. That means I could potentially create 256 differet subnets from that pool. However, when trying to setup this, I always fall into the same problem: no matter how you specify the address into /ipv6/address add command, that as soon as you indicate the flag "from-pool=pool", it will start picking up any free /64 from that pool, but not allowing you to specify which one you want to use.

Let's put a real example: pool = 2a02:9141:ab90::/56 (essentially 2a02:9141:ab90:00XX::/64, been that XX the subnets I want to play with). Well, I have tried the following three approaches, and everyone has its counterpart:
  • Option 1: specify the full /64 address you want to give per interface. Ej:
    /ipv6 address
    add interface=home from-pool=pool address=2a02:9141:ab90::/64
    add interface=guest from-pool=pool address=2a02:9141:ab90:1::/64
    add interface=guestfriends from-pool=pool address=2a02:9141:ab90:2::/64
    
    Problem: in reality, the addresses are not specifying the subnet to pick up from the pool. These look like this in the export:
    /ipv6 address
    add interface=home from-pool=pool
    add interface=guest from-pool=pool
    add interface=guestfriends from-pool=pool
    
    What does it means? That once you restart the router, your subnet per vlan will change, because the router process the interface by alphabetical order (I guess) so your setup will change. Subnet 0 will be given to guest, rather than home, 1 will be given to guestfriends, and 2 will be given to home vlan interface.
  • Option 2: following the official documentation, specify just part of the address to be constructed from pool, to allow the pool to form the complete address in this manner: <prefix_from_pool><rest of the address>
    /ipv6 address
    add interface=home from-pool=pool address=::/64
    add interface=guest from-pool=pool address=1::/64
    add interface=guestfriends from-pool=pool=2::/64
    
    Problem: the address created reported an error ;;; address pool error: bad preferred prefix! (1). I tried several different formats I found in different posts, but all lead me to the same: I can only specify the second /64 part of the address, but nothing changes the first /64 part, where the hex bytes for the subnets are.
  • Option 3: forget about the pool and provide the address manually
    /ipv6 address
    add address=2a02:9141:ab90:: interface=home
    add address=2a02:9141:ab90:1:: interface=guest
    add address=2a02:9141:ab90:2:: interface=guestfriends
    
    Problem: my provider is delivering prefixes that are not static. These can change at any point, to I'm basically going wild with this approach. I know 99% of the time could be the same prefix, but they clarify to me that this could potentially change at any point, reason why this is delivered by a DHCP client prefix delegation.

Am I missing something? Is this simply not implemented? Or is it that I'm doing something very weird nobody has done before? (which I really don't think so).

Thanks!
 
User avatar
Kentzo
Long time Member
Long time Member
Posts: 605
Joined: Mon Jan 27, 2014 3:35 pm
Location: California

Re: How to split dynamic IPv6 pool into subnets  [SOLVED]

Tue Aug 08, 2023 8:07 pm

Subnet ID is managed by RouterOS and you cannot influence its assignment when using from-pool. Currently Option 3 is your only solution, use dhcp-client's script to update prefixes when necessary.

Please create a support request at help.mikrotik.com
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12438
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: How to split dynamic IPv6 pool into subnets

Tue Aug 08, 2023 9:01 pm

Problem: my provider is delivering prefixes that are not static.
But then why are you creating all these problems for yourself?

How many times a day do you restart your router, continuously?

If you don't have static IPv6, what does it matter what IPv6 that particular VLAN will have?
Last edited by rextended on Tue Aug 08, 2023 9:11 pm, edited 1 time in total.
 
User avatar
Kentzo
Long time Member
Long time Member
Posts: 605
Joined: Mon Jan 27, 2014 3:35 pm
Location: California

Re: How to split dynamic IPv6 pool into subnets

Tue Aug 08, 2023 9:07 pm

If you don't have static IPv6, what does it matter what IPv6 that particular VLAN will have?
Consider other hosts that calculate address of the target machine using Global ID they themselves receive + Subnet ID and Interface ID that are set up administratively.
 
karhill
just joined
Posts: 18
Joined: Fri Jun 09, 2023 5:21 am
Location: A Pacific Island

Re: How to split dynamic IPv6 pool into subnets

Tue Aug 08, 2023 10:18 pm

If you don't have static IPv6, what does it matter what IPv6 that particular VLAN will have?
Consider other hosts that calculate address of the target machine using Global ID they themselves receive + Subnet ID and Interface ID that are set up administratively.
With a large enough network, hosts would address other hosts with a DNS name. Hosts would update their DNS information as their IP address changed. This does not totally eliminate the need to do some calculation based on the Global ID received + Subnet ID + Interface ID (since you would have to find the local DNS server), but it would reduce the amount of time that you would have to calculate the IPv6 of a service machine.
 
jhbarrantes
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Wed Aug 21, 2019 2:56 pm

Re: How to split dynamic IPv6 pool into subnets

Wed Aug 09, 2023 10:51 am

Subnet ID is managed by RouterOS and you cannot influence its assignment when using from-pool. Currently Option 3 is your only solution, use dhcp-client's script to update prefixes when necessary.

Please create a support request at help.mikrotik.com
Thanks god for clarifying that loud and clear. I was getting mad about it, thinking it could be my error when defining the addreses. I'll try to request that in a support ticket, as I think this having this ability is important. And it shouldn't be hard to implement, as the whole prefix size and the pool prefix lenght are known values, as these are specify in the dhcp-client.
Problem: my provider is delivering prefixes that are not static.
But then why are you creating all these problems for yourself?

How many times a day do you restart your router, continuously?

If you don't have static IPv6, what does it matter what IPv6 that particular VLAN will have?
You're right, and maybe I am overcomplicating myself. It could even come from an IPv4 way of thinking, but it sounds weird to me that you can define the second part of the /64 in the ipv6>address option, but you cannot play with subnetting from a dynamic pool. If that's the case, why not simply give the whole /56 to the pool prefix lengh and start defining interfaces as ::1/64, ::2/64, ::3/64 and so on. I mean, I don't care about the second part of the address, SLAAC will take part of it. But I do care about the first 64 bits and, even when I cannot control the first 56 bytes, that may potentilly change (very unlikely, but it can) I do care about been able to define my own subnet plan and know at a glance if an IP belongs to X vlan or Y vlan, whitout having to go to the router and see the order router as assigned this. Other example is a VPN: why on earth I would do ULA's if I can assign one of these subnets to a wireguard interface and start palying with IPv6 on the tunnel. However, If these IPs will change on subnets, my peer configuration will be broken imediately.
Don't know, maybe you're right and it is just me having an IPv4 thinking leading me to overcomplexity, but it sound reasonable to me to be able to define my own subneetting plan according to the prefix and pool sizes.

With a large enough network, hosts would address other hosts with a DNS name. Hosts would update their DNS information as their IP address changed. This does not totally eliminate the need to do some calculation based on the Global ID received + Subnet ID + Interface ID (since you would have to find the local DNS server), but it would reduce the amount of time that you would have to calculate the IPv6 of a service machine.
Maybe when mikrotik implements a nice and decent DNS service rebump. But right now think this is not possible, correct me if I'm wrong. I would be glad to have a naming based policies and hosts getting track of their IPv6 allocations and updating DNS entries automatically. But right now I don't see this posibility, unless you start playing with scripting, which is really not the target for a home user just wanting to have a couple of vlans with some hosts in it.


Anyway, thanks all everyone for taking some time for anwering, think all points of view are quite valid. It is clear to me that what I'm requesting is not there and, if we want so see that implemented, is is a new feature request. That's all I wantend to confirm.

Cheers!

Who is online

Users browsing this forum: Bing [Bot] and 37 guests