A web-based container-ready Virtual Router project primarily (but not exclusively!) for Proxmox environments, suitable for creating lab networks easily via a web interface.
This project is not associated with the official Proxmox project, however it is very much intended to be complimentary in that it provides a soft router platform which is intended to be easily run as a lightweight container or VM-based Proxmox-friendly virtual router layer for Virtualized environments.
If this project goal interests you and you have further questions, feel free to read through the FAQ which may cover your question in more detail.
Project Aim:
- Provide a lightweight container-friendly router instance for Proxmox installs - no need for firmware or interfacing with a proprietary router solution. It can be built on container, VM or hardware devices.
- Model functionality on the VMWare Workstation VMNet functionality - allow easy spinning up of networks, primarily for lab testing, but with richer functionality and a web interface.
The purpose of this project is to put together a particular network pattern useful for quickly spinning up and down virtual networks using more than one Proxmox host. This is to hopefully provide a similar ease of use to VMWare VMNet interfaces in VMWare workstation, but without the limitations of single-host virtual networking.
To do this, we offer a simple web interface with the following features:
- Add VLAN interfaces with a given IP address using OpenVSwitch internal interfaces
- Setting a routing table per interface (if desired) and allowing or denying Internet access per interface
Implementing this project consists of a pair of OpenVSwitch switches, one (or more) on each Proxmox node in the cluster, and one (or more) within a VM. The Proxmox VMs trunk VLANs from their ovs switch to the VM, which acts as a router.
The following steps will get you up and running:
-
Deploy an Ubuntu 20.04 Container or VM. The following configuration should be used:
- VM CPU Cores: 1
- RAM: Minimum 512MB
- Network Interfaces: 2 interfaces
- Interface 1: Management. Should be in VLAN 1
You should deploy 2 Containers or VMs if you are running in HA mode. Keep in mind, HA mode needs to be running across two different Proxmox cluster nodes
-
Install the following packages:
apt-get install apache2 libapache2-mod-php7.4 php7.4-mbstring php7.4-sqlite
- If you would like VPN functionality, add the following packages:
apt-get install openssl openvpn
- If you would like VPN functionality, add the following packages:
-
Clone this git repository under /var/www/html
cd /var/www/html
rm index.html
git clone https://github.com/ngardiner/proxmox_vswrouter .
chown -R www-data:www-data /var/www/html
- Enable PHP and restart apache
a2enmod php7.4
service apache2 restart
-
Access the web interface at
http://[ip address]/
-
Go to the settings tab. This is where you can configure the vswitches that will be used.
- Your installation, whether Single or Double (Q-in-Q) VLAN tagged will have one VLAN Trunk. Create it first.
- You are then able to create Q-in-Q switches and connect them to VLANs on the VLAN Trunk switch.
-
Enable the cron script which will configure all of the settings
cd /var/www/html
cp docs/cron.conf /etc/cron.d/pvsw_agent
- Bridges
- New bridge - implemented
- Delete bridge - not implemented
- Interfaces
- Create VLAN IP interfaces - implemented (non-HA only)
- Delete VLAN IP interfaces - implemented (non-HA only)
- Update incorrect IP address - implemented (non-HA only)
- Routing Tables
- Define routing table - implemented
- Define routing table routes - not implemented
- Enforce routing table - not implemented
- VPN
- Define VPN configuration - in progress
- Restart on VPN reconfiguration - not implemented