0

I need to use a local webbrowser on a ubuntu PC to connect to my internet router via an internal firewall ubuntu server. So I'd need to tunnel via the firewall machine in order to access the router:

[ PC ] <-- 192.168.1.0/24 --> [ FW ] <-- 192.168.2.0/24 --> [router] --> WAN

I don't want to tunnel any other traffic other than the router's port 80

Q. Can this be done in a single ssh command ?

1 Answer 1

1

You have two options.

ssh -D1080 firewall

which creates a local SOCKS5 server you can configure your browser to use. Then it is for all practical purposes running on the firewall.

ssh -L8080:router:80 firewall

which forwards the local port 8080 to port 80 on router (which sees it coming from firewall).

Also you may be able to use "ssh -Y firewall" to run a shell on the firewall where you can run a browser which then displays on your computer. If not, you may be able to run links or similar.

Note that if what you want to do is intentionally hard, you may want to check with the local network administrator that what you want to do is allowed. Breaching network security without permission is usually not a good idea.

1
  • Thanks a lot Thorbjorn. Both worked but I preferred to leave browser settings as they are so just used the "ssh -L8080:router:80 firewall" just fine. Apr 7, 2017 at 13:34

You must log in to answer this question.

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