From owner-freebsd-hackers@freebsd.org Thu Apr 22 15:12:45 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 409945F5E5F for ; Thu, 22 Apr 2021 15:12:45 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from udns.ultimatedns.net (static-24-113-41-81.wavecable.com [24.113.41.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "ultimatedns.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FR1BN5P31z4VMx for ; Thu, 22 Apr 2021 15:12:43 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.16.1/8.16.1) with ESMTP id 13MFCbZl067783; Thu, 22 Apr 2021 08:12:43 -0700 (PDT) (envelope-from bsd-lists@bsdforge.com) MIME-Version: 1.0 Date: Thu, 22 Apr 2021 08:12:37 -0700 From: Chris To: Peter Blok Cc: freebsd-hackers@freebsd.org Subject: Re: 32-bit jail on 64-bit host In-Reply-To: References: User-Agent: UDNSMS/17.0 Message-ID: X-Sender: bsd-lists@bsdforge.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FR1BN5P31z4VMx X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:11404, ipnet:24.113.0.0/16, country:US]; local_wl_ip(0.00)[24.113.41.81] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 15:12:45 -0000 On 2021-04-22 01:36, Peter Blok wrote: > Hi, > > I have created a 32-bit jail on a 64-bit running 12-STABLE. The jail is also > build > using the same source. > > The jail gives me a 32-bit environment. I’m getting an IP address and I can > ping > others on the same network segment. > > But I can’t set a default route. > > route add default 192.168.1.1 > route: writing to routing socket: Invalid argument > add net default: gateway 192.168.1.1 fib 0: Invalid argument > > # netstat -rn > Routing tables > (0) (0) UH > (0) (0) U > (0) (0) UHS > (0) (0) UH > (0) (0) U > (0) (0) UHS > > # ifconfig -a > lo0: flags=8049 metric 0 mtu 16384 > options=680003 > inet6 ::1 prefixlen 128 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 > inet 127.0.0.1 netmask 0xff000000 > groups: lo > nd6 options=21 > e0b_websip: flags=8843 metric 0 mtu > 1500 > options=8 > ether 0e:88:d7:20:99:80 > hwaddr 02:80:ad:6e:79:0b > inet 192.168.1.205 netmask 0xffffff00 broadcast 192.168.1.255 > groups: epair > media: Ethernet 10Gbase-T (10Gbase-T ) > status: active > nd6 options=29 > > Any idea how to fix this? > > I’m using vnet bridge I do it. I don't think vnet or a bridge is necessary or perhaps even desirable in this situation. All my 32/64bit jails access the hosts net out of localhost (127.0.0.2-N) and I use pf(4) to redirect the packets. I have a static block of internet facing addresses. So change yours accordingly pf.conf(5) EXT_ADDR="W.X.Y.Z" ... set skip on { lo0, lo1 } ... nat pass on re0 from { lo1 } to any -> $EXT_ADDR rdr pass on re0 proto tcp from any to { lo1 } -> $EXT_ADDR ... block in pass out ... I add an entry in the hosts hosts(5) file, and in the jails hosts(5) for accounting purposes. The jails resolve.conf(5) file looks like this nameserver 127.0.0.1 nameserver 127.0.0.2 options timeout:1 attempts:1 rotate And all gets it done for me. HTH --Chris > > Peter > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"