Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] How to port-foward an external device plugged into an ethernet adaptor to another ethernet adaptor?

Status
Not open for further replies.

andre_luis

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,593
Helped
1,190
Reputation
2,399
Reaction score
1,207
Trophy points
1,403
Location
Brazil
Activity points
55,667
I'm replicating here a question I made in another place supposedly more specialized in this subject, however without return.

----------------------

I have a camera device working as a webserver with a local IP/Port 192.168.0.250:80 over the HTTP protocol, which is connected to one ethernet adaptor of the PC having the IP 192.168.0.1 and Gateway 10.20.30.10 and I wanted to access this camera remotelly throught another ethernet adaptor from the LAN where this PC is connected with IP 10.20.30.40 and gateway 10.20.30.10.

In short, I wanted to access this camera remotelly, mapped as the url http://10.20.30.40:8008.
( I already access this camera from local network with the url http://192.168.0.250:80 ) .

Portfowarding.png


According to the following diagram, I have tryed some options to portfoward:

The first attempt was by mapping the camera connected to the 1st ethernet adaptor directly to the 2nd ethernet adaptor connected to the external network:

Code:
REM Route from Camera to Remote
netsh interface portproxy add v4tov4 listenaddress=192.168.0.250 listenport=80 connectaddress=10.20.30.40 connectport=8008

However, seemed too simple, and not surprisingly didn't work. Then, I tryed to implement an internal intermediary route, so that the external device would be mapped into an internal Port from one adaptor to another one:

Code:
REM Route from Camera to PC
netsh interface portproxy add v4tov4 listenaddress=192.168.0.250 listenport=80 connectaddress=192.168.0.1 connectport=1001
REM Route from PC to Remote
netsh interface portproxy add v4tov4 listenaddress=192.168.0.1 listenport=1001 connectaddress=10.20.30.40 connectport=8008

Didn't work, and finally tryed to route the camera throught the gateway, also with the intermediary approach, with no success aswell:

Code:
REM Route from Camera to PC
netsh interface portproxy add v4tov4 listenaddress=192.168.0.250 listenport=80 connectaddress=10.20.30.10 connectport=1001
REM Route from PC to Remote
netsh interface portproxy add v4tov4 listenaddress=10.20.30.10 listenport=1001 connectaddress=10.20.30.40 connectport=8008

What am I'm missing here?

Side notes:
1 ) Most Portfowarding tutorials explains how to map from localhost, not from external devices.

2 ) It is not intended to foward streamming video, instead, just to take sparse snapshots upon request, via URL sentences.
 
Last edited:

I believe you are setting up portproxy the wrong way. You want to create a listenport 10.20.30.40:8008 on the PC and forward it to 192.168.0.250.
 

    andre_luis

    Points: 2
    Helpful Answer Positive Rating
I believe you are setting up portproxy the wrong way. You want to create a listenport 10.20.30.40:8008 on the PC and forward it to 192.168.0.250.

Although I could not find anywhere some tutorial depicting unequivocally e.g with illustration what is the local and the remote address, most explais with almost the same description:
listenaddress – is a local IP address to listen for incoming connection
listenport – local listening TCP port number (the connection is waiting on)
connectaddress – is a local or remote IP address to which we want to redirect incoming connection
connectport – is a TCP port to which the connection from listen port is forwarded to.
Once 10.20.30.40 is the remote address to which I want to redirect incomming conections and 192.168.0.250 is the local one where webserver listens for incomming connections, I fear it is not exactly as you said, or am I missing something?
--- Updated ---

I've just reversed the arrows direction at original picture in order to avoid misunderstanding from where server is indeed at.
 
Last edited:

I may misunderstand the descrption, but I see wrong direction arrows in your diagram. The real telation is this: The PC is exposing a proxy server at 10.20.30.40:8080, incoming client requests are redirected to 192.168.0.250:80.
 
It worked perfectly after correcting as your initial observation, in fact I had mislead what should be the listener and what to connect.
Just to share, here's the correct command line that worked:

Code:
netsh interface portproxy add v4tov4 listenaddress=10.20.30.40 listenport=8008 connectaddress=192.168.0.250 connectport=80
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top