OpenWRT编译及使用教程
引言
最初是因为家里的nas不是经常使用,长时间开着觉得浪费电,于是想着能不能搞个远程开关机,然后就了解到了网络唤醒这个功能,确实不错。不过这是一个在路由器上的功能,我登录我家老路由器的后台一看,果然没有。然后在找路由器的过程中,我发现了openwrt这个系统,开源、功能丰富、社区庞大……一下子就被吸引了,虽然需要折腾一下,但这个过程也是一个十分好的学习的机会,于是经过多方考量,直接购买了一个x86平台的小主机用来当家庭网络的主路由,等弄好之后就把剩下的路由器当AP来用,说干就干。
配置介绍
我的设备是畅网微控的X86-P2小主机
1 | CPU:J4125 |
环境配置
首先,我们需要一个Linux环境来进行编译,在Windows上用VMware Workstation Pro(个人使用是免费的)为我们创建一个Linux的虚拟环境就很方便,推荐使用Ubuntu作为我们的编译环境。
我们得先去Ubuntu的官网去下载一个它的系统镜像
将其导入到VMware中
Ubuntu操作
- 拉取openwrt官方源码
menuconfig
- target system -> x86
- subtarget -> x86_64
- target profile -> generic x86/64
- target images
- -> kernel partition size(128)MB
- -> root filesystem partition size(1024)MB
Base System
- block-mount
- ca-bundle【默认勾选】
- dnsmasq(取消勾选,选下面这个)
- dnsmasq-full
Administration
- btop
- netdata
- sudo
Firmware
- i915-firmware
- intel-microcode
Kernel Modules
Block Devices
- kmod-nvme
Filesystems
- kmod-fs-exfat
- kmod-fs-ext4
- kmod-fs-f2fs
- kmod-fs-ntfs3
GPIO support
- kmod-gpio-button-hotplug
Netfilter Extensions
- kmod-nft-bridge
- kmod-nft-offload【默认勾选】
- kmod-nft-queue
- kmod-nft-socket
- kmod-nft-tproxy(nft透明代理)
Network Devices
- kmod-igc【默认勾选】
Network Support
- kmod-inet-diag
- kmod-netlink-diag
- kmod-tcp-bbr
- kmod-tls
- kmod-tun
- kmod-veth
Other modules
- kmod-button-hotplug
USB Support
- kmod-usb-storage
- kmod-usb-storage-uas
- kmod-usb2
- kmod-usb3
Video Support
- kmod-drm-i915
Libraries
- libuci-lua
luci
1. Collections
- luci-nginx
- luci-ssl-openssl
2. Modules
- Translations -> Simplified Chinese
- luci-compat
- luci-mod-dashboard
3. Applications(优先勾选这个,有些依赖项会自动勾选)
- luci-app-acme
- luci-app-argon-config
- luci-app-banip(恶意IP屏蔽)
- luci-app-ddns
- luci-app-firewall
- luci-app-dockerman(由于docker会使用旧版的iptables规则,和nftables混用会报错,决定去除docker)
- luci-app-https-dns-proxy(DoH)
- luci-app-irqbalance(中断负载均衡,把硬件产生的中断请求(IRQ)均匀地分配到路由器 CPU 的各个核心上)
- luci-app-ksmbd
- luci-app-nlbwmon
- luci-app-package-manager
- luci-app-pbr(策略路由)
- luci-app-smartdns
- luci-app-statistics
- luci-app-transmission
- luci-app-ttyd
- luci-app-upnp
- luci-app-wol
4. Themes
- luci-theme-argon
5. Protocols
- luci-proto-wireguard
6. Libraries
- luci-lib-jsonc
Network
BitTorrent
- transmission-cli
- transmission-remote
- transmission-web-control
IP Addresses and Names
- ddns-scripts-cloudflare
- ddns-scripts-dnspod-v3
- ddns-scripts-utils
SSH
- openssh-server
- openssh-sftp-server
Utilities
- dockerd
- Installs check-config.sh with dependencies
- Enable available kernel support for CGroupsV1
- Enable optional kernel support for Docker
- Network
- Includes the Overlay network feature
- Includes macvlan kernel modules
- Storage
- Enables support for ext3 or ext4 as the backing filesystem
- Enables support for btrfs as the backing filesystem
- irqbalance
Disc
- fdisk
- lsblk
- partx-utils
Editors
- vim-full
- vim-runtime
Filesystem
- e2fsprogs
- mkf2fs
Shells
- bash
- zsh
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Scmplie's little place!
评论



