2020-03-27 21:47:13 +01:00
Update configuration on IPv6 prefix change
==========================================
2024-03-06 14:30:18 +01:00
[](https://github.com/eworm-de/routeros-scripts/stargazers)
[](https://github.com/eworm-de/routeros-scripts/network)
[](https://github.com/eworm-de/routeros-scripts/watchers)
2025-02-07 17:39:48 +01:00
[](https://mikrotik.com/download/changelogs/)
2024-03-06 14:30:18 +01:00
[](https://t.me/routeros_scripts)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick& hosted_button_id=A4ZXBD6YS2W8J)
2023-01-10 14:45:27 +01:00
[⬅️ Go back to main README ](../README.md )
2020-03-27 21:47:13 +01:00
2022-02-12 13:05:56 +01:00
> ℹ ️ **Info**: This script can not be used on its own but requires the base
2022-02-11 23:34:39 +01:00
> installation. See [main README](../README.md) for details.
2021-05-03 15:07:50 +02:00
2020-03-27 21:47:13 +01:00
Description
-----------
With changing IPv6 prefix from ISP this script handles to update...
2023-02-09 22:42:02 +01:00
* ipv6 firewall address-list (prefixes (`/64` ) and host addresses (`/128` ))
2020-03-27 21:47:13 +01:00
* dns records
Requirements and installation
-----------------------------
Just install the script:
$ScriptInstallUpdate ipv6-update;
Your ISP needs to provide an IPv6 prefix, your device receives it via dhcp:
2022-05-11 10:07:33 +02:00
/ipv6/dhcp-client/add add-default-route=yes interface=ppp-isp pool-name=isp request=prefix script=ipv6-update;
2020-03-27 21:47:13 +01:00
Note this already adds this script as `script` . The pool name (here: "`isp` ")
is important, we need it later.
Also this expects there is an address assigned from pool to an interface:
2022-05-11 10:07:33 +02:00
/ipv6/address/add from-pool=isp interface=br-local;
2020-03-27 21:47:13 +01:00
Sometimes dhcp client is stuck on reconnect and needs to be released.
Installing [ppp-on-up ](ppp-on-up.md ) may solve this.
Configuration
-------------
2024-10-22 22:35:14 +02:00
As an address-list entry is mandatory a dynamic one is created automatically.
It is updated with current prefix and can be used in firewall rules.
Alternatively a static address-list entry can be used, where comment has to
be "`ipv6-pool-` " and actual pool name. Use what ever list is desired, and
create it with:
2020-03-27 21:47:13 +01:00
2022-05-11 10:07:33 +02:00
/ipv6/firewall/address-list/add address=2003:cf:2f0f:de00::/56 comment=ipv6-pool-isp list=extern;
2020-03-27 21:47:13 +01:00
2024-10-22 22:35:14 +02:00
If the dynamic entry exists already you need to remove it before creating
the static one..
2020-12-18 09:59:13 +01:00
2020-12-18 10:11:18 +01:00
Address list entries for specific interfaces can be updated as well. The
interface needs to get its address from pool `isp` and the address list entry
has to be associated to an interface in comment:
2022-05-11 10:07:33 +02:00
/ipv6/firewall/address-list/add address=2003:cf:2f0f:de01::/64 comment="ipv6-pool-isp, interface=br-local" list=local;
2020-12-18 10:11:18 +01:00
2023-02-09 22:42:02 +01:00
Updating address list entries with host addresses works as well, the new
prefix is combinded with given suffix then:
/ipv6/firewall/address-list/add address=2003:cf:2f0f:de01:e3e0:f8fa:8cd6:dbe1/128 comment="ipv6-pool-isp, interface=br-local" list=hosts;
2020-03-27 21:47:13 +01:00
Static DNS records need a special comment to be updated. Again it has to
start with "`ipv6-pool-` " and actual pool name, followed by a comma,
"`interface=` " and the name of interface this address is connected to:
2022-05-11 10:07:33 +02:00
/ip/dns/static/add address=2003:cf:2f0f:de00:1122:3344:5566:7788 comment="ipv6-pool-isp, interface=br-local" name=test.example.com ttl=15m;
2020-03-27 21:47:13 +01:00
See also
--------
* [Run scripts on ppp connection ](ppp-on-up.md )
---
2023-01-10 14:45:27 +01:00
[⬅️ Go back to main README ](../README.md )
[⬆️ Go back to top ](#top )