I have configured 2 subnets, A for regular use, and B for IoT
I have 1 physical machine (which has only 1 NIC) connected to OpenWrt LAN port1 running multiple virtual machines (using Proxmox)
How do I get a virtual machine to be in A and another to be in B?
I have tried adding 1 more Linux Bridge vmbr1 in Proxmox and made the new VM use vmbr1, but it fails to get an IP using DHCP
I think my issue is, I'm not sure if I have to configure OpenwWrt/Proxmox or both and unsure of the specific technical terms to google the documentation. Any help is greatly appreciated. Thank you.
In my VM sernaio, I configure VLANs on the OpenWrt and trunk both networks' traffic to the physical VM host.
I then use VirtualBox and default Ubuntu networking to establish the networks proper on the host - so I'm not sure how the settings work with varying host software, but it should be similar.
Host configuration is outside the scope of the forum.
Yes, but VLANs aren't enabled normally on all OpenWrt devices (i.e., DSA switches)
Actually, we need to see your config, as it differs based on devices and OpenWrt version
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
ubus call system board
cat /etc/config/network
cat /etc/config/dhcp
cat /etc/config/firewall
Yes - that is the port that is trunked in the example
VLAN1 is the Software VLAN number used to trunk the main OpenWrt network named "LAN"
I don't understand the question - the example just did that (in the past, it wasn't advised to mixed tagged networks with an untagged one anyway - I assume it merely provides a modern example where it's done)
In your case, you may wish to tag both [V]LANs you send, or do as the example, so the host gets an IP on that untagged network without additional configuration (if the host OS will handle both tagged and untagged) - your choice.
Thanks, I asked about the untagged VLAN because of the next scenario: if VLAN2 can be untagged, can I send both VLANS untagged? I'm guessing the answer is no.
I think your answer also addressed my next concern about tagging, what happens if I wipe my Proxmox and restart from scratch, is it able to get to the internet on that trunked cable... And it can, if and only if, there is an untagged VLAN (to be used as a default), correct?
Let me think through this a bit and give it a shot.
You are correct. That is akin to incorrectly plugging to physical LANs together, I'm actually not sure how the scenario solves your original issue, though.
Which makes me think, you could merely add another network number to the same interface (i.e., 2 subnets) - I only considered because you made this inquiry.
Well, I donno how you host works. In most modern OSes, it is possible to configure the port to take connection on a tagged VLAN on the Ethernet interface.
In my case, my Ubuntu host is configured to connect normally to the Ethernet interface and not wait for an IP. I then configure the VLAN x configuration for that said Ethernet connection - as a normal IPv4/IPv6 client. I then enumerate the other VLANs (not to obtain IPs), so the VM Software can recognize them for client configs.
(for future readers)
Windows also has a similar config.
I don't remember the installer options for Proxmox exactly, but we shall not further digress here. I was just trying to factor in the worst case recovery scenarios.
Do you know how I can do what you suggested? Sending the packets of 2 subnets on 1 port?
Yea, it's called routing - and it's not clear the use case or purpose, so it's difficult to answer with certainty.
In general, if you mean actually address the OpenWrt's LAN as both 192.168.214.1/24 and 192.168.247.1/24 - yes that's possible also. But this is not advised or standard configuration (in /etc/config/network change to option list address and make 2 entries for each), especially since your eventual use case for doing so isn't clear.
There's even a further non-standard config users manage to create 2 OpenWrt interfaces on the same PHY - and address them differently. But in this case they also manage to place them in different firewall zones. I digress here to say, it usually causes more issues than it solved.
I assume port 1 is your trunk and you at least setup VLAN 2 according to the host OS and Proxmox and you setup br-lan.1 and 2 on the OpenWrt and converted the original LAN?
I'm guessing you didn't follow the steps to make br-lan.1 and br-lan.2 out of your 2 networks?
You convert them to br-lan.x and tag them on the trunk port
I can't guess what you wish, so I don't know which network you intend for the VM, or which to be untagged and why, etc.