since changing from warden jails to iocage i could never get VNET to work. the only way to get the networking going on the iocage is to use a the physical interface. this apply when the FN was installed on barebone metal as well as vmware. referring to your questions not sure what is happening but it feels like FN / iocage doesn't remove the VNET setting when destroying the jail unless i reboot FN. when and recreating the new jail it adds another VNET to the jail.
in the past i also tried this changes but didn't help.
Here are the outputs following your instructions, however there are no multiple vnet after destroying the jail but networking still not working. i can ping the jail from FN shell but cant ping the Gateway IP from the jail shell.
Code:
root@freenas[~]# iocage destroy test
This will destroy jail test
Are you sure? [y/N]: y
Stopping test
Destroying test
root@freenas[~]# ifconfig
vmx0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,RXCSUM_IPV6,TXCSUM_IPV6>
ether 00:0c:29:78:24:29
hwaddr 00:0c:29:78:24:29
inet 10.55.1.2 netmask 0xffff0000 broadcast 10.55.255.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: active
vmx1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,RXCSUM_IPV6,TXCSUM_IPV6>
ether 00:0c:29:78:24:33
hwaddr 00:0c:29:78:24:33
inet 192.168.1.6 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 02:c1:e1:57:6c:00
nd6 options=1<PERFORMNUD>
groups: bridge
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: vmx1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 2 priority 128 path cost 2000
root@freenas[~]#
Code:
root@freenas[~]# ifconfig
vmx0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,RXCSUM_IPV6,TXCSUM_IPV6>
ether 00:0c:29:78:24:29
hwaddr 00:0c:29:78:24:29
inet 10.55.1.2 netmask 0xffff0000 broadcast 10.55.255.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: active
vmx1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,RXCSUM_IPV6,TXCSUM_IPV6>
ether 00:0c:29:78:24:33
hwaddr 00:0c:29:78:24:33
inet 192.168.1.6 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
root@freenas[~]# iocage list -l
+-----+------------------+------+-------+------+-----------------+---------------------+-----+----------+
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE |
+=====+==================+======+=======+======+=================+=====================+=====+==========+
| 1 | UniFi_Controller | on | up | jail | 11.2-RELEASE-p3 | vmx1|192.168.1.5/24 | - | - |
+-----+------------------+------+-------+------+-----------------+---------------------+-----+----------+
root@freenas[~]# iocage create -r 11.2-RELEASE -n test ip4_addr="vnet0|192.168.1.40/24" defaultrouter=192.168.1.1 vnet=on boot=on allow_raw_sockets=1
test successfully created!
* Starting test
+ Started OK
+ Configuring VNET OK
+ Starting services OK
root@freenas[~]# iocage list -l
+-----+------------------+------+-------+------+-----------------+-----------------------+-----+----------+
| JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE |
+=====+==================+======+=======+======+=================+=======================+=====+==========+
| 1 | UniFi_Controller | on | up | jail | 11.2-RELEASE-p3 | vmx1|192.168.1.5/24 | - | - |
+-----+------------------+------+-------+------+-----------------+-----------------------+-----+----------+
| 2 | test | on | up | jail | 11.2-RELEASE-p3 | vnet0|192.168.1.40/24 | - | - |
+-----+------------------+------+-------+------+-----------------+-----------------------+-----+----------+
root@freenas[~]# ifconfig
vmx0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,RXCSUM_IPV6,TXCSUM_IPV6>
ether 00:0c:29:78:24:29
hwaddr 00:0c:29:78:24:29
inet 10.55.1.2 netmask 0xffff0000 broadcast 10.55.255.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: active
vmx1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=200099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,RXCSUM_IPV6>
ether 00:0c:29:78:24:33
hwaddr 00:0c:29:78:24:33
inet 192.168.1.6 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 02:c1:e1:57:6c:00
nd6 options=1<PERFORMNUD>
groups: bridge
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: vnet0:2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 5 priority 128 path cost 2000
member: vmx1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 2 priority 128 path cost 2000
vnet0:2: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: associated with jail: test
options=8<VLAN_MTU>
ether 02:ff:60:ae:1b:75
hwaddr 02:da:d0:00:05:0a
nd6 options=1<PERFORMNUD>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
groups: epair
root@freenas[~]# ping 192.168.1.40
PING 192.168.1.40 (192.168.1.40): 56 data bytes
64 bytes from 192.168.1.40: icmp_seq=0 ttl=64 time=0.077 ms
64 bytes from 192.168.1.40: icmp_seq=1 ttl=64 time=0.102 ms
64 bytes from 192.168.1.40: icmp_seq=2 ttl=64 time=0.113 ms
^C
--- 192.168.1.40 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.077/0.097/0.113/0.015 ms
root@freenas[~]# iocage console test
FreeBSD 11.2-STABLE (FreeNAS.amd64) #0 r325575+fc3d65faae6(HEAD): Thu Dec 20 16:12:30 EST 2018
Welcome to FreeBSD!
Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories: https://www.FreeBSD.org/security/
FreeBSD Handbook: https://www.FreeBSD.org/handbook/
FreeBSD FAQ: https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums: https://forums.FreeBSD.org/
Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with: pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.
Show the version of FreeBSD installed: freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages: man man
FreeBSD directory layout: man hier
Edit /etc/motd to change this login announcement.
root@test:~ # ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
epair0b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 02:ff:60:ae:1b:76
hwaddr 02:da:d0:00:06:0b
inet 192.168.1.40 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=1<PERFORMNUD>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
groups: epair
root@test:~ # ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down
^C
--- 192.168.1.1 ping statistics ---
11 packets transmitted, 0 packets received, 100.0% packet loss
root@test:~ # exit
logout
root@freenas[~]# ifconfig
vmx0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
options=60039b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,RXCSUM_IPV6,TXCSUM_IPV6>
ether 00:0c:29:78:24:29
hwaddr 00:0c:29:78:24:29
inet 10.55.1.2 netmask 0xffff0000 broadcast 10.55.255.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: active
vmx1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=200099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,RXCSUM_IPV6>
ether 00:0c:29:78:24:33
hwaddr 00:0c:29:78:24:33
inet 192.168.1.6 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 02:c1:e1:57:6c:00
nd6 options=1<PERFORMNUD>
groups: bridge
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: vnet0:2 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 5 priority 128 path cost 2000
member: vmx1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 2 priority 128 path cost 2000
vnet0:2: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
description: associated with jail: test
options=8<VLAN_MTU>
ether 02:ff:60:ae:1b:75
hwaddr 02:da:d0:00:05:0a
nd6 options=1<PERFORMNUD>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
groups: epair
root@freenas[~]# tail -f /var/log/messages
Jan 5 10:31:12 freenas epair0b: Ethernet address: 02:da:d0:00:06:0b
Jan 5 10:31:12 freenas kernel: epair0a: link state changed to UP
Jan 5 10:31:12 freenas kernel: epair0a: link state changed to UP
Jan 5 10:31:12 freenas kernel: epair0b: link state changed to UP
Jan 5 10:31:12 freenas kernel: epair0b: link state changed to UP
Jan 5 10:31:12 freenas kernel: epair0a: changing name to 'vnet0:2'
Jan 5 10:31:13 freenas kernel: bridge0: link state changed to UP
Jan 5 10:31:13 freenas kernel: bridge0: link state changed to UP
Jan 5 10:31:13 freenas kernel: vmx1: promiscuous mode enabled
Jan 5 10:31:13 freenas kernel: vnet0:2: promiscuous mode enabled
^C
root@freenas[~]#