Skip to content

klcb2010/Asuswrt-Merlin-Custom-Scripts

Repository files navigation

光猫拨号时主要设置 IPV6设置

分类 子项 设置值 备注
网络 - IPv4侧 DNS来源 网络连接
网络 - IPv4侧 DHCP √(启用)
网络 - IPv6侧 DNS来源 网络连接
网络 - IPv6侧 前缀来源 WAN Delegated
网络 - IPv6侧 地址信息是否通过DHCP获取 ×(关闭) SLAAC 方式
网络 - IPv6侧 其他信息是否通过DHCP获取 √(启用) 获取 DNS 等其他信息
网络 - IPv6侧 RA使能 √(启用)
网络 - IPv6侧 SLAAC 前缀使能 √(启用)
网络 - IPv6侧 启用 DHCPv6 服务器 √(启用)
网络 - IPv6侧 RA 最大/最小间隔 默认值
网络 - IPv6侧 启用 IPv6 SEEION ×(关闭)
QoS 设置 开启 QoS 模块 ×(关闭)
安全 - 防火墙 防火墙等级
安全 - 防火墙 DoS 攻击保护 ×(关闭)
管理 日志文件 查看是否有错误日志 有错误日志请求换机

路由器主要设置

分类 子项 设置值 备注
外部网络 - 基本 联机类型 静态 IP
外部网络 - 基本 启用 WAN √(启用)
外部网络 - 基本 启动 NAT √(启用)
外部网络 - 基本 启动 UPnP √(启用)
外部网络 - 基本 启动 IGDv2 √(启用)
外部网络 - 基本 Enable secure UPnP mode
外部网络 - IP 设置 互联网 IP 设置 从光猫获取的内网地址 静态ip 如 192.168.1.7
外部网络 - IP 设置 子网掩码 255.255.255.0
外部网络 - IP 设置 默认网关 光猫 LAN IP 地址 如 192.168.1.1
外部网络 - DNS DNS 服务器 233.5.5.5, 223.6.6.6 可以不用
外部网络 - DNS 转发到上游
外部网络 - DNS 启用绑定保护
外部网络 - DNS 启用 DNSSEC 支持
外部网络 - DNS 防止客户端自动 DoH
IPv6 设置 联机类型 Passthrough 路由器透传 IPv6
IPv6 设置 Release prefix on exit 启用 断开时释放前缀
IPv6 DNS 设置 自动接上 DNS 服务器 启用 跟随上游 DNS
DDNS 设置 Forced update interval 1 强制更新间隔 1天
DDNS 设置 IPv6 更新 支持 IPv6 DDNS

勾选科学 上网中的 过滤代理 可能导致 整个网络断连

wan-event用于ipv6地址更新触发DDNS刷新

让科学上网工具动态维护的 custom.conf 被 dnsmasq 读取

cat << 'EOF' > /jffs/scripts/dnsmasq.postconf
#!/bin/sh
# Merlin dnsmasq.postconf 脚本:自动 include /tmp/custom.conf
# 避免重复附加

CONFIG=${1:-/jffs/configs/dnsmasq.d/custom.conf}

# 确保目录存在
mkdir -p "$(dirname "$CONFIG")"

# 引入 helper
source /usr/sbin/helper.sh

# 如果 custom.conf 存在且未被附加,则附加
if [ -f /tmp/custom.conf ]; then
    if ! grep -Fxq "conf-file=/tmp/custom.conf" "$CONFIG" 2>/dev/null; then
        pc_append "conf-file=/tmp/custom.conf" "$CONFIG"
        logger -t "dnsmasq.postconf" "已附加 conf-file=/tmp/custom.conf"
    else
        logger -t "dnsmasq.postconf" "conf-file=/tmp/custom.conf 已存在,跳过附加"
    fi
else
    logger -t "dnsmasq.postconf" "警告:/tmp/custom.conf 不存在,无法附加"
fi
EOF

# 设置可执行权限
chmod +x /jffs/scripts/dnsmasq.postconf

查看进程

ps | grep -v grep | grep -E 'frpc|rclone'

1 定时任务由nat-start或科学上网注入 二选一 防止混乱 当由科学上网注入的时候 删除nat-start内相应代码且不执行第三步

2 下载

mkdir -p /jffs/scripts/ && curl -o /jffs/scripts/Asuswrt-Merlin-Custom-Scripts.sh https://ghfast.top/https://raw.githubusercontent.com/klcb2010/Asuswrt-Merlin-Custom-Scripts/main/Asuswrt-Merlin-Custom-Scripts.sh && chmod 777 /jffs/scripts/Asuswrt-Merlin-Custom-Scripts.sh

3 规则更新前要SSH 输入替换规则 否则会提示未通过检验而导致更新失败

sed -i 's|^URL_MAIN.*|URL_MAIN="https://raw.githubusercontent.com/qxzg/Actions/3.0/fancyss_rules"|' /koolshare/scripts/ss_rule_update.sh

4 插上 USB 已经分区的硬盘ext3和ntfs

SSH 登录路由器,进入amtm 安装 Entware

通过amtm 安装 Entware

 reboot
 opkg update
 opkg install rclone

确认硬盘挂载路径 如 /tmp/mnt/SD/

 ls /tmp/mnt/
 df -h | grep mnt

创建独立自启脚本运行

 /jffs/scripts/rclone_webdav.sh

重启后执行下列命令 看到 rclone 进程和日志

 ps | grep [r]clone
 cat /tmp/rclone.log

停止

 killall rclone

ip6tables -L INPUT -n --line-numbers 查看第24行 封禁ip

About

梅林自定义脚本

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors