Requirement: A Computer connected to DSL modem and access rights to DSL Modem's admin interface.
In this setup, if I connect to a website, the request reaches the Modem. All systems behind modem will have private ips(say 192.168.x.x). The modem performs a NAT and sends the request to the ISP's upstream router. The modem will have a different ip on ISP's upstream subnet. So it puts its IP and some port translation so that it can map to same computer.
A very very rough sketch at http://drawit.eskratch.com/fetch?q=464041803 where A and B are clients who send requests to web servers on port number 8140 and 8141. Modem m receives them and translates req to m:80 and m:81 respectively and sends to the ISP modem.The ISP modem associates a public IP pub to the modem m and sends the request to webserver. On return the packet reaches ISP who based on IPmapping sends the data to modem m. The modem m based on port mapping, send the data to corresponding computer.
Now my requirement is I will place a web server in any one of the computers and it should be reachable globally.
Steps:
In this setup, if I connect to a website, the request reaches the Modem. All systems behind modem will have private ips(say 192.168.x.x). The modem performs a NAT and sends the request to the ISP's upstream router. The modem will have a different ip on ISP's upstream subnet. So it puts its IP and some port translation so that it can map to same computer.
A very very rough sketch at http://drawit.eskratch.com/fetch?q=464041803 where A and B are clients who send requests to web servers on port number 8140 and 8141. Modem m receives them and translates req to m:80 and m:81 respectively and sends to the ISP modem.The ISP modem associates a public IP pub to the modem m and sends the request to webserver. On return the packet reaches ISP who based on IPmapping sends the data to modem m. The modem m based on port mapping, send the data to corresponding computer.
Now my requirement is I will place a web server in any one of the computers and it should be reachable globally.
Steps:
- Open the modem's Admin interface(this is possible only in a home setup). Admin interface is in standard ip for each manufacturer.
- Select Port Forwardng
- Enter your ip(ifconfig) and port number(say 8080) where webserver is hosted
- Start web server
- Do a crawl ifconfig.me or visit http://ifconfig.me , this will give your pub ip of ISP
- Now type pubip:port (port mentioned in port forwarding) in the address bar of any browser. This should lead to your site.
How it works?
Again a rough sketch http://drawit.eskratch.com/fetch?q=-1466067656,
when somebody enters pub:port, the request reaches the ISP who maps to modem using IP, the modem forward the data on port to required system as we have configured to do so.
But the mapping between the modem and ISP is dynamic, they may assign a diff public IP from their pool at different point of time. There are third party like http://www.no-ip.com/ who solves this issue
No-ip allows us to select a domain name(dn.no-ip.org). It periodically checks our system's public ip and maps it to dn.no-ip.org.
My local apache webserver is accessible in public (provided my lap is on and Iam in my home network) at http://apache4.no-ip.org:8080/
Comments
Post a Comment