Greetings,
So I'm trying to run OpenWRT in LXC within Proxmox (reasoning at the end). I have been stopped by few issues, thus my questions. First of all, my config. It's a bag of different solutions, I just kept adding new options without removing previous ones, with hope it clicks in eventually. I'll trim it down to the necessary options once I get somewhere:
First things first. I have to chmod `o+rw` abovementioned `/dev` entries on the Proxmox host (I'll swap that with an udev rule later on). The devices do show up within the container. I can use OpenWRTs uqmi command to talk to the ISP, but the problem starts when I want to establish a connection. Here's an excerpt from the logs of OpenWRT:
Thats all I have for now and I don't really know what to do next. Please advise.
Extra questions: do `iptables` and `nftables` work under LXC? How about wireguard?
FAQ:
1. Why LXC and not VM?
A: performance. I was peaking 50Mbit and 100% softirq on CPU inside of the VM, where modem and network are capable of 1Gb+. NATing and routing are also heavily impacted.
2. Why OpenWRT and not OPNSense/anyotherlinux?
A: OPNSense has no QMI/Mbim support. Previously I used ArchLinux and handcrafted `iptables`, but the config is getting more and more complex, thus I wanted a router-oriented distro. Also, main issues stay the same - performance and usb/interface passthrough
Resources I used so far:
https://lists.linuxcontainers.org/pipermail/lxc-users/2020-September/015337.html
https://forum.turris.cz/t/lxc-container-and-attach-usb-devices/4412/18
https://gist.github.com/crundberg/a77b22de856e92a7e14c81f40e7a74bd
https://forum.proxmox.com/threads/p...containers-in-proxmox-7-2.109981/#post-601753
https://gist.github.com/dragonfire1119/f3acd42414abfff762d2dad5e50f7cc6
https://forum.proxmox.com/threads/h...rsion-of-openwrt-and-run-it-on-proxmox.64786/
https://openwrt.org/docs/guide-user/virtualization/lxc#upgrading_to_the_latest_release
So I'm trying to run OpenWRT in LXC within Proxmox (reasoning at the end). I have been stopped by few issues, thus my questions. First of all, my config. It's a bag of different solutions, I just kept adding new options without removing previous ones, with hope it clicks in eventually. I'll trim it down to the necessary options once I get somewhere:
Code:
arch: amd64
cores: 2
features: mknod=1
hostname: openwrt
memory: 1024
net0: name=eth0,bridge=vmbr0,hwaddr=BC:24:11:0E:D1:B1,type=veth
ostype: unmanaged
rootfs: local-lvm:vm-666-disk-0,size=8G
swap: 0
tty: 1
unprivileged: 1
lxc.idmap: u 0 100000 65536
lxc.idmap: g 0 100000 65536
lxc.mount.auto: proc:mixed sys:rw cgroup:mixed
lxc.cgroup2.devices.allow: c 180:* rwm
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.mount.entry: /dev/bus/usb dev/bus/usb none bind,optional,create=dir
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB2 dev/ttyUSB2 none bind,optional,create=file
lxc.mount.entry: /dev/ttyUSB3 dev/ttyUSB3 none bind,optional,create=file
lxc.mount.entry: /dev/cdc-wdm0 dev/cdc-wdm0 none bind,optional,create=file
lxc.mount.entry: /sys/devices/pci0000:00/0000:00:13.0/ sys/devices/pci0000:00/0000:00:13.0/ none bind,optional,create=dir
lxc.net.1.name: wwan0
lxc.net.1.type: phys
lxc.net.1.link: wwan0
First things first. I have to chmod `o+rw` abovementioned `/dev` entries on the Proxmox host (I'll swap that with an udev rule later on). The devices do show up within the container. I can use OpenWRTs uqmi command to talk to the ISP, but the problem starts when I want to establish a connection. Here's an excerpt from the logs of OpenWRT:
Code:
Feb 16 17:38:12 2024 daemon.notice netifd: Interface 'T_Mobile' is setting up now
Feb 16 17:38:12 2024 daemon.notice netifd: T_Mobile (925): The interface could not be found.
Feb 16 17:38:12 2024 daemon.notice netifd: T_Mobile (1007): Stopping network T_Mobile
Feb 16 17:38:12 2024 daemon.notice netifd: T_Mobile (1007): Command failed: ubus call network.interface notify_proto { "action": 0, "link-up": false, "keep": false, "interface": "T_Mobile" } (Permission denied)
Feb 16 17:38:12 2024 daemon.notice netifd: Interface 'T_Mobile' is now down
Thats all I have for now and I don't really know what to do next. Please advise.
Extra questions: do `iptables` and `nftables` work under LXC? How about wireguard?
FAQ:
1. Why LXC and not VM?
A: performance. I was peaking 50Mbit and 100% softirq on CPU inside of the VM, where modem and network are capable of 1Gb+. NATing and routing are also heavily impacted.
2. Why OpenWRT and not OPNSense/anyotherlinux?
A: OPNSense has no QMI/Mbim support. Previously I used ArchLinux and handcrafted `iptables`, but the config is getting more and more complex, thus I wanted a router-oriented distro. Also, main issues stay the same - performance and usb/interface passthrough
Resources I used so far:
https://lists.linuxcontainers.org/pipermail/lxc-users/2020-September/015337.html
https://forum.turris.cz/t/lxc-container-and-attach-usb-devices/4412/18
https://gist.github.com/crundberg/a77b22de856e92a7e14c81f40e7a74bd
https://forum.proxmox.com/threads/p...containers-in-proxmox-7-2.109981/#post-601753
https://gist.github.com/dragonfire1119/f3acd42414abfff762d2dad5e50f7cc6
https://forum.proxmox.com/threads/h...rsion-of-openwrt-and-run-it-on-proxmox.64786/
https://openwrt.org/docs/guide-user/virtualization/lxc#upgrading_to_the_latest_release