LogoLogo
  • RouterOS Scripts
  • Scripts
    • Forward log messages via notification
    • Mode button with multiple presses
    • Import SSH keys
    • Act on received SMS
    • Install LTE firmware upgrade
    • Visualize OSPF state via LEDs
    • Use wireless network with daily psk
    • Find and remove access list duplicates
    • Create DNS records for DHCP leases
    • Manage remote logging
    • Forward received SMS
    • Collect MAC addresses in wireless access list
    • Notify about health state
    • Update configuration on IPv6 prefix change
    • Renew certificates and notify on expiration
    • Renew locally issued certificates
    • Upload backup to server
    • Play Super Mario theme
    • Manage IP addresses with bridge status
    • Notify on LTE firmware upgrade
    • Run scripts on ppp connection
    • Run other scripts on DHCP lease
    • Update GRE configuration with dynamic addresses
    • Manage system update
    • Manage LEDs dark mode
    • Upload backup to Mikrotik cloud
    • Send GPS position to server
    • Rotate NTP servers
    • Manage ports in bridge
    • Update tunnelbroker configuration
    • Notify on host up and down
    • Notify on RouterOS update
    • Send notification with early errors
    • Use WPA2 network with hotspot credentials
    • Send backup via e-mail
    • Run rolling CAP upgrades from CAPsMAN
    • Wait for configuration und functions
    • Download packages for CAP upgrade from CAPsMAN
    • Comment DHCP leases with info from access list
  • Initial commands
  • COPYING
Powered by GitBook
On this page
  • Description
  • Requirements and installation
  • Configuration
  • See also

Was this helpful?

  1. Scripts

Update configuration on IPv6 prefix change

PreviousNotify about health stateNextRenew certificates and notify on expiration

Last updated 4 years ago

Was this helpful?

Description

With changing IPv6 prefix from ISP this script handles to update...

  • ipv6 firewall address-list

  • 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:

/ ipv6 dhcp-client add add-default-route=yes interface=ppp-isp pool-name=isp request=prefix script=ipv6-update;

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:

/ ipv6 address add from-pool=isp interface=br-local;

Sometimes dhcp client is stuck on reconnect and needs to be released. Installing may solve this.

Configuration

An address list entry is updated with current prefix and can be used in firewall rules, comment has to be "ipv6-pool-" and actual pool name:

/ ipv6 firewall address-list add address=2003:cf:2f0f:de00::/56 comment=ipv6-pool-isp list=extern;

As this entry is mandatory it is created automatically if it does not exist, with the comment also set for list.

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:

/ ipv6 firewall address-list add address=2003:cf:2f0f:de01::/64 comment="ipv6-pool-isp, interface=br-local" list=local;

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:

/ 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;

See also

◀ Go back to main README
ppp-on-up
Run scripts on ppp connection
◀ Go back to main README
▲ Go back to top