Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Feb 2019 12:05:50 -0800
From:      BulkMailForRudy <crapsh@monkeybrains.net>
To:        freebsd-jail@freebsd.org
Subject:   Re: how to determine primary (source) IP address in jail
Message-ID:  <a462d116-fcdb-751a-9258-b9646cd7d198@monkeybrains.net>
In-Reply-To: <781124ab-ca3e-f410-1a60-649e216cded6@quip.cz>
References:  <781124ab-ca3e-f410-1a60-649e216cded6@quip.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
One way to fix the problem is to use VNET in your jails and you will 
get  a lo0 with 127.0.0.1 inside the jail.

Rudy

On 2/28/19 2:58 AM, Miroslav Lachman wrote:
> Is there some easy way to determine the primary (source) address which 
> is used in jail with multiple IP addresses?
>
> I came to this problem with running local_unbound in jail. Unbound 
> refuses queries originating in this jail because the do not come from 
> real 127.0.0.1 (which is the only one allowed by default). Unbound in 
> jail see requests come from jails IP. It is easy to determine (in 
> shell script) if jail has only one IP.
> But what in case where jail has multiple IPs? Is there some sysctl or 
> some call to ifconfig or any other util to get the IP which will be 
> used as source address for queries on local services in jail?
>
> I know I can allow all IPs of jail in
> access-control: a.b.c.d/32 allow
> access-control: e.f.g.h/32 allow
>
> I am just curios if there is some way to get "primary" IP in jail 
> without calling anything from the host environment.
>
> Kind regards
> Miroslav Lachman
> _______________________________________________
> freebsd-jail@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-jail
> To unsubscribe, send any mail to "freebsd-jail-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a462d116-fcdb-751a-9258-b9646cd7d198>