• Welcome to Hurricane Electric's IPv6 Tunnel Broker Forums.

Am I out of luck, with a dynamic public IP address from my ISP??

Started by jason404, November 14, 2010, 08:38:20 PM

Previous topic - Next topic

jason404

I would like to be able to use IPv6 using the HE tunnelling service.

The problem I have is that I have not got a static IP address from my ISP, and getting one is not possible on the service I am on.  I do not want to change my ISP, as it is very fast and quite cheap (British Telecom "Infinity" VDSL 40/10 Mbit).

So, with a dynamic public IPv4 IP address, which changes every time the VDSL modem is rebooted, can I use this IPv6 tunnelling service?

Cheers.

jimb

Yes.  HE has a facility to automatically change your source IPv4 for the tunnel.  Search around the forum a bit and you'll see some scripts that do this for various OSes.

jason404

Ah, thanks jimb - that is good news.

But all I could find was a Perl IP updater script.  I don't really want to install Perl just for this, as I have no intention of learning it.  I am learning Python though, but I cannot find any Python scripts.

I'm running a Tomato powered router.  It can can send IP updates to various DDNS services.  It would be really nice if it would work for HE IPv6 tunnelling - or maybe OpenDNS's DNS-O-Matic updater client.

Is there anything apart from this Perl script?  I'm running Linux and Windows servers.

jimb

HE doesn't use DNS to look for the IP.  It requires you to actively update the source IP through the web interface.  if you can't find a Python script, it'd be a good way to learn it.  :P

Azendale

Would bash work for you? I made myself a small script that I run once a minute from cron that checks to see if the ip is the same as it was the last time it checked and updates it if it isn't. Since this is only the second or third bash script that runs like a program, it's probably not perfect, but it seems to do the job. Hopefully it helps.

#!/bin/bash
#(C) 2010 Erik B. Andersen This script is licensed under the GPLv3 or later,
# as published by the Free Software Foundation at http://www.gnu.org/licenses/ .
####Set these for each different tunnel########
pass="JoDeeBt"
user_id="5935c15d55c0a1b2ec6e74f23746a7"
tunnel_id="55781"
ip_file_location="/home/bjorn/ipv6/ip4"
####Past here doesn't need to be changed######

if ( [ -e "${ip_file_location}" ] && [ -f "${ip_file_location}" ] ); then
   lastip=$(cat $ip_file_location)
else
   lastip=""
fi

ip=$(wget checkip.dyndns.org -O - -o /dev/null | grep -o -P "([0-9]{1,3}\.){3}[0-9]{1,3}"|tee ${ip_file_location})
echo ${lastip}
echo ${ip}

if ( [ -z "$lastip" ]  || ( ( ! [ -z "$ip" ] )  && [ "$lastip" != "$ip" ]  ) ); then
       echo "IPv6 Tunnel update:"
       wget "https://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=AUTO&pass=$(echo -n "${pass}" | md5sum | grep -o -E "[0-9a-fA-F]{32}")&user_id=${user_id}&tunnel_id=${tunnel_id}" -O - -o /dev/null --no-check-certificate
   else
       echo -n "#"
   fi

jason404

@jimb
That's a good idea for a leaner project actually.  I might give it a try soon.

@Azendale
Thanks, that looks ideal - better than a Python script in fact, as I can run it on my Tomato router.  It uses dash instead of bash though.  Do you know if your script will run in dash or would it require modification?  I think I should be able to add wget to the flash memory, although contstantly writing files to it may not be a good idea.  I could connect a 2.5" HDD to it I suppose.

kcochran

You should be able to ditch all the other file writes, except for the wget line.  With the ipv4b=AUTO option, it uses the IP you're connecting from as the new endpoint.  No need to go query some other site to find out who you are.

allen4names

This may be worse than you think. I ended up with a 'new' IPv4 address in mid-session. The internet LED went out on my router/modem and when it came back on I had lost my tunnel connection. You may take this as a sign that crunch time has arrived for IPv4.

jason404

But ISPs would already have a certain amount of IPv4 addresses already allocated to them, wouldn't they?  I'm sure British Telecom will have enough for their customers well after the last addresses have been allocated.

cholzhauer

Quote from: jason404 on November 23, 2010, 11:07:09 PM
But ISPs would already have a certain amount of IPv4 addresses already allocated to them, wouldn't they?  I'm sure British Telecom will have enough for their customers well after the last addresses have been allocated.

Maybe.  It depends on how soon RIPE runs out of addresses and how many more customers BT is going to pick up.  If BT can only get 1,000 more IPv4 addresses and pics up 1,001 customers, someone is out of luck.

Azendale

Quote from: kcochran on November 15, 2010, 05:14:56 PM
You should be able to ditch all the other file writes, except for the wget line.  With the ipv4b=AUTO option, it uses the IP you're connecting from as the new endpoint.  No need to go query some other site to find out who you are.
I guess I'm used to working with freedns.afraid.org. They have dynamic dns that updates much like the tunnel endpoint. However, if you update your IP when it doesn't need to be updated too many times, they don't like it. So I wrote the script to not do that, thinking there might be a similar restriction on updating the tunnel endpoint.

As far as dash vs bash, I'm not sure. I guess you could just try it. If there was a syntax problem, I bet it would be in the conditional parts, which you don't need if you aren't trying to avoid updating the tunnel endpoint when you have the same IPv4 address.

Sorry I didn't reply sooner, I didn't realise someone responed to my post (I kind of thought I would get emailed if someone did, but I probably have to subscribe to the thread or something). 

kcochran

Quote from: Azendale on December 12, 2010, 11:50:06 AM
I guess I'm used to working with freedns.afraid.org. They have dynamic dns that updates much like the tunnel endpoint. However, if you update your IP when it doesn't need to be updated too many times, they don't like it. So I wrote the script to not do that, thinking there might be a similar restriction on updating the tunnel endpoint.

It checks if it's the same IP before doing any real work.  If it's already the IP, it just bails out quickly.  Not a big deal.

Azendale

Ok, so if we don't have to check to see if we have the same IP, here's a simplified version. I changed the first line to /bin/dash and it worked with dash, but it will also work with bash.
#!/bin/dash
#(C) 2010 Erik B. Andersen This script is licensed under the GPLv3 or later,
# as published by the Free Software Foundation at http://www.gnu.org/licenses/ .
####Set these for each different tunnel########
pass="JoDeeBt"
user_id="5935c15d55c0a1b2ec6e74f23746a7"
tunnel_id="55781"
####Past here doesn't need to be changed######
wget "https://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=AUTO&pass=$(echo -n "${pass}" | md5sum | grep -o -E "[0-9a-fA-F]{32}")&user_id=${user_id}&tunnel_id=${tunnel_id}" -O - -o /dev/null --no-check-certificate

SimonH

Quote from: jason404 on November 23, 2010, 11:07:09 PMBut ISPs would already have a certain amount of IPv4 addresses already allocated to them, wouldn't they?  I'm sure British Telecom will have enough for their customers well after the last addresses have been allocated.
Cases like this are absolutely nothing to do with address availability - after all, with "always on" services like this, a customer will always be using "an" address even if that address keeps changing.

Put simply, this is the marketing idiots running the show. They've decided that the only reason for having a static address is to run servers (which they don't want you to do), and that they can charge extra for different products to people who want static addresses (we've customers paying £5/mo for one static address !). In summary, the reason some ISPs force you to have a dynamic address is to fleece a fraction of them for more dosh.

Fortunately, there are more enlightened ISPs for ADSL services, and it will even apply to VDSL services in time (I'm sure some ISPs will be looking into it).