Hi,
On my FreeBSD 11.2 box I've setup a VLAN to be used for several jails. For that particular VLAN I've also setup a separate routing table using FIB. Now I would like to be able to access the default gateway from my VNET. However I do not get that working.
The host has ip 192.168.178.15 and part of the network 192.168.178.0/24. The VLAN has network 192.168.180.0/24 on which I have two jails running, 192.168.180.2 and 192.168.180.3. I consider 192.168.180.1 as the gateway address of the VLAN. I use routed to manage the routing however previously I tried static routes.
Now I can ping the hosts ip address from the VLAN:
but not beyond to the default router:
Should I be able to set a defaultrouter for the VNET/FIB1? Is that possible, I could not find anything on that.
Or should I do this with bridges or possibly even better with real NIC's?
This is the relevant rc.conf config:
My interfaces are setup as follows:
And these are the routing tables:
Thanks,
Guido
On my FreeBSD 11.2 box I've setup a VLAN to be used for several jails. For that particular VLAN I've also setup a separate routing table using FIB. Now I would like to be able to access the default gateway from my VNET. However I do not get that working.
The host has ip 192.168.178.15 and part of the network 192.168.178.0/24. The VLAN has network 192.168.180.0/24 on which I have two jails running, 192.168.180.2 and 192.168.180.3. I consider 192.168.180.1 as the gateway address of the VLAN. I use routed to manage the routing however previously I tried static routes.
Now I can ping the hosts ip address from the VLAN:
Code:
$ ping -S 192.168.180.1 192.168.178.15
PING 192.168.178.15 (192.168.178.15) from 192.168.180.1: 56 data bytes
64 bytes from 192.168.178.15: icmp_seq=0 ttl=64 time=0.018 ms
64 bytes from 192.168.178.15: icmp_seq=1 ttl=64 time=0.045 ms
but not beyond to the default router:
Code:
$ ping -S 192.168.180.1 192.168.178.1
PING 192.168.178.1 (192.168.178.1) from 192.168.180.1: 56 data bytes
<... nothing happens here>
Should I be able to set a defaultrouter for the VNET/FIB1? Is that possible, I could not find anything on that.
Or should I do this with bridges or possibly even better with real NIC's?
This is the relevant rc.conf config:
Code:
ifconfig_em0="inet 192.168.178.15/24 fib 0"
defaultrouter="192.168.178.1"
vlans_em0="1"
ifconfig_em0_1="inet 192.168.180.1/24 fib 1"
gateway_enable="YES"
routed_enable="YES"
My interfaces are setup as follows:
Code:
$ ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC>
ether 70:85:c2:29:b2:9e
hwaddr 70:85:c2:29:b2:9e
inet 192.168.178.15 netmask 0xffffff00 broadcast 192.168.178.255
inet6 fe80::7285:c2ff:fe29:b29e%em0 prefixlen 64 scopeid 0x1
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
$ ifconfig em0.1
em0.1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=3<RXCSUM,TXCSUM>
ether 70:85:c2:29:b2:9e
inet 192.168.180.1 netmask 0xffffff00 broadcast 192.168.180.255
inet 192.168.180.2 netmask 0xffffff00 broadcast 192.168.180.255
inet 192.168.180.3 netmask 0xffffff00 broadcast 192.168.180.255
inet6 fe80::7285:c2ff:fe29:b29e%em0.1 prefixlen 64 scopeid 0xa
nd6 options=61<PERFORMNUD,AUTO_LINKLOCAL,NO_RADR>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
fib: 1
vlan: 1 vlanpcp: 0 parent interface: em0
groups: vlan
And these are the routing tables:
Code:
$ netstat -nr4 -F 0
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 192.168.178.1 UGS em0
127.0.0.1 link#2 UH lo0
127.0.2.1 link#4 UH lo2
127.0.3.1 link#5 UH lo3
192.168.178.0/24 link#1 U em0
192.168.178.15 link#1 UHS lo0
192.168.180.0/24 192.168.180.1 U em0.1
and
$ netstat -nr4 -F 1
Routing tables (fib: 1)
Internet:
Destination Gateway Flags Netif Expire
127.0.0.1 lo0 UHS lo0
192.168.180.0/24 link#10 U em0.1
192.168.180.1 link#10 UHS lo0
192.168.180.2 link#10 UHS lo0
192.168.180.3 link#10 UHS lo0
Thanks,
Guido