OpenWRT官方云构建XIAOMI R3G

编程教程 (81) 2025-05-16 14:37:23

OpenWRT云编译NEWIFI-D2

官方编译

预安装的软件包

追加部分【基础版】

luci-i18n-base-zh-cn  lsblk cfdisk block-mount luci-i18n-ttyd-zh-cn lm-sensors luci-i18n-wol-zh-cn luci-i18n-upnp-zh-cn luci-i18n-openvpn-zh-cn openvpn-easy-rsa luci-proto-wireguard luci-theme-material iperf3 

追加部分【扩展版】

提示:

  • frps 服务端可根据实际需要情况在编译后的软件库安装 luci-i18n-frps-zh-cn
  • frp 反向代理,根据实际情况在软件库安装 luci-i18n-xfrpc-zh-cn
luci-i18n-base-zh-cn lsblk cfdisk block-mount luci-i18n-ttyd-zh-cn lm-sensors luci-i18n-wol-zh-cn luci-i18n-upnp-zh-cn luci-i18n-openvpn-zh-cn openvpn-easy-rsa luci-app-ocserv luci-app-libreswan luci-i18n-frpc-zh-cn luci-theme-material iperf3 luci-i18n-alist-zh-cn luci-i18n-samba4-zh-cn luci-i18n-nft-qos-zh-cn kmod-usb-storage kmod-usb-storage-uas kmod-usb-storage-extras kmod-usb2 kmod-usb3 kmod-fs-vfat kmod-fs-ext4 kmod-fs-exfat ntfs-3g block-mount blockd
  • ntfs3 中文兼容问题
  • ntfs-3g 兼容性好

 

 

追加部分【扩展版】-  immortalwrt

luci-i18n-base-zh-cn lsblk cfdisk block-mount luci-i18n-ttyd-zh-cn lm-sensors luci-i18n-wol-zh-cn luci-i18n-upnp-zh-cn luci-i18n-openvpn-zh-cn openvpn-easy-rsa luci-proto-wireguard luci-theme-material iperf3 luci-i18n-transmission-zh-cn luci-i18n-samba4-zh-cn luci-i18n-nft-qos-zh-cn kmod-usb-storage kmod-usb-storage-uas kmod-usb-storage-extras kmod-usb2 kmod-usb3  kmod-fs-vfat kmod-fs-ext4 kmod-fs-exfat ntfs-3g block-mount luci-theme-argon luci-app-argon-config

 

首次启动时运行的脚本(uci-defaults)

# Beware! This script will be in /rom/etc/uci-defaults/ as part of the image.
# Uncomment lines to apply:

#WiFi配置
wlan_name="XIAOMI-3G"
wlan_name_5g="XIAOMI-5G"
wlan_password="1234567890"

#root密码
root_password="password"

#内网配置
lan_ip_address="172.16.31.1"
lan_netmask="255.255.255.0"

#拨号配置(一般不建议配置)
#pppoe_username="111111"
#pppoe_password="111111"

#时区配置
zone_name="Asia/Shanghai"

#主机名
host_name="XIAOMI-3G"

# 终端自动登录
ttyd_login="/bin/login -f root"


# log potential errors
exec >/tmp/setup.log 2>&1

if [ -n "$root_password" ]; then
  (echo "$root_password"; sleep 1; echo "$root_password") | passwd > /dev/null
fi

# Configure LAN
# More options: https://openwrt.org/docs/guide-user/base-system/basic-networking
if [ -n "$lan_ip_address" ]; then
  uci set network.lan.ipaddr="$lan_ip_address"
  uci set network.lan.netmask="$lan_netmask"
  uci commit network
fi

# Configure WLAN
# More options: https://openwrt.org/docs/guide-user/network/wifi/basic#wi-fi_interfaces
if [ -n "$wlan_name" -a -n "$wlan_password" -a ${#wlan_password} -ge 8 ]; then
  uci set wireless.@wifi-device[0].disabled='0'
  uci set wireless.@wifi-iface[0].disabled='0'
  uci set wireless.@wifi-iface[0].encryption='psk2'
  uci set wireless.@wifi-iface[0].ssid="$wlan_name"
  uci set wireless.@wifi-iface[0].key="$wlan_password"
  uci set wireless.@wifi-device[1].disabled='0'
  uci set wireless.@wifi-iface[1].disabled='0'
  uci set wireless.@wifi-iface[1].encryption='psk2'
  uci set wireless.@wifi-iface[1].ssid="$wlan_name_5g"
  uci set wireless.@wifi-iface[1].key="$wlan_password"
  uci commit wireless
fi

# Configure PPPoE
# More options: https://openwrt.org/docs/guide-user/network/wan/wan_interface_protocols#protocol_pppoe_ppp_over_ethernet
if [ -n "$pppoe_username" -a "$pppoe_password" ]; then
  uci set network.wan.proto=pppoe
  uci set network.wan.username="$pppoe_username"
  uci set network.wan.password="$pppoe_password"
  uci commit network
fi


# 时区
if [ -n "$zone_name" ]; then
  uci set system.@system[0].zonename="$zone_name"
  uci set system.@system[0].timezone='UTC-8'
  uci commit system
  /etc/init.d/system reload
  else echo "区域未执行: zone_name"
fi

# 主机名
if [ -n "$host_name" ]; then
	uci set system.@system[0].hostname="$host_name"
    uci commit system
    uci set luci.languages.zh_cn='简体中文 (Chinese Simplified)'
    uci set luci.main.lang='zh_cn'
    uci commit luci
    else echo "区域未执行: host_name"
fi


# 终端自动登录
if [ -n "$ttyd_login" ]; then
   uci set ttyd.@ttyd[0].command="$ttyd_login"
   uci delete ttyd.@ttyd[0].interface
   uci commit ttyd
   else echo "区域未执行: ttyd_login"
fi

# fstab 配置参考 
# https://openwrt.org/docs/guide-user/storage/usb-drives?s[]=uci&s[]=fstab&s[]=anon&s[]=mount
# 启用自动挂载未配置磁盘
uci set fstab.@global[0].anon_mount='1'
uci commit fstab

# 国内软件源
sed -i 's_https\?://downloads.openwrt.org_https://mirrors.tuna.tsinghua.edu.cn/openwrt_' /etc/opkg/distfeeds.conf

# NAT 硬件加速启用
uci set firewall.@defaults[0].flow_offloading=1
uci set firewall.@defaults[0].flow_offloading_hw=1
uci commit

echo "All done!"

 

 

 


评论
User Image
提示:请评论与当前内容相关的回复,广告、推广或无关内容将被删除。

相关文章
OpenWRT云编译NEWIFI-D2官方编译https://firmware-selector.openwrt.org/预安装的软件包追加部分luci-i18
前置条件小米路由器3G v1(如何区分v1,有usb3.0的是v1)已经刷好breed 进入breed web 控制台断电,先用牙签戳住重置不放,同时插入电源,等网口灯闪烁几次后松开。
小米路由器3G v1版本硬件参数配置,下面是小米路由器3G全部的重要硬件参数SOCMT7621A2.4G无线芯片MT7603EN5G 无线芯片MT7612ENRAM内存256MB DDR3-12...
首先来张小米路由器3G照片正楼,Padavan约等于华硕梅林远房亲戚也就是联发科版本
前言本文主要对新路由3 D2和小米路由3G做一个实际的使用测评
Newifi3 D2 硬件参数信息 Newifi3 D2 硬件配置信息 SOCMT7621A2.4G无线芯片MT7603EN5G 无线芯片MT7612EN5G 功放芯片SKY85717-21RA...
前言距离springfox的swagger2.x 以及3.0.0 长久等待,等来了springdoc的swagger 3 为啥是3是因为支持openapi3.0
1.iperf3简介iPerf3是用于主动测试IP网络上最大可用带宽的工具。它支持时序、缓冲区、协议(TCP,UDP,SCTP与IPv4和IPv6)有关的各种参
Intel Core I3 4130对比I3 4130T,标准版与节能版区别对比,Intel Core I3 4130对比I3 4130T区别优缺,i3 4130T
一、问题背景nexus3 这种东西,传完一次,很少动了,很容易忘记密码,不要急有方法找回
环境说明Linux服务器一台安装docker服务nexus3镜像拉取 可选择版本拉取docker pull sonatype/nexus3:3.32.1 也可以拉取最新版本:docker pul...
从Spring 6和Spring Boot 3开始,与OpenFeign和Retrofit等其他声明式客户端类似,Spring框架支持以Java接口的形式创建RSocket服务,并为RSocke...
deepseek-r1的1.5b、7b、8b、14b、32b、70b和671b有啥区别?1.5B、7B、8B、14B、32B、70B是蒸馏后的小模型
一、Newifi 3(新路由3) D2刷Breed资源准备​硬件准备:Newifi 3(新路由3) D2 原厂固件路由器一台;电脑一台;网线一根; 软件准备:winscp( 文件复制工具)put...
前言Vue3 + Vite 打包静态资源使用相对路径 默认配置打包后文件预览相对路径绝对路径 Vue3 静态资源相对路径打包配置方法: 在defineConfi