How to configure OpenWRT as virtual switch to route trafic of my VM?

JohnDoe49

New Member
Feb 5, 2024
1
0
1
I want to use OpenWRT as a virtual router to route the trafic of my VM (I'm not sure how to make it work with vlan). I've tried everything based on my knodledge of networking but I can't figure out what's wrong with my settings.

1. I set up two Linux Bridge vmbr0 and vmbr1, and vmbr0 is the proxmox gateway with an IP address of 192.168.1.252.
01.jpg

2. I've created the OpenWRT vm and added two network devices eth0(vmbr0) as WAN and eth1(vmbr1) as LAN. Then eth0 got an IP address of 192.168.1.71, and via the OpenWRT webui I have enabled the DHCP Server
on the LAN.
03.jpg
02.jpg
3. Finally, on my other VM (Ubuntu) I added vmbr1 as the network device. But somehow the VM can't get an IP.
04.jpg
 
I pretty sure you have the configuration wrong on openwrt.
The eth1 you should manually assign a static IP (eg 10.0.0.1) and then enable the DHCP server on the eth1 interface. Maybe look at tutorials on internet/youtube to confirm. If you have it config as "Client DHCP", it is looking for a DHCP server on your internal vmbr1 network.

If you want help, please make it easy for others, for example, posting how did you install openwrt and your bridge configure ( /etc/network/interfaces)


Just as a note, I have a PC with a single ethernet port, linked to vmbr0 (as per proxmox default config).
I then created a virtual vmbr1 for openwrt. So pretty much like you have done.

I created an OpenWRT using tteck script (https://github.com/tteck/Proxmox)
The main config I typed was:
WAN Bridge = vmbr0
LAN Bridge = vmbr1
Router IP = 10.0.0.1

Do notice that the script by default uses a LAN VLAN Tag of 999.
If you don't add a tag on the network configuration of the VMs/CTs, then they will not have connectivity to the openwrt neither ping to outside world.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!