How to add a network bridge in Proxmox

Helposoft Staff

Administrator
Staff member
Points
178
To add a network bridge in Proxmox and ensure your virtual machines can communicate with each other and the external network, you need to follow these steps:

Step 1: Create a Network Bridge in Proxmox​

  1. Access Proxmox Web Interface:
    • Open your web browser and navigate to https://your_server_ip:8006 and log in.
  2. Navigate to Network Configuration:
    • Go to Datacenter > your node > System > Network.
  3. Add a Bridge:
    • Click on Create > Linux Bridge.
    • Configure the bridge with the following settings:
      • Name: Assign a name to the bridge (e.g., vmbr1).
      • Bridge Ports: Select the physical network interface you want to bridge (e.g., eth0).
      • IPv4/CIDR: (Optional) You can leave this blank or configure an IP address for management purposes.
      • Gateway: (Optional) Configure the gateway if necessary.
  4. Save the Configuration:
    • Click Create and then Apply Configuration to save the changes.

Step 2: Configure the Bridge in the VM​

After creating the bridge in Proxmox, you need to configure the virtual machine to use this bridge.
  1. Edit VM Network Settings:
    • Go to Datacenter > your node > your VM > Hardware.
    • Select the Network Device (usually net0) and click Edit.
    • Change the Bridge setting to the newly created bridge (e.g., vmbr1).
  2. Save and Restart VM:
    • Save the settings and restart the VM to apply the changes.

Step 3: Configure Networking Inside the VM​

  1. Access the VM:
    • Open the VM console from Proxmox or SSH into the VM if it has network access.
  2. Edit Network Configuration:
    • In AlmaLinux, network configuration files are typically located in /etc/sysconfig/network-scripts/.
    • Edit the configuration file for your network interface (e.g., ifcfg-eth0).
  3. Example Configuration for Static IP:
    Code:
    sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0

  4. Update the file with your network settings:

    Code:
    TYPE=Ethernet
    BOOTPROTO=static
    NAME=eth0
    DEVICE=eth0
    ONBOOT=yes
    IPADDR=your_vm_ip
    NETMASK=255.255.255.0
    GATEWAY=your_gateway_ip
    DNS1=8.8.8.8
  5. Restart Network Service:
    Code:
    sudo systemctl restart network

Example Configuration:​

  • Proxmox Bridge (vmbr1) Settings:
    • Name: vmbr1
    • Bridge Ports: eth0
    • IPv4/CIDR: 192.168.1.1/24 (example for management)
    • Gateway: 192.168.1.254 (if needed)
  • VM Network Configuration:
    Code:
    TYPE=Ethernet
    BOOTPROTO=static
    NAME=eth0
    DEVICE=eth0
    ONBOOT=yes
    IPADDR=192.168.1.100
    NETMASK=255.255.255.0
    GATEWAY=192.168.1.254
    DNS1=8.8.8.8

Additional Notes:​

  • DHCP: If you prefer to use DHCP, you can set BOOTPROTO=dhcp instead of static settings.
  • Testing: Always test the network connectivity after making changes by pinging the gateway or an external IP.
By following these steps, you should have a working bridge in Proxmox and properly configured network settings for your AlmaLinux VM.
 
Top