Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Raspberry Pi which connects to my Airport Extreme via DHCP. The Airport is connected to my Cable Modem which gets its IP address via DHCP from Comcast. I would like to be able to address the RPi from a remote location via a domain name that I've registered. I understand that I would use Dynamic DNS to do this, but I'm not sure how to deal with multiple layers of DHCP.

share|improve this question

If the cable modem is a simple modem, the only address that counts is the EXTERNAL address it gets from Comcast. This is the one that the rest of the world see.

Anyone connecting to the Pi will still only be able to see that one address and so you need a device that can do Network Address Translation (NAT).

A simple modem won't be able to do this, but if the "modem" is really a router then it will have one or more pages on it's configuration website for setting things like "Virtual Servers", NAT and port forwarding (the names change depending on the manufacturer).

If the modem wont do it, perhaps the Airport will. Either way, the easiest configuration to deal with is to make sure that both the internal address(s) of the modem and those delivered by the Airport are in the same range. So if the modem delivers an internal address(s) such as 192.168.1.x, with a netmask of which is fairly typical - make sure that the Airport is delivering DHCP addresses in the same set of 255 addresses. Just make sure they don't overlap. You will also need to configure the address of the Pi as a fixed address. Good routers such as my Billion 7800N can do this with DHCP, with cheap routers you will need to give the Pi a fixed address that doesn't clash with the DHCP addresses.

At home, for example, I have a router that gives me both wired and wireless networks plus a Wi-Fi access point that delivers a second wireless network. I've set the router's DHCP to deliver - .150 and the Wi-Fi access point to deliver - .199 both with a netmask of so that any device on the internal network can route to any other. I have a number of devices that may act as servers and are given a fixed DHCP address based on their MAC address.

When you've sorted that, configure the "modem", assuming it is really a router (you'll have to try and get the Airport to do this otherwise or configure a PC as a router) to forward requests to your external IP address and a convenient port (e.g. 8080) to the internal address and port of the Pi's service you want to access (e.g. port 22 for SSH).

However, there is one further problem. It may well be that Comcast don't actually give you a fixed external IP address! If that is the case, that's when you will need to set up a Dynamic DNS forwarder. Most decent routers have this built in now. You set up a connection from your router to your chosen Dynamic DNS service and the router updates the service when your external IP address changes.

To configure your purchased domain to use dynamic addressing, instead of pointing the domain name at an IP address as you normally would, you point it that the address provided by the dynamic DNS service. Your DNS service provider should have details.

Wow, that was a rambling answer! Hope it makes some sense. Bottom line is that, it is fairly easy to do if you have a decent router, use a consistent internal IP address range for both router and wi-fi and sign up to a Dynamic DNS service such as NoIP or Dyndns, etc.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .