Skip to content

阿里云安装openwrt

注意:EFI 镜像成功,其他镜像失败

server1

Terminal window
wget -c https://mirrors.aliyun.com/openwrt/releases/23.05.5/targets/x86/64/openwrt-23.05.5-x86-64-generic-ext4-combined-efi.img.gz
gunzip openwrt-23.05.5-x86-64-generic-ext4-combined-efi.img.gz

server2

Terminal window
apt install -y sshfs -y
mkdir /tmp/iso
sshfs -p 22 root@10.2.0.33:/root /tmp/iso
lsblk
Terminal window
dd if=/tmp/iso/openwrt-23.05.5-x86-64-generic-ext4-combined-efi.img of=/dev/vda

阿里云控制台远程连接,重启,成功

配置网络

Terminal window
vi /etc/config/network
"config interface 'lan'
option device 'br-lan'
option proto 'dhcp'"
/etc/init.d/network restart

禁用 IPV6

Terminal window
echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf

国内源

Terminal window
sed -i 's_downloads.openwrt.org_mirrors.aliyun.com/openwrt_' /etc/opkg/distfeeds.conf

磁盘扩容 (https://openwrt.org/docs/guide-user/advanced/expand_root

Terminal window
wget -U "" -O expand-root.sh "https://openwrt.org/_export/code/docs/guide-user/advanced/expand_root?codeblock=0"
. ./expand-root.sh
opkg update
opkg install parted losetup resize2fs
sh /etc/uci-defaults/70-rootpt-resize

VPN SITE TO SITE

  1. WireGuard
  2. strongSwan:复杂,性能好
  3. Libreswan:简单,兼容性好
Terminal window
opkg update
opkg install libreswan iptables

插件:应用过滤,限制玩游戏

http://doc.openappfilter.com/oaf/