Proxmox Setup Guide with Open vSwitch and VLANs
https://benheater.com/proxmox-laptop-cybersecurity-lab/
1. Access the Web Console
- Navigate to:
https://<proxmox-ip>:8006(e.g.,https://10.0.0.100:8006). - Login:
- Username:
root - Password: Set during installation.
- Username:
- Ignore the “no subscription” warning.
2. Initial Configuration
-
Update APT Repositories:
sed '/^[^#]/ s/^/# /' -i /etc/apt/sources.list.d/pve-enterprise.list sed '/^[^#]/ s/^/# /' -i /etc/apt/sources.list.d/ceph.list echo -e '\n# Proxmox community package repository' >> /etc/apt/sources.list echo "deb http://download.proxmox.com/debian/pve $(grep CODENAME /etc/os-release | cut -d '=' -f 2) pve-no-subscription" >> /etc/apt/sources.list -
Install Dependencies:
apt clean && apt update apt install ifupdown2 openvswitch-switch -y -
Disable Lid Suspend (for laptops):
-
Edit
/etc/systemd/logind.conf:HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore HandleLidSwitchDocked=ignore -
Restart login service:
systemctl restart systemd-logind.service
-
-
Apply Pending Upgrades:
pveupgrade⚠️ Reboot if a kernel update is installed.
3. Switch to Open vSwitch (OVS)
-
Backup Current Network Configuration:
cp /etc/network/interfaces /etc/network/interfaces.bak -
Remove the Default Linux Bridge:
- Navigate to [Node Name] > Network in the web UI.
- Select
vmbr0and click Remove.
-
Create New OVS Components:
-
Production Switch (ovsbr0):
- Create an OVS Bridge and attach the physical NIC (e.g.,
enp0s31f6). - Use this for external access (e.g., Proxmox management and internet).
- Create an OVS Bridge and attach the physical NIC (e.g.,
-
Management Interface:
- Create an OVS IntPort for Proxmox management.
- Assign a static IP (e.g.,
10.0.0.100/24) and gateway (e.g.,10.0.0.1).
-
Internal Switch (vmbr1):
- Create another OVS Bridge without a physical port.
- Use this for pfSense and VLANs.
-
4. VLAN Configuration
-
Create VLANs on Internal Switch (vmbr1):
-
VLAN 333: For Root Domain VMs (e.g., domain controllers).
- Create OVS IntPort: Name
vlan_333with VLAN tag333.
- Create OVS IntPort: Name
-
VLAN 666: For Red Domain.
- Create OVS IntPort: Name
vlan_666with VLAN tag666.
- Create OVS IntPort: Name
-
VLAN 999: For Blue Domain.
- Create OVS IntPort: Name
vlan_999with VLAN tag999.
- Create OVS IntPort: Name
-
-
Verify Configuration:
- Check that
vmbr1has the VLANs listed as ports.
- Check that
5. pfSense Integration
-
Assign two NICs to the pfSense VM:
- NIC 1 (WAN): Connect to
vmbr0for internet access. - NIC 2 (LAN): Connect to
vmbr1for internal routing.
- NIC 1 (WAN): Connect to
-
Configure pfSense:
- WAN Interface:
- Set to DHCP to get an IP from the router.
- LAN Interface:
- Assign a static IP (e.g.,
10.0.1.1/24) and enable DHCP for VMs on VLANs.
- Assign a static IP (e.g.,
- WAN Interface:
-
Test:
- Ensure VMs in different VLANs can communicate only through pfSense.
6. Network Topology Overview
- vmbr0 (Production Switch):
- Physical NIC connected to external router for internet.
- Proxmox Management (via
vmbr0_mgmtIntPort).
- vmbr1 (Internal Switch):
- VLAN 333: Root domain.
- VLAN 666: Red domain.
- VLAN 999: Blue domain.
- pfSense:
- Routes traffic between
vmbr0(WAN) andvmbr1VLANs (LAN).
- Routes traffic between
Troubleshooting
-
If connectivity issues arise:
cp /etc/network/interfaces.bak /etc/network/interfaces ifreload -a -
Reapply changes step by step.