PVE-LXC-Openwrt系统搭建与配置
环境
- Proxmox 7
- Openwrt 21.02.3
PVE安装Openwrt
开启udp转发
1 | echo 'xt_TPROXY' > /etc/modules-load.d/tproxy.conf |
新建LXC
1 | pct create 101 \ |
修改配置文件 /etc/pve/lxc/101.conf
1 | arch: amd64 |
创建钩子脚本
1 | //复制 |
常用分享
常用源
1 | src/gz openwrt_dist http://openwrt-dist.sourceforge.net/packages/base/x86_64 |
常用软件
1 | shadowsocks-libev ChinaDNS python3 luci-app-chinadns dns-forwarder luci-i18n-wireguard-zh-cn iptables-mod-tproxy luci-app-dns-forwarder luci-i18n-base-zh-cn luci-i18n-opkg-zh-cn luci-app-shadowsocks luci-i18n-firewall-zh-cn luci-compat |
常用脚本
- 软件更新
1 | opkg update |
- 更新chinadns
1 | /usr/bin/wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | awk -F\| '/CN\|ipv4/ { printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /etc/chinadns_chnroute.txt |
- 更新RouterOS的cnip文件
1 | /usr/bin/curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' |sed -e 's/^/add address=/g' -e 's/$/ list=CNIP/g'|sed -e $'1i\\\n/ip firewall address-list' -e $'1i\\\nremove [/ip firewall address-list find list=CNIP]' -e $'1i\\\nadd address=10.0.0.0/8 list=CNIP comment=private-network' -e $'1i\\\nadd address=172.16.0.0/12 list=CNIP comment=private-network' -e $'1i\\\nadd address=192.168.0.0/16 list=CNIP comment=private-network'>/www/cnip.rsc |
- 更新自动代理pac文件
1 | /usr/bin/genpac --proxy="SOCKS5 192.168.3.2:1080" --gfwlist-proxy="SOCKS5 192.168.3.2:1080" -o /www/gfwlist.pac |
- 更新iptv播放列表
1 | curl https://raw.githubusercontent.com/iptv-org/iptv/master/streams/cn.m3u -o /www/cn.m3u |
- 安装的软件包
1 | awk '/^Package:/{PKG= $2} /^Status: .*user installed/{print PKG}' /usr/lib/opkg/status |
参考
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Maktub_Blog!