OpenWrt Forum Archive

Topic: Add a UCI option for dropbear's -a (GatewayPorts) option?

The content of this topic has been archived on 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

My goal is to set up my home router so that I can ssh into it and pipe my communications through a secure tunnel, emerging at my home IP. Great for using public wifi!
I pass -D 127.0.0.1:8080 and have a SOCKS tunnel. PERFECT!

The last thing I'd like to do is receive incoming connections to a port on my tunneled remote machine.
I pass -R *:50500:localhost:50500, but no dice.

# netstat -tl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 localhost.:50499        0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
man ssh(1) wrote:

By default, the listening socket on the server will be bound to the loopback interface only.  This may be overridden by specifying a bind_address. An empty bind_address, or the address ‘*’, indicates that the remote socket should listen on all interfaces.  Specifying a remote bind_address will only succeed if the server’s GatewayPorts option is enabled.

The problem (as explained here), is:

You'll have to start the Dropbear server with the -a argument (equivalent to the "gatewayports yes" directive).

man dropbear(8) wrote:

-a        Allow remote hosts to connect to forwarded ports.

I humbly request the dropbear UCI section include an 'allowRemote' option or something like that. I guess I will add -a to DROPBEAR_ARGS= in /etc/init.d/dropbear, but that is a pretty rough way of doing things.

Well, I edited DROPBEAR_ARGS in /etc/init.d/dropbear and ran it. My connection was dropped and I could not reconnect until the router was restarted. It looks like I hit closed bug 5498 - is that fix not in 8.09.1? Does it hit in 8.09.2?

(Last edited by phip on 13 Jan 2010, 21:57)

The discussion might have continued from here.