Community discussions

MikroTik App
 
DorianGray
just joined
Topic Author
Posts: 19
Joined: Wed Jan 18, 2012 10:57 pm

Script for he.net IPv6 Tunnelbroker

Mon Oct 08, 2012 3:37 am

Hi everyone, i've updated the IPv6 Dynamic Wan Script out of the Mikrotik Wiki, cause it was not working, i think they changed the api @ Hurricane Elektrik

I was Inspired by:
https://www.tunnelbroker.net/forums/ind ... pic=1994.0
and:
http://wiki.mikrotik.com/wiki/Hurricane ... nt_updater

# Update Hurricane Electric IPv6 Tunnel Client IPv4 address

:local HEtunnelinterface "6to4-TunnelInterfaceName"
:local HEtunnelid "YourTunnelID"
:local HEuserid "YourUserID"
:local WANinterface "WAN-INTERFACE-NAME"
#Don't Use MD5! Paste your Password Plain Text
:local HEpass "yourPassword"
#No Need for Change below this line
:local HEupdatehost "ipv4.tunnelbroker.net"
:local HEupdatepath "/nic/update"

:local outputfile ("HE-" . $HEtunnelid . ".txt")

# Internal processing below...
# ----------------------------------
:local HEipv4addr

# Get WAN interface IP address
:set HEipv4addr [/ip address get [/ip address find interface=$WANinterface] address]
:set HEipv4addr [:pick [:tostr $HEipv4addr] 0 [:find [:tostr $HEipv4addr] "/"]]

:if ([:len $HEipv4addr] = 0) do={
   :log error ("Could not get IP for interface " . $WANinterface)
   :error ("Could not get IP for interface " . $WANinterface)
}

# Update the HEtunnelinterface with WAN IP
/interface 6to4 {
   :if ([get ($HEtunnelinterface) local-address] != $HEipv4addr) do={
      :log info ("Updating " . $HEtunnelinterface . " local-address with new IP " . $HEipv4addr . "...")
      set ($HEtunnelinterface) local-address=$HEipv4addr
   }
}

:log info ("Updating IPv6 Tunnel " . $HEtunnelid . " Client IPv4 address to new IP " . $HEipv4addr . "...")
/tool fetch mode=http \
                  host=($HEupdatehost) \
                  url=("http://" . $HEupdatehost . $HEupdatepath . \
                          "?username=" . $HEuserid . \
                          "&password=" . $HEpass . \
                          "&hostname=" . $HEtunnelid . \
                          "&myip=" . $HEipv4addr) \
                  dst-path=($outputfile)

:log info ([/file get ($outputfile) contents])
/file remove ($outputfile)
I Know, i only updated the script, and it's not Perfect (no https!!!), but it worked for me :)

(Script was testen on RB750 @ROS 5.20 with IPv6 )
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Script for he.net IPv6 Tunnelbroker

Mon Oct 08, 2012 8:44 am

can you tell what did not work? Maybe I can update article you are mentioning with your updated version?
 
DorianGray
just joined
Topic Author
Posts: 19
Joined: Wed Jan 18, 2012 10:57 pm

Re: Script for he.net IPv6 Tunnelbroker

Wed Oct 10, 2012 9:14 pm

 
jkomar
just joined
Posts: 2
Joined: Tue Jul 24, 2012 5:19 am

Re: Script for he.net IPv6 Tunnelbroker

Mon Oct 15, 2012 5:55 am

Do you need to set a scheduler on this? If so, how often do you recommend?

Thanks,
Jason
 
DorianGray
just joined
Topic Author
Posts: 19
Joined: Wed Jan 18, 2012 10:57 pm

Re: Script for he.net IPv6 Tunnelbroker

Fri Oct 19, 2012 2:55 am

i run this script every 15 Minutes!

i depens how ofen your ip changes!
 
User avatar
THG
Member
Member
Posts: 472
Joined: Thu Oct 15, 2009 1:05 am

Re: Script for he.net IPv6 Tunnelbroker

Mon Mar 10, 2014 11:48 pm

can you tell what did not work? Maybe I can update article you are mentioning with your updated version?
The following lines has been changed from the script in MikroTik Wiki. The password must be specified in plain text instead of an md5 checksum.

:local HEupdatepath "/nic/update"
                          "?username=" . $HEuserid . \
                          "&password=" . $HEpass . \
                          "&hostname=" . $HEtunnelid . \
                          "&myip=" . $HEipv4addr) \

Original script from MikroTik Wiki.

http://wiki.mikrotik.com/wiki/Hurricane ... nt_updater
 
User avatar
dgonzalezh
Trainer
Trainer
Posts: 40
Joined: Wed Jun 05, 2013 9:39 am
Location: Colombia
Contact:

Re: Script for he.net IPv6 Tunnelbroker

Tue Oct 27, 2015 7:59 pm

can you tell what did not work? Maybe I can update article you are mentioning with your updated version?
Janis,

Sorry to jump in on this old post, but it is definitely the only script that worked for my on v6.32 (v6.x), I tried both of them at the wiki with no luck.

I wanted to register at the wiki and copntribute but it's not possible to open an account, but if you could update the wiki article with this script it'd be great.

the issue is
:local HEupdatehost "ipv4.tunnelbroker.net"
:local HEupdatepath "/nic/update"
Also you have to use the TunnelID and your account password.

Thanks
 
savage
Forum Guru
Forum Guru
Posts: 1263
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Script for he.net IPv6 Tunnelbroker

Tue Oct 27, 2015 11:34 pm

You don't need to update the HE.NET side of the tunnel (on their web site) any more.

Only needed to update the local IP on the tunnel interface on your RB, and the tunnel will come up. HE somehow automatically detects the IP changed and updates their end without intervention.
 
volkirik
Member Candidate
Member Candidate
Posts: 208
Joined: Sat Jul 23, 2016 2:03 pm

Re: Script for he.net IPv6 Tunnelbroker

Mon Jul 25, 2016 4:24 pm

You don't need to update the HE.NET side of the tunnel (on their web site) any more.

Only needed to update the local IP on the tunnel interface on your RB, and the tunnel will come up.  HE somehow automatically detects the IP changed and updates their end without intervention.
unfortunately this is partially wrong. Tunnel will come up, BUT traffic from HE.net server will be routed to old IPv4 address.
without IPv4 update to HENET server, I am unable to receive ping response or anything else. maybe they had to rechange this to prevent abuse or security breach
they should require this, as you do not use username/password or VLAN to connect the servers.
Relays of Local ISPs (like Comcast) with local anycast address may not require configuration.
for your info

Who is online

Users browsing this forum: No registered users and 10 guests