Network Primer Part II -Submitted by UNSTABLE
--------------------------------------------------------------------------------
Router Features
Ports
First lets talk about ports for a second so that nobody gets left out. An IP address is comparable to a street address. You go to a specific address, but what is happening inside? Different stuff could be happening in different rooms. In one room there might be people playing Doom 3, in another room people listening to music or watching movies, in still another room people are chatting and trading items. So think of a computer’s IP address as a street address / house with thousands upon thousands of rooms. Many of the rooms could be empty, but some of the rooms have stuff happening on them.
Ports. Ports are the rooms in the house. When you open a web-browser and go to abit forums, you are talking to 65.123.7.5 on port 80, which is the standard for HTTP traffic. Here’s a pretty thorough listing of possible ports on a computer:
http://www.iana.org/assignments/port-numbersThat is by no means complete, but it should give you an idea of the numbers of ports on a computer and the possible number of services that could be running. Keep in mind that the IANA listing of ports is the DEFAULT ports those services use. Many applications allow you to configure them on different ports. I am sure you’ve come across a website or two that ran on port 8080 or 81.
Port Forwarding
For the most part, we’ve talked about sitting behind a router and going OUT to the internet. But what if you are one of those crazy individuals who want to allow people on the internet IN to your network? Maybe to host games, maybe to run a website or FTP…could be any number of things.
Well that’s where port forwarding comes in. If you recall, NAT is a one to many relationship. You have ONE REAL IP ADDRESS but you could have 100 computers connecting to the internet on that IP address. So when inbound traffic comes down on your public IP 1.23.34.55, what does your router do with it? Send it to one computer? Send it to all computers? Actually by default, most routers discard the incoming packet, because it doesn’t know what to do with it.
But if you setup port forwarding, you are TELLING the router what to do with specific traffic that meets certain criteria.
I’m not going to get into the specifics of how to configure your particular router for port forwarding. There is going to be differences from manufacturer to manufacturer and model to model. The important thing is that you understand how it works and you will be able to configure nearly any make and model yourself.
Usually the router has a place to define the port or ports you want forwarded to the internal host. You must research the necessary ports for your particular service. If the service requires many spread out ports, your router may require that you make several entries to forward those ports. You must define the PORT(s) and the INTERNAL PRIVATE IP ADDRESS of the computer offering the service.
Let’s flash back to DHCP for a second, here’s where it might be important to disable DHCP on the host offering the services. The reason behind this is, the router does not have the ability to dynamically update the port forwarding aspect of the configuration.
Quick example:
quote:
--------------------------------------------------------------------------------
PUBLIC IP ADDRESS: 1.23.45.55 (on router)
INTERNAL HOST: 192.168.1.100
-Internal host is going to be offering web services on port 80 to the internet.
-Clients will point their browser toward 1.23.45.55 to access the webpage
-The router is configured to forward ALL PORT 80 incoming traffic to 192.168.1.100
-Yesterday everyone was able to access the webpage and everything was functioning correctly
-The configuration has NOT changed since yesterday but clients are unable to access the page…what is the problem?
Problem
-You review your router configuration and see that all port 80 traffic is forwarding to 192.168.1.100 which is how you configured it.
-You immediately sit down at your Web Server and do an IPCONFIG /ALL
-The IP address has changed to 192.168.1.101
--------------------------------------------------------------------------------
This is a very real possibility if you have more than one host on your internal network. The router is going to hand out IP addresses as needed, different internal hosts will get different IP addresses from day to day. This is the reason why I recommend using static IP addresses if you have a small number of hosts or if you are hosting services for the internet.
Let’s run through another quick example of a possible problem you may encounter while providing services to the internet:
quote:
--------------------------------------------------------------------------------
-Yesterday you configured a static internal address on your webserver, you setup port forwarding on the router and made a note of the PUBLIC IP address which was 1.23.45.55
-You provided all of your friends with this address 1.23.45.55 and they were able to connect to the web server and see the web pages without problems.
-Today you have received several emails from your friends stating that they receive an error when they attempt to connect to the server. What is the problem?
Problem
-You check to ensure the webserver is running. You review the IP address which is static because you listened to unstable. You check port forwarding on the router and it matches the ports needed and the address of the internal host. You scratch your head.
-You then check the PUBLIC IP ADDRESS on the router which is issued by the ISP DHCP server, the address reads: 1.22.45.45
-You quickly realize that your friends are going to a different address and probably setting off the guys firewall 1.23.45.55 was your address from yesterday, your address has changed because your DHCP lease expired.
Contact the author of this guide >> UNSTABLE >>
http://testmy.net/forum/index.php?action=pm;sa=send;u=598