Tuesday, June 26, 2007

Setting up a Mac Server behind a Router

http://homepage.mac.com/car1son/static_port_fwd_intro.html

etting up a Mac Server behind a Router

This is a guide to setting up your home network with a Cable/DSL Router (Wireless or Wired) so you can run a server that's accessible from outside your home through the internet.

I've tried wherever possible to make this information applicable to a wide range of home network routers, using specific examples from the LinkSys router and Apple Airport Base Station that I use myself. You can also find lots of other useful information on the subject at this site.

The basic procedure, covered in detail with screenshots on the pages that follow, is to start the server on a Mac, set the Mac to a fixed IP address, configure the Router to forward the correct service port(s) to that IP address, determine the public IP Address of your network, and then connect to it.


What's the Problem?

Setting up a service on a Mac, such as Personal File Sharing, FTP, web server, or remote access, so that it can be accessed from elsewhere the internet requires a few tricks.

The basic problem is that your Router is controlling all your external internet connections. It will need some geeky instructions about what to do when it gets a request from the internet so it will pass it on to the Mac.

Consider the 4-computer home LAN illustrated on the right-hand side of this picture:

LinkSys Router NAT Diagram

There are four computers on this LAN. Each computer is uniquely identified by an IP Address, which is the four-part number used by the internet to uniquely identity every computer. (In this example, these are 192.168.1.101, 192.168.1.102, etc.) But these IP Addresses are only Private (or "local"); They are only valid on your local LAN (also called your sub-network). They identity your computers to each other and to the Router, but not to the internet. Furthermore, if you used the simplest way to connect your computers and used DHCP (the Dynamic Host Configuration Protocol, which automatically assigned computers on the network an IP address as they join), these IP addresses were assigned dynamically by the router and can change with time.

Your ISP has assigned your network a unique Public IP Address (or external IP address), which is how other systems on the internet identity the (In this example, this is 66.167.43.161.) Also, if your ISP uses PPPoE (common for DSL providers) or DHCP (common for Cable providers) for your internet service, that IP Address can change over time, too.

(Your Router actually has two IP Addresses, one that it's been assigned on the WAN port and uses with the internet, which is how the internet sees your home; and, one IP Address that it uses locally on your LAN and WiFi ports, which is how your home computers know it. On this LinkSys-based network, the LAN side knows the Router as 192.168.1.1.)


0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home