0

In my home, I have two routers. The first (192.168.1.1) is working as ADSL modem and works as ISP for the second router (192.168.2.1). My LAN (Wifi) is built on the second router.

I am using port forward twice:

  1. from the first router port 80 to the second router port 80
  2. from the second router port 80 to my computer port 80 (192.168.2.30)

Everything works fine and using freemyip.com service I able to create a virtual host on my computer to be accessible from the Internet.

My problem is: The server could not able to catch the client's remote IP. i.e all remote access is recorded as my public IP of the first router (The ADSL modem) while accessing the server through my LAN, the IP is recorded correctly for the device accessed it.

I believe that it is issue related with port forward but I could not able to solve it.

Zac67
  • 10,320
  • 2
  • 12
  • 32
SaidbakR
  • 105
  • 7
  • 1
    Why do you even have such a complicated setup? You should use a single network behind the first router, not any double-router -setup unless you have a very valid reason. – Tero Kilkanen Oct 04 '17 at 19:32
  • 1
    Home use off topic for serverfault. – user9517 Oct 04 '17 at 20:12
  • @TeroKilkanen I have two reasons: 1- the second router has WiFi but could not work as ADSL modem, while the first could works as ADSL modem. 2- the Second router has wrt firmware which allows required functionalities does not supported by the first router such as DNSMasq. – SaidbakR Oct 04 '17 at 21:21
  • @user430214 regarding that I have use it in my home does not mean it may not available issue in work! – SaidbakR Oct 04 '17 at 21:23
  • There aren't these kinds of issues in professional business environments, since businesses use proper equipment for networking. – Tero Kilkanen Oct 05 '17 at 05:46
  • @TeroKilkanen I could not able to agree with you. There are many small and medium businesses may acts more much like or even exactly like home! The evidence of my idea the term of [SOHO](http://www.webopedia.com/TERM/S/SOHO.html) – SaidbakR Oct 05 '17 at 05:58
  • SOHO is a home environment by definition, not an environment built for business, which are the environments discussed here. – Tero Kilkanen Oct 06 '17 at 04:40

2 Answers2

2

Whether the server sees the external IP address or the internal one of the router depends on the router's NAT service - possibly it's configurable.

Additionally NATing the source address is more like a reverse proxy but some routers also do this.

Zac67
  • 10,320
  • 2
  • 12
  • 32
0

I see that at work, the network layer has to ensure that the HTML header x-forwarded-for is sent to our web server, otherwise it sees all traffic coming from the firewall.

But that usually happens when you proxy, so in your case, could it be that the routers implement NAT via a proxy? Check if you have an option to preserve client IP in your admin interface.

Nic3500
  • 155
  • 8