0

I want to run a server on my machine so that anyone in the Internet may connect to it. But my Broadband internet provider issues the same WAN ip to all the customers while each of them has a different LAN ip. How can I run a server then?

1
  • That's no programming question. Maybe you have more luck when asking this on superuser. As far as I can tell there will be no way to solve this.
    – sra
    May 22, 2011 at 14:34

4 Answers 4

2

You mention LAN IP, so I'm assuming you have a router or switch in between your PCs and the WAN. In order to setup a single server, for example web server, to be identified as the sole system for WAN facing services you can either:

  1. Set the system as the DMZ machine, which means that the server is default place for all non routed requests to go to
  2. Use port forwarding

How to go about it depends on what type of router/switch you are using.

0

I take it you mean that you have a 'private' IP assigned to you by your broadband ISP (which you see allocated on your Server network interface). Meanwhile, if you try to identify your external IP, its different (which you refer as your WAN IP).

Setting up a server that can receive incoming connections from the Internet requires things like NAT provided from your ISP.

Simply put, someone on the Internet would try to connect to your 'WAN' IP on some port number (say 8081/tcp), and this NAT on the ISP would convert that to your 'private' IP and port 80/tcp (say).

However, if you really want to run a server on such a network, your ISP usually would provide you with a static public IP address rather than the private IP you are seeing now. You will need to talk with him on this and get your subscription modified likewise.

Usually, broadband ISPs give out public IP allocations which might change each time you reconnect. That is an easier thing to handle since you can then get a domain registered and use things like OpenDNS to make your server easily accessible on the Internet.

0

Configure port forwarding at your broadband-router.

              .--------.
[PC 1]--------+        |
              |        |
[PC 2]--------+ router +---- DSL/cable
...           :        :
[PC n]--------+        |
              '--------'         

(Assuming the computers are connected to the typical built-in switch-ports of a typical consumer broadband router, which provides NAT and internal DHCP service)

The router's WAN (i.e. Internet) IP address is used externally for all PC 1, PC 2 ... (i.e. NAT applies)

If PC 2 is the "server" and has DHCP reservation 192.168.1.2, configure port forwarding at the router so that Internet traffic for port 80 is forwarded to port 80 at 192.168.1.2

0

I'm assuming that you are on a standard home internet connection. If this is a business grade question it may be bit different because of how your ISP handles your WAN IP.

Most likely, your WAN IP is actually dynamic. For instance, right now my WAN IP may be 66.65.64.63. In another hour my WAN IP may be reset to a new IP within my ISPs range, so it may change to 66.65.64.62.

The other answers to this question are perfectly correct, in that you will need to set up some port forwarding. Port forwarding will tell your router (the device that passes your internet connection to various connected devices) to send everything on port x (80?) to a specific LAN IP. To handle the changing IP provided by your ISP, however, you will also need to use a dynamic dns service like dyndns. This service will install a client on your server, and do a check every few minutes to see if your WAN IP has changed.

dyndns is easily the most popular service to handle this kind of thing, but there are many more free options.

You must log in to answer this question.

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