Seems that this guy here got it working but not in my case (or freenas version):
https://www.reddit.com/r/freenas/comments/4c398j/jails_in_vlan_have_no_default_route/
Seems that everything is ok on the host:
Code:
epair0a: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1496
options=8<VLAN_MTU>
ether 02:ff:20:00:14:0a
nd6 options=1<PERFORMNUD>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
bridge1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1496
ether 02:c8:7a:06:44:01
nd6 options=1<PERFORMNUD>
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<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 20 priority 128 path cost 2000
member: vlan17 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 15 priority 128 path cost 2000000
vlan17: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1496
ether 00:bd:21:d2:00:c8
inet 192.168.17.10 netmask 0xffffff00 broadcast 192.168.17.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet autoselect
status: active
vlan: 17 parent interface: tap200
Same on the jail:
Code:
root@jumper:/ # 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>
epair0b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1496
options=8<VLAN_MTU>
ether 02:ff:70:00:15:0b
inet 192.168.17.12 netmask 0xffffff00 broadcast 192.168.17.255
nd6 options=9<PERFORMNUD,IFDISABLED>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
root@jumper:/ #
root@jumper:/ # netstat -rn
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 192.168.17.1 UGS epair0b
127.0.0.1 link#1 UH lo0
192.168.17.0/24 link#2 U epair0b
192.168.17.12 link#2 UHS lo0
But still if I run a ping from inside the jail to the default gateway:
Code:
[root@lavochkin] /mnt/RAID2x3a/jails/.jumper.meta# tcpdump -n -i tap200 | grep 192.168.17.12
tcpdump: WARNING: tap200: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tap200, link-type EN10MB (Ethernet), capture size 65535 bytes
22:35:32.600944 IP 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 20, length 64
22:35:32.600993 IP 192.168.17.1 > 192.168.17.12: ICMP echo reply, id 27, seq 20, length 64
22:35:33.638563 IP 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 21, length 64
22:35:33.638612 IP 192.168.17.1 > 192.168.17.12: ICMP echo reply, id 27, seq 21, length 64
22:35:34.678251 IP 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 22, length 64
22:35:34.678298 IP 192.168.17.1 > 192.168.17.12: ICMP echo reply, id 27, seq 22, length 64
22:35:35.680154 IP 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 23, length 64
22:35:35.680250 IP 192.168.17.1 > 192.168.17.12: ICMP echo reply, id 27, seq 23, length 64
^C112 packets captured
117 packets received by filter
0 packets dropped by kernel
[root@lavochkin] /mnt/RAID2x3a/jails/.jumper.meta# tcpdump -e -n -i tap200 | grep 192.168.17.12
tcpdump: WARNING: tap200: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tap200, link-type EN10MB (Ethernet), capture size 65535 bytes
22:35:56.996676 02:ff:70:00:15:0b > 00:a0:98:ef:ae:3a, ethertype 802.1Q (0x8100), length 102: vlan 17, p 0, ethertype IPv4, 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 44, length 64
22:35:56.996752 00:a0:98:ef:ae:3a > 02:ff:70:00:15:0b, ethertype 802.1Q (0x8100), length 102: vlan 17, p 0, ethertype IPv4, 192.168.17.1 > 192.168.17.12: ICMP echo reply, id 27, seq 44, length 64
22:35:58.001340 02:ff:70:00:15:0b > 00:a0:98:ef:ae:3a, ethertype 802.1Q (0x8100), length 102: vlan 17, p 0, ethertype IPv4, 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 45, length 64
22:35:58.001409 00:a0:98:ef:ae:3a > 02:ff:70:00:15:0b, ethertype 802.1Q (0x8100), length 102: vlan 17, p 0, ethertype IPv4, 192.168.17.1 > 192.168.17.12: ICMP echo reply, id 27, seq 45, length 64
^C38 packets captured
51 packets received by filter
0 packets dropped by kernel
[root@lavochkin] /mnt/RAID2x3a/jails/.jumper.meta#
Traffic correctly reaches the firewall and it answers. But for some reason the parent interface doesn't forward this to the vlan interface:
Code:
[root@lavochkin] /mnt/RAID2x3a/jails/.jumper.meta# tcpdump -e -n -i vlan17 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on vlan17, link-type EN10MB (Ethernet), capture size 65535 bytes
22:38:43.860253 02:ff:70:00:15:0b > 00:a0:98:ef:ae:3a, ethertype IPv4 (0x0800), length 98: 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 208, length 64
22:38:44.883199 02:ff:70:00:15:0b > 00:a0:98:ef:ae:3a, ethertype IPv4 (0x0800), length 98: 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 209, length 64
22:38:45.913242 02:ff:70:00:15:0b > 00:a0:98:ef:ae:3a, ethertype IPv4 (0x0800), length 98: 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 210, length 64
22:38:46.922355 02:ff:70:00:15:0b > 00:a0:98:ef:ae:3a, ethertype IPv4 (0x0800), length 98: 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 211, length 64
22:38:47.922943 02:ff:70:00:15:0b > 00:a0:98:ef:ae:3a, ethertype IPv4 (0x0800), length 98: 192.168.17.12 > 192.168.17.1: ICMP echo request, id 27, seq 212, length 64
Someone is stealing my ping replies. Please, I hope someone helps me because this is becoming an obsession.
By the way, another solution would be to just create the epair against the tagged interface and then create the vlan interface inside the jail, using the epair as it's parent. But I see no way to do this.
Found this article but no idea if it can apply to freenas.
https://gist.github.com/sdebnath/086874c5df8b68e0df69
I hope someone lend me a hand because this is becoming an obsession.