Vlan configuration for Bhyve

A packet filter is not a router.
I see I see. I usually add routes using route add command (unless those routes aren't added automatically by the system).
But in case of VLAN sitting on the same NIC with LAN, one being 1.2.3.4 and other 1.2.7.8 (for example), who's doing the routing? The only host common for both networks is LOCALHOST. But which IP address should be used as gateway in case of adding route via route utility? Here's whaere I'm not clear😁😁
 
The VLANs are on vlan(4) interfaces, routing works just as with 'regular' ethernet interfaces like em0 or re1. Why do you think it works differently? A VLAN is a layer 2 network separation. It just allows you to run two or more separate layer 2 networks on the same wire.

But which IP address should be used as gateway in case of adding route via route utility?
The gateway that's appropriate for that subnet. If you have 10.0.1.0/24 and 10.0.2.0/24 for example their gateways are typically 10.0.1.1 and 10.0.2.1 respectively. The router running on 10.0.1.1 and 10.0.2.1 would route the traffic between those two subnets.
 
The VLANs are on vlan(4) interfaces, routing works just as with 'regular' ethernet interfaces like em0 or re1. Why do you think it works differently? A VLAN is a layer 2 network separation. It just allows you to run two or more separate layer 2 networks on the same wire.


The gateway that's appropriate for that subnet. If you have 10.0.1.0/24 and 10.0.2.0/24 for example their gateways are typically 10.0.1.1 and 10.0.2.1 respectively. The router running on 10.0.1.1 and 10.0.2.1 would route the traffic between those two subnets.
Thank you. It's all about my crazy idea to run OpenBSD in bhyve VM and have it do the routing for the host. But the problem is, it's a compact PC, the CPU doesn't support pci passthrough. So I'll have to give a tapN interface to VM to connect to all 3 NICs. I'm trying to figure out how to do this so that ip forwarding would be disabled on the host itself (so it won't be used as router).
 
Thank you. It's all about my crazy idea to run OpenBSD in bhyve VM and have it do the routing for the host. But the problem is, it's a compact PC, the CPU doesn't support pci passthrough. So I'll have to give a tapN interface to VM to connect to all 3 NICs. I'm trying to figure out how to do this so that ip forwarding would be disabled on the host itself (so it won't be used as router).
But I think I get it now. Since the whole thing is LOGICAL, I must follow the logic. And any IP of any LAN or VLAN that's on localhost is accessible without forwarding, right? Forwarding is only for OTHER hosts, correct?
 
Forwarding is only for OTHER hosts, correct?
Careful with the wording here. Routing, aka gateway_enable enables routing between interfaces. So traffic coming in on one interface can go out of another.
 
Back
Top