Automated install script for OpenWrt in a Container on Proxmox!

jaminmc

Member
Aug 1, 2022
18
23
8
I have created an automated install script for ProxMox to install OpenWrt in a container. The beauty is that it downloads the rootfs directly from Openwrt, and not the Linux containers site.

The script detects bridges, and network devices that can be used for the WAN or LAN, and even has the option to set the subnet of the LAN, with a defaule value of 10.23.45.1/24. If you do not select any network devices, it will still configure the container for eth0 being the WAN, and eth1 being the LAN for manually adding network devices later.

Tested using 2 bridges. One for WAN, and the other for LAN. and had a VM connect through the LAN bridge. It detects the latest stable version, and installes that by default, but you can specify a version manually. I have tested it on 23.05.5 and the current 24.10.0.

If you have multiple Container storage locations, it will prompt you for which one you want to use!


https://gist.github.com/jaminmc/7e786a8947746439f7b8a8e2726e629d

edit: Added support for Snapshot, and auto install prompt for LiCi web interface for snapshot. I couldn't test wireguard, as the repo is missing the ip package right now.
 
Last edited:
Thank you. I did spend a bunch of time creating it.

All the other instructions were based on the LXD Linuxcontainer site. This pulls directly from the OpenWrt server, and modifies the configuration in the container automatically.

I did a diff between the root filesystems of the one from linuxcontainers, and OpenWrt, and that helped me in making the script.

Plus other instructions were hard to follow, and even opened security issues by opening the firewall on the wan port.

I tried to have the script prompt for what most people would want to set it up.