Environment :linksys wrt300n v1.1 which can have ddwrt-mega. Willing to tunnel all lan's outbound traffic through an ssh tunnel.
You can tunnel a specific port with a reverse shell. The direction is important. For example ssh -R 80:localhost:80 firstname.lastname@example.org. This will connect your localhost port 80 to the port 80 from the host and it will send all network packets from port 80 to your port 80. When you need you can do the other way around.
To tunnel all outbound LAN traffic, follow these steps:
Run script in the form
ssh -D <localport> <remotehost>. E.g.
ssh -D 8080 ssh-user@server-ip. Here, 8080 is source port on which SOCKS server listens. It'll perform
Dynamic Port Forwarding.
Setup a proxy from GUI of router. The proxy server detail: IP is local/private IP of router (where script of step 1 runs) and port is the port specified in script of step 1.