文章目录
  1. 1. 拨号配置
  2. 2. 计划任务配置
  3. 3. 无线网络配置
  4. 4. 软件包配置
  5. 5. 端口映射配置

最近折腾了下WNDR 3700v4路由器openwrt固件更新,记录下过程备忘:

拨号配置

在WAN口高级设置下调大LCP响应故障阈值和LCP响应间隔的值防止迅雷下载断线

计划任务配置

新建restart.sh文件内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

flag=$(date +%s -r /root/flag)

ctime=$(date +%s)

x=$(($ctime-$flag))

#echo $x

if [ $x -gt 600 ]; then

touch /root/flag

echo "touch & reboot @ $(date +%D" "%T)" > /root/bootlog.txt 2>&1

reboot

fi

保存并赋予执行权限

1
chmod +x restart.sh

编辑计划任务清单加入如下内容:

1
2
3
4
5
30 1 * * 0-4 wifi down

5 6 * * 0-4 wifi on

30 6 * * * /root/restart.sh

无线网络配置

软件包配置

  • 安装ChinaDns

    1
    2
    3
    Opkg update
    Opkg install 文件名
    /etc/init.d/chinadns start

  • 配置Dnsmasq
    修改配置文件\etc\dnsmasq.conf,在文件末尾加入

    1
    2
    3
    4
    5
    no-resolv

    server=127.0.0.1#5353

    conf-dir=/etc/dnsmasq.d
  • 原版系统补充

    1
    2
    Opkg update
    Opkg install luci-app-ddns luci-app-upnp miniupnpd bind-dig

端口映射配置

外网端口号 协议 内网目标IP 内网端口号
8000 TCP 192.168.1.20 80
6800 TCP 192.168.1.20 6800
文章目录
  1. 1. 拨号配置
  2. 2. 计划任务配置
  3. 3. 无线网络配置
  4. 4. 软件包配置
  5. 5. 端口映射配置