OpenWRT 在线云构建 Redmi AC2100

玩机 > Router (253) 2026-06-15 16:09:58

替换组件

替换默认的wpad-basic-mbedtlswpad-openssl

附加组件

 luci-app-dawn wakeonlan luci-i18n-base-zh-cn  luci-i18n-ttyd-zh-cn luci-i18n-wol-zh-cn luci-i18n-upnp-zh-cn iperf3

 

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

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

#WiFi配置
wlan_name="RM2100"
wlan_name_5g="RM2100_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="RM2100"

# 终端自动登录
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

# 国内软件源
# 24.x及以前的版本
#sed -i 's_https\?://downloads.openwrt.org_https://mirrors.tuna.tsinghua.edu.cn/openwrt_' /etc/opkg/distfeeds.conf

# openwrt 25.x 更换为apk软件包管理,替换国内源
sed -i 's_https\?://downloads.openwrt.org_https://mirrors.tuna.tsinghua.edu.cn/openwrt_' /etc/apk/repositories.d/distfeeds.list

# 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
提示:请评论与当前内容相关的回复,广告、推广或无关内容将被删除。

相关文章
替换组件替换默认的wpad-basic-mbedtls为wpad-mesh-openssl附加组件 luci-app-dawn luci-i18n-base-z
根据红米 XIAOMI REDMI AC 2100的不同breed 刷入OpenWRT刷入方式不同。例如本例中,刷入OpenWRT需要两个文件OpenWrt F
kv/kvr mesh / 漫游kvr漫游(兼容性一般)常见kv 漫游如何才能让两个AP实现MESH 漫游效果。一般支持 802.11k 802.11.v 这两
openwrt 在线编译官网OpenWrt Firmware Selector 默认openwrt编译组件查看打开在线编译网站后,选个机型,这里以小米3G路由器
OpenWRT云编译NEWIFI-D2官方编译https://firmware-selector.openwrt.org/https://firmware-se
序大户型配置无缝漫游属于刚需,但是市面上的绝大部分产品都没能完全配置无缝漫游,且不同品牌无法兼容。产品介绍中,也混淆了 mesh 组网(802.11s)和无缝漫
OpenWRT云编译NEWIFI-D2官方编译https://firmware-selector.openwrt.org/预安装的软件包追加部分luci-i18
预安装的软件包追加部分luci-i18n-base-zh-cn lsblk cfdisk block-mount luci-i18n-ttyd-zh-cn l
什么是MESH组网百度百科这样说:mesh(无线网格网络)_百度百科总结就是:网络设备间得一种组网方式,组网连接方式可以是有线也可以是无线;可以一键同步设备之间
[OpenWrt Wiki] Setting up DAWN and band-steeringSetting up DAWN and band-steerin
清华openwrt软件源配置执行命令配置:sed -i 's_https\?://downloads.openwrt.org_https://mirrors.
openwrt ttyd 拒绝连接 无法打开ssh窗口解决办法。
immortalwrt/openwrt 物理x86设备安装教程,包括资源下载基础配置等。
openwrt 23.05.x 卸载某些软件后报错Unhandled exception during request dispatchingmodule 'luci.ucodebridge' ...
OpenWRT 24.10端口转发配置打开防火墙网络-&gtl;防火墙 配置端口转发切换到端口转发(Port Forwards)菜单添加转发规则模拟需求 1 转发808