From owner-freebsd-questions@FreeBSD.ORG Tue May 18 19:41:40 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E249316A4CE for ; Tue, 18 May 2004 19:41:40 -0700 (PDT) Received: from auk1.snu.ac.kr (auk1.snu.ac.kr [147.46.100.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7814143D45 for ; Tue, 18 May 2004 19:41:40 -0700 (PDT) (envelope-from stopspam@users.sourceforge.net) Received: from [147.46.44.181] (stopspam@users.sourceforge.net) by auk1.snu.ac.kr (Terrace Internet Messaging Server) with ESMTP id 2004051911:25:33:460318.15039.2875906992 for ; Wed, 19 May 2004 11:25:33 +0900 (KST) Message-ID: <40AAC963.7020306@users.sourceforge.net> Date: Wed, 19 May 2004 11:41:39 +0900 From: Rob User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040507 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-TERRACE-SPAMMARK: YES-__TRSYS_LV__3 (SR:-6.33) (SRN:SPAMROBOT) ----------------- Subject: Q: ifconfig alias vs. ssh tunnel doesn't work. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2004 02:41:41 -0000 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 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.