Prerequisite

  • A dedicated server (Pre-installed PVE)
  • Public IP address (Optional, but you must be able to access the server)
  • Internet

Getting Started 🚀

Download OpenWrt image file

cd /var/lib/vz/template/iso
wget https://downloads.openwrt.org/releases/24.10.3/targets/x86/64/openwrt-24.10.3-x86-64-generic-squashfs-combined-efi.img.gz
gunzip openwrt-24.10.3-x86-64-generic-squashfs-combined-efi.img.gz

You can select other versions and architectures. Click Here

Create an empty virtual machine

  1. OS tab: Select Do not use any media
  2. System tab:
    1. BIOS: SeaBIOS
    2. Other optional: custom
  3. Disks tab: Delete all disk
  4. CPU:
    1. Select Advanced and set CPU units value is 1024 (Optional)
    2. Other optional: custom
  5. Memory tab: custom
  6. Network tab:
    1. Bridge: Select a bridge that can access the Internet
    2. Other optional: custom
  7. Finish

Import image to virtual machine

  1. Import image
# 101 is your vm id
# local is your storage name
qm importdisk 101 /var/lib/vz/template/iso/openwrt-24.10.3-x86-64-generic-squashfs-combined-efi.img local
  1. Double click imported disk in vm hardware menu
    1. Bus/Device: Select SATA
    2. Other optional: custom

Set vm boot order and add a network interface card

  1. Navigate to the vm Options menu
  2. Double click Boot Order option, and only select just imported disk, and click OK button
  3. Back to Hardware menu
  4. Click Add button and select Network Device item in dropdown
    1. Bridge: Select a bridge [See Tips]
    2. Other optional: custom

Tips: Can remain in the same VNet as the first NIC, but only allow one gateway (Subnet or OpenWrt) with DHCP enabled

Start the virtual machine and connect to Internet

You need a virtual machine connected to the same bridge as OpenWrt net0

If you don’t have the same vm ? Please create it.

  1. Enter http://192.168.1.1 in browser
  2. Navigate to Network menu and select Interfaces item
  3. Click Add new interface... button
  4. Enter some informations:
    1. Name: You can enter wan (recommended) or other name
    2. Protocol:
      1. If your upstream device is enable DHCP, you can select DHCP Client
      2. If your upstream device is Modem (cat), you should select PPPoE
      3. Otherwise, select Static Address
    3. Device: Select the last added network device
    4. Click Create Interface and click Save & Apply button
    5. Edit wan interface:
      1. Firewall Settings: Create / Assign firewall-zone option should select wan zone
      2. Other optional: Set according to actual situation
        1. DHCPdoesn’t need other configuration
        2. PPPoE requires you to fill in the account and password provided by the ISP
        3. Static Address requires you to fill in the address, subnet mask and gateway provided by the upstream device
    6. Click Save and click Save & Apply button

Don’t forget change default password.

Completed all configuration 🎉

After that, you can connect the network of other virtual machines to the corresponding bridge, and specify the gateway and IP address and other information to access the Internet.