tunnel device name acquisition?

Gabriel L. Somlo gsomlo at gmail.com
Wed Oct 11 07:01:01 AEDT 2017

Numerous how-tos all over the Internet show how one would set up
a tunnel using ssh, e.g.:

	ssh -f -o Tunnel=ethernet <server_ip> true

I was wondering if there's a way to subsequently acquire the names
of the local and remote tun/tap interfaces (e.g., using the default
"-w any:any") for subsequent automatic tunnel configuration, e.g.:

	ip link set $TapDev up
	ip link set $TapDev master <client-or-server-side-bridge>

Most examples out there pick something silly like "-w 5:5" then
proceed to configure the hard-coded "tap5" on both client and server.
However, that's unreliable -- what if "tap5" is already in use on the
server, and we have to pick something else? What if I want to set up a
server to accept multiple connections from random clients in random

Ideally, I'd start ssh-based "tunnel client" and "tunnel server"
services at boot, and having to pick names manually, then manually
configure everything on both ends is quite limiting.

I tried starting the client with "-vvv" hoping the verbose debugging
output would include some grep-able hint as to what interface names
were picked, but couldn't see anything useful.

Any clue much appreciated!


More information about the openssh-unix-dev mailing list