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

I am hosting my own website on my local machine and set up a virtual server on my router and everything works like a charm.

In IIS, i cannot bind the WAN IP, as it doesn't show up, and if I type it manually, the website does not work. I know that there is something else I need to do, such as bind the WAN IP to my local machine as the title says, but how would one do that?

I am sure all the hosting companies are doing something similar to this, but I cannot find anything on how to do it.

share|improve this question
    
Is your IIS machine behind a firewall? What is your IIS server's normal address and give us the first two octets of your WAN address (e.g. 12.52.x.x) –  Mike Pennington Aug 25 '12 at 11:34
    
iis is behind router and windows firewall. but as i said, the website is working from the web. my problem is that i need to identify (by code) that the external ip is local ip, so i need to bind it to iis. my internal address is 192.168.1.2 (192.168.1.1 would be the router) the wan ip is 78.131.xxx.xxx –  Dementic Aug 25 '12 at 11:57

2 Answers 2

up vote 2 down vote accepted

As long as you are behind a physical NAT (and I know you are because of your RFC 1918 address), you cannot bind your WAN IP to your ethernet NIC on the IIS server. Your IIS server must not be NAT'd to make this happen. Most people put it in a publicly-addressed DMZ.

That said, it's still unclear to me how adding 78.131.x.x to your local IIS server really helps. I presume you're looking at something like X-Forwarded-For in the HTTP header, but why you must bind your IP locally to IIS is still unclear. Also, it's unclear how this helps, since you presumably could just hardcode the WAN address in to your webapp.

share|improve this answer
    
Physical NAT is my router ? (192.168.xxx.xxx) ? or did you ment the 78.131.xxx.xxx address? which is a static ip? i do not want to hard code the address because this is a development machine, and i do not know where the client will host the site. –  Dementic Aug 25 '12 at 12:18
    
Your NAT functionality usually happens on the router/firewall that terminates the connection from your ISP. You can probably can find the external address your client uses dynamically with a quick query to a service like What's my IP during your web service startup –  Mike Pennington Aug 25 '12 at 12:21
    
if i will disconnect the router and connect my computer directly would that solve it? –  Dementic Aug 25 '12 at 12:23
1  
Well, that's one way to fix your development problem, but if your client is security-savvy, they will put the webapp behind a firewall / http load-balancer, so you still need to find a way to solve this problem. Furthermore, leaving an IIS development machine unfirewalled in the wild internet is more brave than I would be –  Mike Pennington Aug 25 '12 at 12:24

You need to find out how your router/firewall does port-forwarding then forward all requests to port 80 of your public ip to the dev server private ip.

share|improve this answer
    
Actually, he had already done that before he asked the question –  Mike Pennington Aug 25 '12 at 14:57
    
@Mike, there is nothing in the question that hints that the OP has done this at all. –  John Gardeniers Aug 26 '12 at 12:01
    
@JohnGardeniers, there is plenty, but I guess it's not obvious to you. The OP already commented that his address was 192.168.1.2. It's impossible to serve web pages to the internet using this address without port-forwarding or NAT –  Mike Pennington Aug 26 '12 at 12:57
1  
At the very least, It's now clear what key words he needs to search his router documentation for, or request his ISP to implement for him. –  Timothy Makobu Aug 26 '12 at 20:38
1  
@Both of you guyz - The OP (Hey thats me) also said the external IP is 78.131.xxx.xxx, and also said everything is working. also i said that i have setup Virtual Server (Which is exactly the same as Port-Forwarding) the problem was (and solved) that IIS could not bind the WAN ip, this was solved by removing the router, and connecting directly from the PC (this way the WAN IP is part of IIS) –  Dementic Aug 27 '12 at 6:43

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.