Installing OpenWRT as LXC. How convert LXC template to Proxmox Template?

Thanks @pocok for sharing your experiences!

In the past I've had issues using SQM in an openwrt 18.x container.

I don't know the exact details, but DazzyWalkman mentions some "out-of-tree" kernel stuff which openwrt used in openwrt 18.x to enable sqm in this post is https://forum.openwrt.org/t/guide-run-openwrt-as-a-container-in-proxmox/44683/12?u=gechu

I never managed to sorted out the kernel issues I faced using openwrt 18x. They may have been related to something else.

@pocok have you tried SQM in container yet?

I need to do some reading regarding "trunk LACP bond", what benefits do you see?

I haven't used SQM scrips with OpenWrt previously. I guess this is a very special case, as you can imagine, running a containerized distribution which is designed for low-spec, purpose-hardware... this is something that even the devs can't really argue about... I would recommend trying a different distro, if possible to run with LXC that has the SQM services, and compare with that (vanilla Debian perhaps?).

Regarding LACP bonding, this is really not Proxmox specific, it just the way I set up my network. I have a Cisco Catalyst series switch to which I have the Proxmox host connected to. Of course you need to set up LACP bonding on both ends, so on the switch and on the server (Prmoxmox neetly has this feature to bond multiple network adapters in the GUI). The benefit is, that this could help with increased thoughput and latencies that if you have such network hardware, and consistent network traffic between your server and multiple clients, as it is using two or more ethernet links seen as one logical.
 
I'm currently running an OpenWrt 19.07.x stable LXC image, as my main router/gateway since a couple of weeks.

Basically, it's a workable approach, it can be done, whoever is familiar with OpenWrt on a physical device, I can really recommend containerizing and scailing it. It's such a sleek and stable system with incredibly modest resource usage.

Thanks for you advice. I am not familiar with OpenWrt however I have used Tomato and DD-Wrt on my Asus AS-66U. The 66U has had significant lackluster range and performance so I want to try OpenWrt on a Zotac ZBox as my access point, with PFSense for DHCP, FW, DDNS, etc.
Comments appreciated.
Cheers
 
For you guys above, especially the last one. There is no need to "match" kernel version, as LXC images do not include any sort of a kernel. LXC containers use the hosts kernel. To explain it properly, if you would like to use Wireguard in an OpenWrt LXC container, you need to install wireguard-dkms on the Proxmox host itself, NOT in the OpenWrt container namespace.

All that being said, I was too hestiant at first, but I'm currently running an OpenWrt 19.07.x stable LXC image, as my main router/gateway since a couple of weeks. I have a FTTH "1Gbps" internet connection, usually that maxes out at around 840Mbps, according to fast.com. I have dedicated one of the network adapters as "phys" for the WAN to the container, that is configured with a PPPoE protocol in OpenWrt. The internal LAN part is handeled by one of these dual Intel PCI-E 1Gbit adapters, configured as a trunk LACP bond on the Proxmox host, presented as a Linux Bridge for OpenWrt's LAN adapter side.

I had the luxury of using a Mikrotik RB450G with a special OpenWrt build replacing the stock firmware and shortcut-fe patches enabled. This device could do 950Mbps NAT, measued with iperf, between its separate WAN - LAN (eth0, eth1 switch chips). Right now, I have decomissioned this Miktorik, and exclusively using the OpenWrt LXC container as my primary router, on my i5 4th gen Proxmox host. All I can say, is I never had any issues before with the previous setup, and... I still don't have. It's such a seamless experience, really it's wire speed, what your ISP is providing you. Not to mention, I have set the container limits to 2 cores and 512 MB memory... it is overkill. The avereage usage is like... negligeble amount of ram/cpu for NATing at these speeds. Of course we are talking about an x86 CPU, it doesn't break a single sweat for such workloads.

Basically, it's a workable approach, it can be done, whoever is familiar with OpenWrt on a physical device, I can really recommend containerizing and scailing it. It's such a sleek and stable system with incredibly modest resource usage.

Hi,

This is exactly what I'd like to achieve too but struggling a bit ... actually a lot. Would you mind to explain the exact steps how you created the pppoe interface and added to openwrt lxc guest? Also what was your method to add Openwrt as lxc image (I found this one work nice, wondering is there an easier way)?

I searched a lot for a comprehensive guide but only found failed attempts stories. At some point there was always a show stopper.

I would really appreciate if you can write down step-by-step guide for a dummy like me.

Thanks.
 
Hi,

This is exactly what I'd like to achieve too but struggling a bit ... actually a lot. Would you mind to explain the exact steps how you created the pppoe interface and added to openwrt lxc guest? Also what was your method to add Openwrt as lxc image (I found this one work nice, wondering is there an easier way)?

I searched a lot for a comprehensive guide but only found failed attempts stories. At some point there was always a show stopper.

I would really appreciate if you can write down step-by-step guide for a dummy like me.

Thanks.

Thank you for your encouragement. I don't think anyone here is a "dummy", at least regarding Proxmox and computing in general. :).

Regarding my solution, for me as well, like for anyone else, it was mostly trial-and-error. I cobbled the majority of the information from the internets (very few so far) as well, and adapted for my user-case. I may do a write-up and publish it somewhere, but that requries a lot of will-power from my end.

Please stand-by :)
 
I can offer a virtual beer (or whatever your tea is) if that encourages you to do the write-up ;)
 
Sorry guys, the "please standy-by" phase got a little old. :( Regarding the topic, quickly: I am still using the same script from this guy: https://github.com/mikma/lxd-openwrt to build the Proxmox compatible LXC images of OpenWrt, it is still working.

Basically once you have the image, create container from the console, and specify the os type "unmanaged", then boot up the container. Once there, enter the shell of the container and edit /etc/config/network to match up the virtual interface name and you IP range of your host/local network. That's it basically, there are really no other settings to be done, if you don't want anything more "advanced" with the container.
 
  • Like
Reactions: leesteken
Sorry guys, the "please standy-by" phase got a little old. :( Regarding the topic, quickly: I am still using the same script from this guy: https://github.com/mikma/lxd-openwrt to build the Proxmox compatible LXC images of OpenWrt, it is still working.

Basically once you have the image, create container from the console, and specify the os type "unmanaged", then boot up the container. Once there, enter the shell of the container and edit /etc/config/network to match up the virtual interface name and you IP range of your host/local network. That's it basically, there are really no other settings to be done, if you don't want anything more "advanced" with the container.
Same goes for me.
I have created a build environment/container based on the same github repo and wrote scripts to generate proxmox templates and backup images for OpenWRT on a regular basis (19.07.(0,2,7,8) & 21.02.0).

So, if there is an interest in the scripts, ready to use templates or image backups (with correct conf file), let me know.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!