I create the openwrt LXC container on proxmox host with below command:
pct create 333 /var/lib/vz/template/cache/openwrt-23.05.4-x86-generic-rootfs.tar.gz --arch amd64 --hostname OpenWrt-23.05 --rootfs local-lvm:5 --memory 1024 --cores 2 --ostype unmanaged --unprivileged 1
I configured the network as below:
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '10.0.0.12'
option netmask '255.255.255.0'
option ip6assign '60'
list dns '10.0.0.1'
option gateway '10.0.0.1'
option broadcast '10.0.0.255'
I could ping the gateway 10.0.0.1 and any other server in the same local network. But I could not ping openwrt.org or any domain names.
I create 4 containers but none worked.
root@OpenWrt-23:/# ubus call system board
{
"kernel": "6.8.8-2-pve",
"hostname": "OpenWrt-23.05",
"system": "Intel(R) N100",
"model": "HEDY N100",
"board_name": "hedy-n100",
"rootfs_type": "ext4",
"release": {
"distribution": "OpenWrt",
"version": "23.05.4",
"revision": "r24012-d8dd03c46f",
"target": "x86/generic",
"description": "OpenWrt 23.05.4 r24012-d8dd03c46f"
}
}
root@OpenWrt-23:/#
I also created an openwert VM on proxmox, ping works after setting dns on luCI.
root@OpenWrt-23:/# cat /etc/resolv.conf
search lan
nameserver 127.0.0.1
nameserver ::1
root@OpenWrt-23:/# ping openwrt.org
ping: bad address 'openwrt.org'
root@OpenWrt-23:/# nslookup openwrt.org 127.0.0.1
nslookup: write to '127.0.0.1': Connection refused
;; connection timed out; no servers could be reached
root@OpenWrt-23:/# nslookup openwrt.org 10.0.0.1
Server: 10.0.0.1
Address: 10.0.0.1:53
Non-authoritative answer:
Name: openwrt.org
Address: 2a03:b0c0:3:d0::1a51:c001
Non-authoritative answer:
Name: openwrt.org
Address: 64.226.122.113
root@OpenWrt-23:/#
When I can the nameserver in /etc/resolv.conf to 10.0.0.1, ping works, but rebooting the server will reset /etc/resolv.conf. I know there are ways to keep resolv from being changed, but I'll feel that's a hack, the server is supposed to work with the right settings. Especially when it's a new installation.