找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 6218|回复: 77

[AC2100(RM2100)] 最简单官版固件安装SmartDns-全型号

  [复制链接]
本帖最后由 avsba001 于 2023-4-14 12:43 编辑

纯技术贴,小米其他型号只要rom空间够就可以安装,覆盖ipv4和ipv6
带去广告需要3.3MB空间
不带去广告只需要1.8m空间!
SSH后输入  df  查看剩余空间
需要ssh!

需要ssh!
需要ssh!
原文↓
原帖,也是我写的



## 1.下载二进制文件

如小米ax3600,构架为aarch64.

[aarch64Github下载地址]([aarch64](https://github.com/pymumu/smartdns/releases/download/Release41/smartdns-aarch64))

## 2.安装目录

将二进制文件重命名为 smartdns

复制到 /etc/smartdns/ 目录下


  1. chmod +x /etc/smartdns/smartdns
复制代码






## 3.配置文件smartdns.conf

新建一个文件,命名为 smartdns.conf,同 /etc/smartdns/ 下

示例参数

```bash

  1. bind [::]:5353
  2. bind-tcp [::]:5353
  3. cache-size 1024k
  4. prefetch-domain yes
  5. serve-expired yes
  6. force-AAAA-SOA no
  7. force-qtype-SOA 65
  8. server-https https://cn-east.iqiqzz.com/cdn
  9. server-tls cn-east.iqiqzz.com:853
  10. server-https https://1.12.12.12/dns-query
  11. server-https https://dns.alidns.com/dns-query
  12. server 2400:3200::1
  13. server 2402:4e00::
  14. speed-check-mode ping,tcp:443,tcp:80
  15. response-mode fastest-ip
  16. dualstack-ip-selection yes
  17. dualstack-ip-selection-threshold 20
  18. max-reply-ip-num 1
复制代码

```

## 4.重定向防火墙53端口至5353

### 1.重定向 tcp 和 udp 53 端口

```bash

  1. #ipv4
  2. iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 5353
  3. iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 5353
  4. #ipv6
  5. ip6tables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 5353
  6. ip6tables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 5353
复制代码


```

### 2.保存防火墙配置

```bash

  1. #ipv4防火墙
  2. iptables-save >/etc/iptables-script
  3. iptables-restore </etc/iptables-script
  4. #ipv6防火墙
  5. ip6tables-save >/etc/ip6tables-script
  6. ip6tables-restore </etc/ip6tables-script
复制代码


```

### 3.防火墙开机生效

编辑文件

```
  1. vi /etc/rc.local
复制代码


```

在 exit0 前面输入

```

  1. /usr/sbin/iptables-restore </etc/iptables-script
  2. /usr/sbin/ip6tables-restore </etc/ip6tables-script
复制代码


```

##  5.配置smartdns开机启动

ssh 运行以下命令

```
  1. ln -s /etc/smartdns/smartdns /etc/rc.d/S999smartdns
复制代码


```

## 6.(可选)去广告并自动更新规则

### 1.在 /etc/smartdns/ 目录下新建文件 smartdns_update.sh 写入如下

```
## 切换到 SmartDNS 服务配置目录

  1. cd /etc/smartdns
  2. ## 删除旧的规则文件
  3. rm -rf smartdns-dns.conf
  4. ## 下载新规则文件
  5. curl -Ok https://adrules.top/smart-dns.conf
  6. ## 重启 SmartDNS 服务 使规则生效
  7. /etc/smartdns/smartdns restart
复制代码


```

```
  1. chmod +x /etc/smartdns/smartdns_update.sh
复制代码


```

### 2.修改smartdns.conf,引用规则文件

新增一行

```
  1. conf-file /etc/smartdns/smart-dns.conf
复制代码


```

运行一次脚本

```
  1. ./etc/smartdns/smartdns_update.sh
复制代码


```


op都可以安装吗?
回复

使用道具 举报

 楼主| | 显示全部楼层
jswxll 发表于 2023-4-11 22:15
op都可以安装吗?

op自带smartdns,或者直接opkg安装,不需要这么麻烦
回复

使用道具 举报

不错,支持下是不错
回复

使用道具 举报

支持下zsbdzsbd
回复

使用道具 举报

不错,支持下是不错
回复

使用道具 举报

支持支持!!!
回复

使用道具 举报

看看@@@@@@@
回复

使用道具 举报

支持支持!!!
回复

使用道具 举报

参考一下,方便多了
回复

使用道具 举报

刚好需要,感谢分享!
回复

使用道具 举报

DDDDDDDD
回复

使用道具 举报

刚好需要,感谢分享!
回复

使用道具 举报

支持!!!!!!!!!!!
回复

使用道具 举报

支持支持!!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-5-9 15:50

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表