IPv6 TunnelBroker.com Routeros Scripts

helogo

Most users/companies in China are using dynamitic IP address, and I wrote the script to update IP address to TunnelBroker automatically in RouterOS system.

#Auto update IP4to6 client IP address

#Script By Vincent Qiu 20121213

#http://ipv4.tunnelbroker.net/nic/update\?username= &password= &hostname=nov30th-3.tunnel.tserv3.fmt2.ipv6.he.net

:delay 30

:loc heuser "[username]"

:loc hepass "[password]"

:loc hetunnelid "[tunnel id]"

:loc debug true

:loc localPPPOEAddress [/ip ad g [/ip ad f interface=pppoe-out1] ad]

:loc localPPPOEAddress [:pick $localPPPOEAddress 0 [:fin $localPPPOEAddress "/"]]

:if (debug) do={:log warning ("PPPOE Address:".$localPPPOEAddress)}

:loc localInterfaceSitLocalIP [/in 6 g [/in 6 fin name=sit1] lo]

:if (debug) do={:log warning ("Sit Local Address:".$localInterfaceSitLocalIP)}

:if ($localPPPOEAddress != $localInterfaceSitLocalIP) do={

:log warning ("IP address changed, updated from ".$localInterfaceSitLocalIP." to ".$localPPPOEAddress)

/in 6 s sit1 local-address=$localPPPOEAddress

:delay 3

/too fe url="http://ipv4.tunnelbroker.net/nic/update\?username=$heuser&password=$hepass&hostname=$hetunnelid

d="ipv6ddns_result.txt"

}

This script helps you to update the IP to tunnelbroker side automatically, it will update the IP the address of pppoe-out1 interface, you can change it to the interface you want.

Dynamitic Interface Name in script: pppoe-out1

IP6to4 Interface Name in script: sit1