From owner-freebsd-questions@FreeBSD.ORG Wed Aug 28 09:42:13 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DB681624 for ; Wed, 28 Aug 2013 09:42:13 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D3682960 for ; Wed, 28 Aug 2013 09:42:12 +0000 (UTC) Received: from [192.168.1.35] (mux.fjl.org.uk [62.3.120.246]) (authenticated bits=0) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id r7S9g4qN079050 (version=TLSv1/SSLv3 cipher=DHE-DSS-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 28 Aug 2013 10:42:04 +0100 (BST) (envelope-from frank2@fjl.co.uk) Message-ID: <521DC5EC.1010701@fjl.co.uk> Date: Wed, 28 Aug 2013 10:42:04 +0100 From: Frank Leonhardt User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: Jail with public IP alias References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2013 09:42:13 -0000 On28/08/2013 00:19, Patrick wrote: > On Tue, Aug 27, 2013 at 3:42 PM, Alejandro Imass wrote: >> On Tue, Aug 27, 2013 at 6:28 PM, Patrick wrote: >>> That's not the behaviour I see. My jail has a private and public IP. >>> >> Hi Patrick, thanks for your reply. >> >> The issue is actually more basic and it's because the same network >> card has multiple IPs on the same subnet so the routing table always >> chooses the primary IP assigned to that interface. >> >> I'm trying to figure out if I can fix it in the routing table or will >> need IPFW to re-write the source address. >> >> Thanks, >> >> -- >> Alejandro Imass > Hi Alejandro, > > That's how I've got things setup, too, but I'm not seeing the same > behaviour. So I was wondering if there was something different about > your setup such as using NAT to allow a jail with a private IP to > access the internet at large. > > Patrick > > > (Tidied up so all now bottom posted) I can confirm that you shouldn't be seeing this behaviour because I don't. I don't use EzJail - i prefer "vi". Seriously, setting up a jail is very straightforward anyway, and when I tried ezjail I found it was doing stuff I didn't like, so dropped it early on. It was a long time ago and I've forgotten the specifics. I guess if you're using it your new to this particular game, so please excuse me pointing out a few basics here. Although I can't exactly see how this would cause a problem, remember that many service will bind to ALL IP addresses when they start up, and if they pinch a port any subsequent jail trying to take the same one will fail. For SSH, edit /etc/ssh/sshd_config on the "host OS" and set the ListenAddress to the one you want to use instead of the default, which means all of them. I can't see a mechanism that would get the results you're seeing, but I don't know what ezjail might be doing. I suspect your problem is with ezjail or something bizzare on your network config; can you try it manually? Regards, Frank.