Community discussions

MikroTik App
 
jamesharr
just joined
Topic Author
Posts: 6
Joined: Sun Sep 19, 2021 5:18 pm

Tuning IPv6 valid-lifetime and preferred-lifetime

Sat Nov 19, 2022 9:31 pm

Hi,

I'm using IPv6 prefixes allocated dynamically from a pool, is there anyway to tune the valid-lifetime and preferred-lifetime? I can tweak it for statically configured IPv6 prefixes, but for the dynamic prefixes I can't seem to find an option anywhere. I've also tried looking in the /ipv6/nd settings (both global and per-interface), and there doesn't seem to be an option there. Anywhere else I should look?

My use-case is that my ISP periodically likes to give me a new prefix (annoyingly) and I'd like to shorten the time from 30 days to something more reasonable like 8hr so clients can pick up a new address appropriately. I'm currently managing my addresses with 6rd-on-routeros.rsc (link below)

Console output is below. Let me know if any other information would be helpful.

Thanks in advance!

6rd-on-routeros.rsc - https://github.com/FwMotion/6rd-on-rout ... uteros.rsc

IPv6 prefixes (all dynamic)
[admin@MikroTik] /ipv6/nd/prefix> print
Flags: X - disabled, I - invalid; D - dynamic
 0  D prefix=2602:xx:xxxx:xx00::/64 6to4-interface=none interface=bridge1.100 on-link=yes autonomous=yes valid-lifetime=4w2d preferred-lifetime=1w

 1  D prefix=2602:xx:xxxx:xx01::/64 6to4-interface=none interface=bridge1.600 on-link=yes autonomous=yes valid-lifetime=4w2d preferred-lifetime=1w

 2  D prefix=2602:xx:xxxx:xx02::/64 6to4-interface=none interface=bridge1 on-link=yes autonomous=yes valid-lifetime=4w2d preferred-lifetime=1w

IPv6 ND settings
[admin@MikroTik] /ipv6/nd> print
Flags: X - disabled, I - invalid; * - default
 0  * interface=all ra-interval=3m20s-10m ra-delay=3s mtu=unspecified reachable-time=unspecified retransmit-interval=unspecified ra-lifetime=30m
      ra-preference=medium hop-limit=unspecified advertise-mac-address=yes advertise-dns=yes managed-address-configuration=no other-configuration=no
      dns=""

IPv6 configuration
[admin@MikroTik] /ipv6/nd> /ipv6/address/print
Flags: D - DYNAMIC; G, L - LINK-LOCAL
Columns: ADDRESS, FROM-POOL, INTERFACE, ADVERTISE
 #    ADDRESS                                     FROM-POOL             INTERFACE        ADVERTISE
 0 DL fe80::2ec8:1bff:feff:65c6/64                                      bridge1          no
 1 DL fe80::2ec8:1bff:feff:65c6/64                                      bridge1.600      no
 2 DL fe80::2ec8:1bff:feff:65c6/64                                      bridge1.100      no
 3 DL fe80::44ce:6eff:fef0:be7d/64                                      zt-xxx          no
 4 DL fe80::6432:f8ff:fee4:3175/64                                      zt-yyy-lab      no
 5 DL fe80::7c1d:7eff:fee0:16c5/64                                      zt-zzz  no
 6 DL fe80::2ec8:1bff:feff:65cd/64                                      ether8.201       no
 7 DL fe80::2ec8:1bff:feff:65cd/64                                      ether8           no
 8 DG fd9f:77fc:393e:3c1e:4599:93d0:52ce:8781/88                        zt-xxx          no
 9 DG fdb1:5644:912e:2ccd:7d99:93d0:52ce:8781/88                        zt-yyy  no
10 DG fda0:cbf4:b62a:aae2:6799:93d0:52ce:8781/88                        zt-zzz      no
11 DL fe80::3:6177:7012/64                                              6rd-centurylink  no
;;; managed-by-6rd
12  G 2602:xx:xxxx:xxff::1/64                     pool-6rd-centurylink  6rd-centurylink  no
;;; managed-by-6rd
13  G 2602:xx:xxxx:xx00::1/64                     pool-6rd-centurylink  bridge1.100      yes
;;; managed-by-6rd
14  G 2602:xx:xxxx:xx01::1/64                     pool-6rd-centurylink  bridge1.600      yes
15 DL fe80::200:5efe:6077:7012/64                                       6rd-centurylink  no
;;; managed-by-6rd
16  G 2602:xx:xxxx:xx02::1/64                     pool-6rd-centurylink  bridge1          yes
[admin@MikroTik] /ipv6/nd> /ipv6/address/export
# nov/19/2022 19:27:02 by RouterOS 7.6
# software id = BGHF-WEU6
#
# model = RB5009UG+S+
# serial number = EC1A0E0FE5B0
/ipv6 address
add address=::1 advertise=no comment=managed-by-6rd from-pool=pool-6rd-centurylink interface=6rd-centurylink
add address=::1 comment=managed-by-6rd from-pool=pool-6rd-centurylink interface=bridge1.100
add address=::1 comment=managed-by-6rd from-pool=pool-6rd-centurylink interface=bridge1.600
add address=::1 comment=managed-by-6rd from-pool=pool-6rd-centurylink interface=bridge1

RouterOS build
[admin@MikroTik] /ipv6/nd> /system/resource/print
                   uptime: 4d5h55m4s
                  version: 7.6 (stable)
               build-time: Oct/17/2022 10:55:40
         factory-software: 7.0.4
              free-memory: 787.8MiB
             total-memory: 1024.0MiB
                      cpu: ARM64
                cpu-count: 4
            cpu-frequency: 1400MHz
                 cpu-load: 0%
           free-hdd-space: 972.2MiB
          total-hdd-space: 1025.0MiB
  write-sect-since-reboot: 11931
         write-sect-total: 47819
               bad-blocks: 0%
        architecture-name: arm64
               board-name: RB5009UG+S+
                 platform: MikroTik
 
DarkNate
Forum Veteran
Forum Veteran
Posts: 999
Joined: Fri Jun 26, 2020 4:37 pm

Re: Tuning IPv6 valid-lifetime and preferred-lifetime

Sat Nov 19, 2022 11:21 pm

If your ISP is doing dynamic PD instead of persistent PD, they are intentionally breaking IPv6 specs and in particular SLAAC.

No amount of lifetime value tweaking can fix that other than them fixing their shit and learning BCOP 690.

https://www.6connect.com/blog/is-your-i ... pe-router/
 
Emil66
Frequent Visitor
Frequent Visitor
Posts: 62
Joined: Tue Aug 28, 2018 2:09 am

Re: Tuning IPv6 valid-lifetime and preferred-lifetime

Sun Nov 20, 2022 12:13 am

You can set the default valid and preferred lifetimes which then get applied to dynamic prefixes. In the CLI it's under "/ipv6 nd prefix default" (v6 syntax), in the web GUI it's under "IPv6", "ND", "Prefixes" Tab, "Default" button.
 
dave3
newbie
Posts: 45
Joined: Mon Feb 07, 2022 8:06 am

Re: Tuning IPv6 valid-lifetime and preferred-lifetime

Mon Nov 21, 2022 5:50 pm

^^^ That is correct.

My isp also sometimes changes the prefix. It gives a 3 day lease, but sometimes it just stops working and I need to release the old lease.

/ipv6 nd prefix default
set preferred-lifetime=20m valid-lifetime=12h

That's what I've got it set to. Linux and android clients (using SLAAC) start using the new prefix right away. Windows gets the new prefix but insists on using the old one until the preferred-lifetime times out, so at least it's just 20 minutes. I had the valid-lifetime set lower (like 1 hour), but had trouble with an android client that would lose IPv6 sometimes. It should have received the advertisements in time, but in any case, increasing it seems to have fixed the issue.
 
jamesharr
just joined
Topic Author
Posts: 6
Joined: Sun Sep 19, 2021 5:18 pm

Re: Tuning IPv6 valid-lifetime and preferred-lifetime

Tue Nov 22, 2022 7:58 pm

If your ISP is doing dynamic PD instead of persistent PD, they are intentionally breaking IPv6 specs and in particular SLAAC.

No amount of lifetime value tweaking can fix that other than them fixing their shit and learning BCOP 690.

https://www.6connect.com/blog/is-your-i ... pe-router/
It's actually not PD, it's 6RD. It generates a prefix based off of the ipv4 wan address and generates an IPv6 prefix. The X's in my example would be my v4 wan address encoded in hex. It's then tunneled to a another v4 system that connects into v6 natively.

It's similar to 6in4 except it uses an ISP owned ipv6 prefix, an ISP owned tunnel endpoint. It actually performs pretty well, I can get 900mbps or so through the tunnel.

Yes, it's far from ideal. But it's either 1) fiber and 6rd 2) fiber and no v6 3) double the price for docsis, lower data rates, data caps, and dhcpv6-pd.

Rest assured, I bug them about native support a lot...
 
jamesharr
just joined
Topic Author
Posts: 6
Joined: Sun Sep 19, 2021 5:18 pm

Re: Tuning IPv6 valid-lifetime and preferred-lifetime

Tue Nov 22, 2022 7:59 pm

/ipv6 nd prefix default
set preferred-lifetime=20m valid-lifetime=12h

That's what I've got it set to. Linux and android clients (using SLAAC) start using the new prefix right away. Windows gets the new prefix but insists on using the old one until the preferred-lifetime times out, so at least it's just 20 minutes. I had the valid-lifetime set lower (like 1 hour), but had trouble with an android client that would lose IPv6 sometimes. It should have received the advertisements in time, but in any case, increasing it seems to have fixed the issue.
Thank you! Going to try that this evening

Who is online

Users browsing this forum: anav, sindy and 80 guests