Don't get VLAN (DHCP) ip address on my Virtual Machine Guest
-
For my office I am trying to set up a VLAN for a (Nextcloud) VM which is running on top of a FreeBSD server, which is running behind a pfSense firewall and a Mikrotik Switch.
The VLAN 30 is created on the pfSense firewall and is connected to a DHCP server on pfSense. (See the ifconfig of pfSense on the left column on enclosed picture. The VLAN (ix1.30) config is encircled in red.)
click picture to enlarge
On the Mikrotik Switch the 30 ID TAG is enabled (and recognized) on both the incoming (SFP1) and outgoing (S01-IGB0) port. (See the top middle column on enclosed picture encircled in red.)
As the DHCP server is on the pfSense machine, on Freebsd I only generated a (virtual) nic with the following command:
ifconfig igb0.30 create vlan 30 vlandev igb0
Which activated the (virtual) nic (on enclosed picture encircled in red on the bottom middle column.)
In the network settings of the (Nextcloud) VM, I actived igb0.30 as the nic to be used.
But when I boot the VM, it is waiting several minutes for the network to be configured, which never happens. (See enclosed picture encircled in red on the bottom right column)
Therefor it is my impression that the VM does not get an IP-Address from the (pfSense) DHCP server. But as there is very little documentation about setting up VLAN's on Freebsd, especially about this situation where Freebs is NOT the DHCP server, but just functions as a pass trough station, I don't know what and where I did something wrong.
I would appreciate it very much if somebody could enlighten what I might be doing wrong in the pfSense/MikroTik/FreeBSD/VM chain.
-
how about microtik vlan and vlans tab ?
is freebsd able to get a dhcp response? -
I could get it working in a very strange way. Not according to the FreeBSD manual, but with the following command on the FreeBSD CLI
ifconfig vlan30 create ifconfig vlan30 192.168.30.1 netmask 255.255.255.0 vlan 30 vlandev igb0
and making it persistent by adding to /etc/rc.conf only!
ifconfig vlan30=up
So I used vlan30 instead of igbo.30 as the way it should work according to FreeBSD
I really don't understand why it works this way and I also am in a discussion with the FreeBSD administrator SirDice on https://forums.freebsd.org/threads/dont-get-vlan-dhcp-ip-address-on-my-virtual-machine-guest.77426/
So now I am very curious what is happening here. Is this the result of something pfSense or my Ubuntu 20.04 VM does (wrong?)
I really got crazy because I have spent days on this problem. I only found (by incident) a solution by trying everything I could think of, over and over again. But I really have no explanation why it works like this.
Maybe somebody at pfSense has an answer to this?
-
uhm i can be wrong but I have the impression that your vlan30 is arriving untagged
with
ifconfig vlan30 192.168.30.1 netmask 255.255.255.0 vlan 30 vlandev igb0
you are taking untagged stuff from igb0 and adding the tag vlan30 yourself instead of transporting it -
If you take a look at the Mikrotik picture of the connected hosts to the Port S01-IGB0 with MAC 08:00:27:79.03:39 it is clearly stated that the VLAN ID = 30.
And that still is the same with VLAN30 -
emp0s3 is using vlanid30 but i'm not so sure about igb0.30
sorry it's only what is coming on my mind could be stupid, as I'm not in front of your stuff and i don't own a microtick i can't tell you exactly where to look but if i was me i will trace back until i see where the vlan30 stop working, tcpdump also can help