Port Forwarding

Any recommendations on a good port forwarding solution for DietPi? A little google searching turned up ‘socat’ as a possibility but seems like I recall using something even easier back in the day when I was more up on linux.

IPTables would be the best bet…are you trying to setup a firewall solution?


would be good to know what you like to achieve. What scenario you are trying to implement?

I have a main machine that is connected to a VPN that some sites block. What I would like to do is to hit the dietpi machine on the LAN and have it go out through the normal internet connection.

Sounds like you are wanting to do port tunneling using SSH

SSH to the dietpi machine inside the lan, then forward all traffic loopback thru SSH then out of the DietPi

If the main machine is the router at your house and supports policy based routing, you can exclude the IP of the lan hosts which should use the normal internet connection.

I’m still lost on this request. What do you mean by

I have a main machine that is connected to a VPN that some sites block.

Does it mean you like to bypass the VPN for a specific set of URL /web sites ?? If yes, you would need some software analysing the request. Based in URL it’s going to decide which interface to use?? But this has nothing to do with port forwarding.

I have a desktop that is connected to a VPN and with it I’d like to be able to access sites that block connections from that VPN. The dietpi host isn’t setup for the VPN so I can go through it I can access the sites I want. `socat’ will do what I want, just curious if there is utility that is better suited to dietpi that will do the same thing.

well first you would need to bypass VPN tunnel on your desktop computer. If you are able to do, you can use your internet router as gateway. No need to go to DietPi device.

Thanks. This got me thinking and I minimal google searched revealed a tool to UNroute certain IP addresses so I can skip the dietpi host as you mentioned.

yeah that’s the easiest way if you already do the decision where to route the traffic on the windows box