準備
- 環(huán)境
NETGEAR WNDR3700v4
OpenWrt Chaos Calmer 15.05.1 / LuCI 15.05-149-g0d8bbd2 Release (git-15.363.78009-956be55)
- 準備軟件
dnscrypt-proxy
安裝 dnscrypt-proxy
$ opkg update
$ opkg install dnscrypt-proxy
簡單不雄驹?
配置 /etc/config/dnscrypt-proxy
config dnscrypt-proxy
option address '127.0.0.1'
option port '5553'
# option resolver 'opendns'
option resolvers_list '/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'
開機運行&啟動
/etc/init.d/dnscrypt-proxy enable
/etc/init.d/dnscrypt-proxy start
一般openwrt 會使用 dnsmasq
作為dns和dhcp服務(wù)医舆,所以這里也得該
編輯 /etc/config/dhcp
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '1'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
#option resolvfile '/tmp/resolv.conf.auto'
option noresolv 1
list server '127.0.0.1#5553'
list server '/pool.ntp.org/208.67.222.222'
- option resolvfile 這個是ISP的解析信息,污染源
- option noresolv 禁止使用這個 /etc/resolv.conf 文件的dns服務(wù)列表
- list server 使用上面我們定義的ndscrypt服務(wù)
- list server /pool.ntp.org/208.67.222.222 因為DNScrypt需要準確的時間蔬将,所以需要這個時間服務(wù)器
配置基本上完成了,重啟下 dnsmasq
惫东,客戶端需要刷新下dhcp信息,如果不知道就重啟機器是最簡單的啦廉沮。
日志
$ logread
Mon Oct 3 13:40:16 2016 daemon.notice dnscrypt-proxy[1692]: Proxying from 127.0.0.1:5553 to 222.222.220.220:443
Mon Oct 3 13:46:40 2016 daemon.info hostapd: wlan0: STA 11:11:11:11:18:60 WPA: group key handshake completed (RSN)
Mon Oct 3 13:46:40 2016 daemon.info hostapd: wlan0: STA 11:11:11:11:18 WPA: group key handshake completed (RSN)
Mon Oct 3 13:46:40 2016 daemon.info hostapd: wlan0: STA 11:11:11:11:18 WPA: group key handshake completed (RSN)
Mon Oct 3 13:46:40 2016 daemon.info hostapd: wlan0: STA 11:11:11:11:18 WPA: group key handshake completed (RSN)
Mon Oct 3 13:56:40 2016 daemon.info hostapd: wlan0: STA 11:11:11:11:18 WPA: group key handshake completed (RSN)
Mon Oct 3 13:56:40 2016 daemon.info hostapd: wlan0: STA 11:11:11:11:18 WPA: group key handshake completed (RSN)
Mon Oct 3 13:56:40 2016 daemon.info hostapd: wlan0: STA 11:11:11:11:18 WPA: group key handshake completed (RSN)
Mon Oct 3 13:56:40 2016 daemon.info hostapd: wlan0: STA 11:11:11:11:18 WPA: group key handshake completed (RSN)
有不足或者不正確的地方還希望指點州泊。