# Proxmox Bare Metal Setup Guide with Trunk Interface and Management VLAN

#### **Prerequisites**

1. **Hardware Requirements:**
    - A server that meets Proxmox VE minimum hardware requirements.
    - Two or more network interfaces (preferred, but one NIC can work with VLAN tagging).
2. **Software Requirements:**
    - Download the latest Proxmox VE ISO from the [Proxmox website](https://www.proxmox.com/).
    - Create a bootable USB using tools like Rufus or Balena Etcher.
3. **Network Configuration Details:**
    - Trunk interface capable of handling multiple VLANs.
    - Management VLAN ID (e.g., VLAN 10).
    - IP address for the Proxmox management interface.

---

### **Step 1: Install Proxmox VE**

1. **Boot from Proxmox ISO:**
    
    
    - Insert the bootable USB into the server and boot into the Proxmox installer.
    - Follow the on-screen instructions to install Proxmox VE on the desired disk.
2. **Configure the Basics:**
    
    
    - Set a hostname for your Proxmox server (e.g., `proxmox.example.com`).
    - Configure the initial network settings. For now, use a static IP for the management VLAN or assign one temporarily.
3. **Reboot:**
    
    
    - Once the installation is complete, reboot the server. Access the Proxmox web GUI using the IP address configured earlier.

---

### **Step 2: Configure Networking for VLANs**

1. **Login to Proxmox Shell:**
    
    
    - Access the shell directly or via SSH after initial setup.
2. **Edit the Network Configuration File:**
    
    
    - Open the network configuration file:
        
        <div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950"><div class="sticky top-9 md:top-[5.75rem]"></div><div class="overflow-y-auto p-4" dir="ltr">`nano /etc/network/interfaces`</div></div>
    - Configure the physical network interface as a trunk port and add the management VLAN interface. Replace `enp0s31f6` with your actual network interface name (check with `ip link`).
        
        Example configuration:
        
        <div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950"><div class="sticky top-9 md:top-[5.75rem]"></div><div class="overflow-y-auto p-4" dir="ltr">`auto loiface lo inet loopbackauto enp0s31f6iface enp0s31f6 inet manualauto vmbr0iface vmbr0 inet static    address 192.168.10.2/24    gateway 192.168.10.1    bridge-ports enp0s31f6    bridge-stp off    bridge-fd 0    vlan-raw-device enp0s31f6`</div></div>
    - Add the management VLAN configuration (VLAN ID 10 in this example):
        
        <div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950"><div class="sticky top-9 md:top-[5.75rem]"></div><div class="overflow-y-auto p-4" dir="ltr">`auto vmbr0.10iface vmbr0.10 inet static    address 192.168.10.2/24    vlan-raw-device vmbr0`</div></div>
3. **Apply the Configuration:**
    
    
    - Restart networking:
        
        <div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950"><div class="sticky top-9 md:top-[5.75rem]"></div><div class="overflow-y-auto p-4" dir="ltr">`systemctl restart networking`</div></div>
    - Ensure the Proxmox web GUI is accessible via the management VLAN’s IP.

---

### **Step 3: Configure Proxmox for VMs Using VLANs**

1. **Create a Bridge for Each VLAN (Optional):**
    
    
    - If you want VMs to communicate over specific VLANs, create additional bridges for those VLANs in the `/etc/network/interfaces` file. Example: <div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950"><div class="sticky top-9 md:top-[5.75rem]"></div><div class="overflow-y-auto p-4" dir="ltr">`auto vmbr10iface vmbr10 inet manual    bridge-ports enp0s31f6.10    bridge-stp off    bridge-fd 0`</div></div>
2. **Assign VLANs in VM Settings:**
    
    
    - When creating or editing a VM, go to the **Network** section and: 
        - Select the appropriate bridge (e.g., `vmbr10` for VLAN 10).
        - Configure the VLAN tag directly in the VM’s network interface settings if using a trunk bridge (e.g., `vmbr0`).

---

### **Step 4: Verify Configuration**

1. **Test Connectivity:**
    
    
    - Verify that Proxmox is reachable via the management VLAN.
    - Ping from a device on the same VLAN to confirm connectivity.
2. **Test VLAN Trunking:**
    
    
    - Deploy a test VM and assign it to a specific VLAN. Ensure the VM gets an IP address from the correct VLAN and can communicate with other devices.
3. **Validate Trunking:**
    
    
    - Use `tcpdump` or similar tools to verify tagged packets on the trunk interface: <div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950"><div class="sticky top-9 md:top-[5.75rem]"></div><div class="overflow-y-auto p-4" dir="ltr">`tcpdump -i enp0s31f6 vlan`</div></div>

---

### **Final Notes**

- **Firewall:** Ensure your Proxmox firewall rules allow access to the web GUI and SSH on the management VLAN.
- **VLAN-Specific Switch Configuration:** On your network switch, configure the server’s switch port as a trunk and allow the necessary VLANs.
- **Backup:** Always back up the `interfaces` file before making changes.