Q: ifconfig alias vs. ssh tunnel doesn't work.

Rob stopspam at users.sourceforge.net
Tue May 18 19:41:41 PDT 2004


Hi,

I use an ssh-tunnel from a PC on a local network behind a gateway to
another PC on the internet. Say the PC behind the gateway is LOCAL
and the other internet PC is REMOTE.

On LOCAL I do as a regular user:

   $ ssh -2 -N -f -R 2201:127.0.0.1:22 REMOTE

Then on REMOTE I can then do:

   $ ssh -p 2201 127.0.0.1

All this works fine for login from REMOTE to LOCAL, bypassing the gateway.

------------------------------

I then want the following to work.

On REMOTE I do, as root:
    # ifconfig lo0 alias 127.0.0.2
    # ifconfig lo0
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
         inet6 ::1 prefixlen 128
         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
         inet 127.0.0.1 netmask 0xff000000
         inet 127.0.0.2 netmask 0xff000000

To double check, I verified that I can login to myself on REMOTE:
    $ ssh REMOTE

On REMOTE I then want to login to LOCAL, as regular user:
    $ ssh -p 2201 127.0.0.2
    ssh: connect to host 127.0.0.2 port 2201: Connection refused


Can somebody explain to me why the ssh-tunnel does not work this way?

Thanks,
Rob.




More information about the freebsd-questions mailing list