Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a modem connecting to ADSL2 network and a router connecting to the modem. The rest of the machines all connect to the router.

The modem has IP as 192.168.1.1 and the router's IP is 192.168.0.1. From the modem configuration, I can see that the modem thinks the router's IP is 192.168.1.2. I can visit the router by either using 192.168.0.1 or 192.168.1.2.

Now I forward a port from the router to a private machine. It works. I can test it by typing 192.168.1.2 and it is redirected to the private machine. But if I use 192.168.0.1, it is still the router's configuration page.

I also do a port forwarding on my modem. Since the modem sees only the router, I can only forward the port to the router's specific port. And I am thinking that by doing this, I can reach the private machine after two times port forwarding, once on the modem and once on the router.

I also have a static public IP. I want to achieve the goal that when someone types the public IP, he will be redirected to the private machine. But when I use some online port forwarding tester, the result always says that the port is closed on the public IP.

I have the questions:

  1. Why my router has two IPs? Why using one IP I can see the port forwarding result while using the other I cannot?

  2. I think the port forwarding only works when visiting from outside, rather than from both outside and inside. Otherwise, if I set port forwarding on my router/modem on port 80, I will never be able to see its original configuration page again. Everything is forwarded. Am I right?

  3. How can I achieve my goal described above? By achieve this, I will have a dedicated server of my own and the users can visit from the public IP. Anyone can correct me on any mistakes I made? I am using Netconn modem and D-Link DIR-300 router.

Thank you very much for any help.

Edit:

Consider I have correctly setup the whole thing. Now I want to test my website by using public IP to visit it, but the port forwarding doesn't work. Does it consider that I am inside the local network and not using the port forwarding? If so, how can I do it? I ask my friends (outside my local network) to have a try and they can see the website. What should I do so that from the inside, I can do the testing? Thank you very much.

share|improve this question
add comment

1 Answer

1) All routers have two IPs, a WAN and a LAN IP. Your WAN IP is how your modem talks to the router, the LAN IP is how your computers talk to the router.

2)There is no port forwarding inside, that is not how port forwarding works, it will only work over NAT, which is one IP to another, in this case your public IP to a private IP.

3) You will need to open up ports in the modem to point to the router WAN, then ports in the router from the WAN to the specific private IP that you want them directed at. Most likely you don't have the port forwarding correctly routed between the modem and the router.

EDIT: To answer your edit, you can always look to the website using the public IP, whether you're inside or outside the network, it treats it as an outside connection. You can access the website privately using the private address that the port forward is set to direct traffic to.

share|improve this answer
    
Thank you for your answer. –  Steve Sep 15 '10 at 6:45
    
It may be easier for you to put your DSL modem into bridged mode, and let your router do PPPoE authentication, that way its not NAT'ing twice. –  SpacemanSpiff Feb 12 '11 at 5:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.