Hello All,
I would like too set up an iocage jail with vnet but can't make my way
forward with it. I have closely followed the iocage documentation but have the
following problem.
The jail in on the host with IP 192.168.1.1 which faces the LAN and acts as gateway. There is another physical interface on the host which faces WAN.
The jail starts but there is no access to LAN from it or to the internet from the jail. The jail doesn't respond to ping from host.
Example of command from inside of the jail
Code:
root@emby2:~ # drill google.com
Error: error sending query: Error creating socket
root@emby2:~ # pkg upgrade
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly, please wait...
pkg: Error fetching http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly/Latest/pkg.txz: No address record
Address resolution failed for http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly.
Consider changing PACKAGESITE.
I have noticed this error in dmesg when the jail is starting
Code:
epair0a: Ethernet address: 02:c8:1d:b4:5c:0a
epair0b: Ethernet address: 02:c8:1d:b4:5c:0b
epair0a: link state changed to UP
epair0b: link state changed to UP
epair0a: changing name to 'vnet0.28'
ng_ether_ifnet_arrival_event: can't re-name node epair0b
igb0: link state changed to DOWN
vnet0.28: promiscuous mode enabled
lo0: link state changed to UP
igb0: link state changed to UP
This is ifconfig on the host
Code:
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=81249b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,WOL_MAGIC,VLAN_HWFILTER>
ether 90:1b:0e:89:41:e9
inet 172.20.1.0 netmask 0xfffffff8 broadcast 172.20.1.7
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
igb0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=a520b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6>
ether 90:1b:0e:6b:c6:d4
inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.103 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.101 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.102 netmask 0xffffff00 broadcast 192.168.1.255
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 02:e3:8d:a8:06:00
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto stp-rstp maxaddr 2000 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
member: vnet0.28 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 6 priority 128 path cost 2000
member: igb0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 2 priority 128 path cost 2000000
groups: bridge
nd6 options=9<PERFORMNUD,IFDISABLED>
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1492
options=80000<LINKSTATE>
inet X.X.X.X --> Y.Y.Y.Y netmask 0xffffffff
groups: tun
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
Opened by PID 742
vnet0.28: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: associated with jail: emby2 as nic: epair0b
options=8<VLAN_MTU>
ether 02:ff:60:77:9d:9f
hwaddr 02:c8:1d:b4:5c:0a
inet6 fe80::ff:60ff:fe77:9d9f%vnet0.28 prefixlen 64 scopeid 0x6
groups: epair
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
This is ifconfig inside the jail
Code:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 02:ff:60:77:9d:a0
hwaddr 02:c8:1d:b4:5c:0b
inet 192.168.1.104 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe80::ff:60ff:fe77:9da0%epair0b prefixlen 64 scopeid 0x2
groups: epair
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
This is /etc/sysctl.conf
Code:
net.inet.ip.forwarding=1net.link.bridge.pfil_onlyip=0
net.link.bridge.pfil_bridge=0
net.link.bridge.pfil_member=0
This are the relevant bit in /etc/rc.conf
Code:
# Network configuration
ifconfig_em0="172.20.1.0/29 up"
ifconfig_igb0="inet 192.168.1.1 netmask 255.255.255.0" defaultrouter="192.168.1.1"
cloned_interfaces="bridge0"
ifconfig_bridge0="addm igb0 up"
# Start ssh and time sync
sshd_enable="YES"
ntpd_enable="YES"
# Needed for firewall and NAT
gateway_enable="YES"
Can you help me find out what is going on?