Matt Coneybeare


Getting Home With a Dynamically Allocated IP

| Comments

I recently had my Comcrap Cable shut off for downloading too much. Apparently, my ‘unlimited’ service did not protect me at all because I use cable. Basically, since the whole neighborhood shares one main cable connection, if I ‘overuse’ bandwidth, I am affecting other peoples service too. Its better anyway… AT&T DSL is faster in my dense neighborhood anyway.
The only problem I had to deal with after the switch was getting back into my Server at home. Comcrap uses a dynamic IP, but it only changes once… if ever. AT&T changes your IP several times a week. If I want to access my home machine and the IP has changed, I have no way to do so until I get home. There are services you can pay for that will monitor your external IP and such and such, but I wanted an easier way out. I setup my home machine to send its IP out and store it on another server, then I setup an alias from my laptop to read that server:
On the Home Server (

curl > /tmp/homeip.txt
scp /tmp/homeip.txt server_username@example_server:/path/to/homeip.txt
rm /tmp/homeip.txt
A cronjob setup on the Home Server:
0,15,30,45 * * * * /Content/Other/Scripts/
This calls my script every 15 minutes. The script gets the IP from, writes it to a temp file, sends the temp file to my server and then deletes the temp file. I also setup a alias on my remote machine that reads this file and lets me ssh back home!
alias home='ssh home_username@`curl`'
I sent my homeip.txt file to a webserver so I use curl to read it, but you can use whatever you want in your alias to read that file.
I hope this helped somebody… there may be better ways but this works and takes 5 lines.


My name is Matt Coneybeare, I design and develop for the web, iOS (iPhone, iPad and iPod Touch), and MacOS out of New York City. In 2008 I started a software company called Urban Apps that has made some pretty popular apps such as Ambiance and Hourly News. In 2019, I joined the team at Ticket Evolution as a Senior Software Engineer. My current Stack Overflow reputation is about 27k.

I was a Rockstar a decade ago, but then went back to school and collected a Bachelor's Degree in Computer Science from U.C. Berkeley and a MBA from Quantic. Now I am settled down with my beautiful wife Di and our dog Hamachi. When not at my desk, I love exploring New York City as a Yelp Elite, or training for marathons.

Contact information

Matt Coneybeare