Jump to content

Recommended Posts

Posted

I have a cheapo ADSL deal. I think it has just one IP, for the router. (the subnet ends in 255).

Any chance of NAT-server-mapping a port through to a PC on the LAN? This would be easy if I had several IP's to assign, but I don't. Just want to run a little web server for testing purposes.

If not possible then does anyone know if TOT offers extra IP's on their cheapo ADSL plans?

Cheers,

Chanchao

Posted

i guess canchao already has the adsl/router box im not sure of his setup...

maybe some elobaration would help...what model numbers...

i guess if u already have a router, its likely to support NAT which u could configure to forward port 80 to your computer....

Posted

> maybe some elobaration would help...what model numbers...

Yeah, have the router, I'm set up, it works.. I'm just wondering about the principle: if you have just one IP for the router, can you then map it to a server on the LAN that runs some kind of service (web, ftp, etc.). Let's assume the router supports NAT and server mapping.

Cheers,

Chanchao

Posted

ok..

lets say your WAN IP is 61.1.1.1 and your server is 192.168.0.5.

u wanna run a web server(normally port 80) on 192.168.0.5 to be accessible by the public outside of your lan...

u gotta go to the router's configuration....

go to the NAT or port forwarding or virtual server(name depends on model) page...

u set up forwarding....choose port 80, type in the server IP as 192.168.0.5 , now if someone tries to access 61.1.1.1 on thier web browser, the router sends the request to port 80 on 192.168.0.5(yr server)

now u need to set up port forwarding for the various servers u wanna host...

one port cant be forwarded to more than one computer on your lan...

the WAN IP is always mapped to the router. its NAT feature which simply forwards some pre-defined ports to a computer. access to un defined ports will be not possible....so the router acts as a firewall too...

Posted

If I remember correctly, either (or both) TOT or TT&T's adsl packages use private IPs. In that case, there's nothing you can do about setting up your own server.

Posted

Partially correct.. One of my routers has a built in Dyndns system.. Set up an account with them and every time the ISP releases the IP for the router it then automatically informs the router which in turn updates dyndns..

This way your web address of webaddress.dyndns.com stays valid continiously without user intervention..

However running a webserver on port 80 in the network makes web surfing / skype etc difficult because of port 80 packets not intended for the webserver but intended for the browsing computer..

Posted
Partially correct.. One of my routers has a built in Dyndns system.. Set up an account with them and every time the ISP releases the IP for the router it then automatically informs the router which in turn updates dyndns..

This way your web address of webaddress.dyndns.com stays valid continiously without user intervention..

However running a webserver on port 80 in the network makes web surfing / skype etc difficult because of port 80 packets not intended for the webserver but intended for the browsing computer..

i disagree...

port 80 packets packets are intended for the webserver.

its not the port of the browder or anything, but the port on the webserver.

when u type google.com in yr browser, the browser connects to the port 80 on the server which hosts google.com. 80 is not the port of your browser.

Posted

hmmm ok (about to show my ignorance).. Then what port would incoming packets be routed at (in a web scenario)..

I had assumed incoming data packets would be on port 80 for web (http) traffic ?? Also I had read thats how Skype communicates in thier whitepapers..

My thinking was that your inbound traffic would be directed to the webserver..

Posted

incoming packets....im not sure...

probably it generates rangom unused ports for incoming connections...im not sure....

but one thing i know for sure...

seting up a webserver on your lan...redirecting the port 80 to the server wont cause any interuptions in web browsing of the server or any other person in the lan...

the port 80 or sometimes 8080 is always the target port your browser connects to port 80 of the server......i dunno abt what port the browser uses for the incoming/outgoing connections...

Posted
hmmm ok (about to show my ignorance).. Then what port would incoming packets be routed at (in a web scenario)..

I had assumed incoming data packets would be on port 80 for web (http) traffic ?? Also I had read thats how Skype communicates in thier whitepapers..

My thinking was that your inbound traffic would be directed to the webserver..

hey i got yr answer now.

i did a "netstat -n" on the command prompt, here is a lil bit from the results.

 TCP    172.16.x.y:3615    69.93.a.25:80        TIME_WAIT
 TCP    172.16.x.y:3632    b.115.2.144:80       TIME_WAIT
 TCP    172.16.x.y:3640    83.z.101.146:80      ESTABLISHED
 TCP    172.16.x.y:3644    69.93.a.25:80        ESTABLISHED

the first IP must be my local LAN and the second the IP of the wabsites im viewing../.

u see the second one has the port 80...the first one has 3615, 3632, 3840 and 3644/....

so each connection to a website is connected via a seperate port number on your PC.

the router detects this...it knows the request has come from which PC on the lan and diverts it to the web server on the internet.

when the web server sends the reply, the router already knows the destination to be as the computer which initiated the connection....so no problems there.

Posted (edited)

The way NAT (which is found on pretty much all personal-use routers) works is that any packets outgoing will be assigned a random origninating port (from an pool of normally unused ports). The destination port (such as 80 for HTTP) will remain untouched. The destination server will receive the packet (on port 80) and will give all responses to the orgininating port (the random port). The NAT remembers which random port corresponds to which request from which IP (computer) in the internal LAN, and thus can route the packet from the server to the appropriate computer based on the incoming port.

When you set up an internal server (or whatever its called, depending on what your router manufacturer wants to call it) then you setup port forwarding (or whatever it's called) on your router. For example, port 80 can be routed to your PC's port 80, and so any incoming packets to your router from the internet on destination port 80 will be routed to your PC.

Of course, pretty much all consumer ADSL services in Thailand have dynamic DNS, which means there's little chance of you getting the same IP address after a disconnect. Since most people use a domain name (FQDN) to find a server (such as www.msn.com) or even an IP, they will not find your server after you disconnect. The answer is a service like DynDNS like mentioned above, and you can use a PC client or (if your router has it.. only a few do) the router's built-in client.

This is of course all moot if your ISP allocates private IP addresses to you. In that case, you're behind a NAT router (at the ISP) and no one can initiate contact with you from the internet.

Edited by Firefoxx
Posted

Wow, great replies so far!!

I checked on my router docs, and it does support all of that. Full NAT server mapping, or SUA and DynDNS also... They only warn against certain ISPs checking if their 'residential' customers are running any services on certain ports.. Looks like the thing can map just about anything.

Cheers,

CHanchao

Posted

As other people have indicated you can map the port in the router.

If you want to run a web server the problem will be the IP address.

Most providers map IP addresses dynamically using dhcp, so everytime you connect

you get a different ip address.

This means external users will never be able to find your site.

It will be OK for internal testing, but that is all.

If you want a fixed IP address then the prices go up!!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.



×
×
  • Create New...