From owner-freebsd-jail@freebsd.org Sat Jun 27 17:09:37 2020 Return-Path: Delivered-To: freebsd-jail@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 046A6357799 for ; Sat, 27 Jun 2020 17:09:37 +0000 (UTC) (envelope-from dave.mehler@gmail.com) Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49vKxD0YwHz4Cq4 for ; Sat, 27 Jun 2020 17:09:35 +0000 (UTC) (envelope-from dave.mehler@gmail.com) Received: by mail-io1-xd2e.google.com with SMTP id k23so12976047iom.10 for ; Sat, 27 Jun 2020 10:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=flQ/PxmdxWyd4IZGxfaA7KuPQtj96M23lrq+t0qBmoM=; b=VGwmeqAnxlT2WhzRAYqqsczxi02GfSXVs7K2MkQYYRGM5pH/iQ6z47sL/ho8RtOqNL K9mYtrBaN+2cE5JYer3wg8p6pFTMYrrIvYgerfoAcrIrSt+xC4DIP+NXjVNBOnEW15T8 27maMPj5STbPuZcwM1o08qHSTfU8uzncobIz4m5rASqZ+aWpH4PQw/52Pq8Ar66lnQ6O eU0Rvx6xOmHSQ5/lQ5Kj+PLRHn9Y/0mxBZk/5QpE9opzzr74yD47prglevHKHUK29oB/ OxN2qJEuoDwNRN0T2+nSjNSyJq08h07cecUF+l2dtfNqeZBD1aVGHDx8J4VlkbQzUDzb 4pHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=flQ/PxmdxWyd4IZGxfaA7KuPQtj96M23lrq+t0qBmoM=; b=bO5enP51d+AnAgBWtCsv1KXIviEMIFgHwFNHDtvnals5NPeKoAoQzaN/U5JoM+Y/xC hyBthVwxy7yataNgAO6I+25sBOTZ5VX88O8kfaYdv87b8EVRTJ/Wxv9NODwg+SrLAoKv g6Mr1K+k21pNrU4UjA4B85VVlfoho+aNRGbj9PUUx5KgJTSIRFwhiE7wXgJVVhcZiFVn YpQS9oaUY7CYFIeEtQEYMRcMIvWBxTgSF+k+dRQ14KFxzfCRsCtuJNzA3vH+IkhVlUER HtvYB+EZWmy0hzNlHWZi1f0FquAzpTe4Alj7X7CBPGVOh+krPGWVr5ZxPaFIlIEPg+Ad k8Lg== X-Gm-Message-State: AOAM5333uBvA3iv5rQbh7OwCBtDWTAtpZUrDbSSzGtYuPt29Q9+4C2SN HBY6h7LhpOou/sx6YFukFyyufYIjZAEPHOG8LYLl31ns X-Google-Smtp-Source: ABdhPJw4SrQwlKtusOTypR/hr5a/QpdtkysvCm0vwn87MtVMHlYBIY+g6/nWMBQaioTLqugFtBJ1RcI9Ni8ULyP/k4I= X-Received: by 2002:a02:3402:: with SMTP id x2mr9064869jae.11.1593277774679; Sat, 27 Jun 2020 10:09:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:3b52:0:0:0:0:0 with HTTP; Sat, 27 Jun 2020 10:09:34 -0700 (PDT) From: David Mehler Date: Sat, 27 Jun 2020 13:09:34 -0400 Message-ID: Subject: FreeBSD 12.1, vnet jail, and internet access To: freebsd-jail Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49vKxD0YwHz4Cq4 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=VGwmeqAn; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of davemehler@gmail.com designates 2607:f8b0:4864:20::d2e as permitted sender) smtp.mailfrom=davemehler@gmail.com X-Spamd-Result: default: False [-3.59 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.01)[-1.013]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-jail@freebsd.org]; NEURAL_HAM_LONG(-0.94)[-0.936]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d2e:from]; NEURAL_HAM_SHORT(-0.64)[-0.645]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2020 17:09:37 -0000 Hello, I'm trying to get vnet jails going on FreeBSD 12.1-p6. I can start and stop it and interfaces come up and go down, on the jail it can ping the gateway but pings fail. Am I missing a step? I've got a single IPv4 address and am using private IPv4 addresses. As of now I have not set an IPv6 address to this jail. The routing tables all look good. Here's my configuration: On the host: #ifconfig bridge0 ifconfig: interface bridge0 does not exist #ifconfig epair0a ifconfig: interface epair0a does not exist #ifconfig epair0b ifconfig: interface epair0b does not exist #cat rc.conf hostname="xxxxxxxxxxxxxx" ifconfig_vtnet0="DHCP" ifconfig_vtnet0_ipv6="inet6 accept_rtadv" jail_enable="YES" #ifconfig vtnet0 vtnet0: flags=8843 metric 0 mtu 1500 options=6c07bb ether f2:3c:92:bc:54:37 inet6 fe80::f03c:92ff:febc:5437%vtnet0 prefixlen 64 scopeid 0x1 inet6 xxx prefixlen 64 autoconf inet xxx.xxx.xxx.xxx netmask 0xffffff00 broadcast xxx.xxx.xxx.xxx media: Ethernet 10Gbase-T status: active nd6 options=23 #cat jail.conf loghost { host.hostname = "loghost"; path = "/jail/loghost"; mount.devfs; devfs_ruleset = "4"; exec.consolelog = "/var/log/console.loghost"; vnet = "new"; exec.clean; vnet.interface = "epair0b"; exec.prestart = "ifconfig epair0 create up"; exec.prestart += "ifconfig bridge0 create up"; exec.prestart += "ifconfig bridge0 inet 192.168.122.1/24 addm vtnet0"; exec.prestart += "ifconfig bridge0 addm epair0a"; exec.start = "/bin/sh /etc/rc"; exec.start += "ifconfig epair0b inet 192.168.122.50 netmask 255.255.255.0"; exec.start += "route add default 192.168.122.1"; exec.stop = "/bin/sh /etc/rc.shutdown"; exec.poststop = "ifconfig epair0a destroy"; exec.poststop += "ifconfig bridge0 deletem epair0a"; exec.poststop += "ifconfig bridge0 destroy"; } #service jail start Starting jails: loghost. #jls JID IP Address Hostname Path 3 loghost /jail/loghost #ifconfig bridge0 bridge0: flags=8843 metric 0 mtu 1500 ether 02:bf:cf:92:2c:00 inet 192.168.122.1 netmask 0xffffff00 broadcast 192.168.122.255 id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 member: epair0a flags=143 ifmaxaddr 0 port 3 priority 128 path cost 2000 member: vtnet0 flags=143 ifmaxaddr 0 port 1 priority 128 path cost 2000 groups: bridge nd6 options=1 #ifconfig epair0a epair0a: flags=8943 metric 0 mtu 1500 options=8 ether 02:c0:11:e6:99:0a inet6 fe80::c0:11ff:fee6:990a%epair0a prefixlen 64 tentative scopeid 0x3 groups: epair media: Ethernet 10Gbase-T (10Gbase-T ) status: active nd6 options=29 #ifconfig epair0b ifconfig: interface epair0b does not exist #netstat -rn Routing tables Internet: Destination Gateway Flags Netif Expire default xxx.xxx.xxx.xxx UGS vtnet0 xxx.xxx.xxx.xxx/24 link#1 U vtnet0 xxx.xxx.xxx.xxx link#1 UHS lo0 127.0.0.1 link#2 UH lo0 192.168.122.0/24 link#5 U bridge0 192.168.122.1 link#5 UHS lo0 In the jail: #jexec loghost /bin/tcsh #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 epair0b: flags=8843 metric 0 mtu 1500 options=8 ether 02:c0:11:e6:99:0b inet 192.168.122.50 netmask 0xffffff00 broadcast 192.168.122.255 groups: epair media: Ethernet 10Gbase-T (10Gbase-T ) status: active nd6 options=29 #cat /etc/rc.conf hostname="loghost" #ping -c 1 192.168.122.1 PING 192.168.122.1 (192.168.122.1): 56 data bytes 64 bytes from 192.168.122.1: icmp_seq=0 ttl=64 time=0.111 ms --- 192.168.122.1 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.111/0.111/0.111/0.000 ms #ping -c 1 1.1.1.1 PING 1.1.1.1 (1.1.1.1): 56 data bytes --- 1.1.1.1 ping statistics --- 1 packets transmitted, 0 packets received, 100.0% packet loss #netstat -rn Routing tables Internet: Destination Gateway Flags Netif Expire default 192.168.122.1 UGS epair0b 127.0.0.1 link#1 UH lo0 192.168.122.0/24 link#2 U epair0b 192.168.122.50 link#2 UHS lo0 Am I missing a step with vnet? I was under the impression that vnet jails have there own TCPIP stack separate from the host's stack. Thanks. Dave.