openwrt翻墙配置集合
安装必要的包
opkg update
opkg install kmod-ipt-ipset ipset ipset-dns iptables-mod-nat-extra
opkg remove dnsmasq
opkg install dnsmasq-full
/etc/dnsmasq.conf
server=<IP_ADDRESS>
no-resolv
cache-size=1000
dhcp-range=<IP_ADDRESS>,<IP_ADDRESS>,48h
dhcp-option=3,<IP_ADDRESS>
gfw.conf
#Google and Youtube
server=/.google.com/<IP_ADDRESS>#443
server=/.google.com.hk/<IP_ADDRESS>#443
server=/.gstatic.com/<IP_ADDRESS>#443
server=/.ggpht.com/<IP_ADDRESS>#443
server=/.googleusercontent.com/<IP_ADDRESS>#443
server=/.appspot.com/<IP_ADDRESS>#443
server=/.googlecode.com/<IP_ADDRESS>#443
server=/.googleapis.com/<IP_ADDRESS>#443
server=/.gmail.com/<IP_ADDRESS>#443
server=/.google-analytics.com/<IP_ADDRESS>#443
server=/.youtube.com/<IP_ADDRESS>#443
server=/.googlevideo.com/<IP_ADDRESS>#443
server=/.youtube-nocookie.com/<IP_ADDRESS>#443
server=/.ytimg.com/<IP_ADDRESS>#443
server=/.blogspot.com/<IP_ADDRESS>#443
server=/.blogger.com/<IP_ADDRESS>#443
#FaceBook
server=/.facebook.com/<IP_ADDRESS>#443
server=/.thefacebook.com/<IP_ADDRESS>#443
server=/.facebook.net/<IP_ADDRESS>#443
server=/.fbcdn.net/<IP_ADDRESS>#443
server=/.akamaihd.net/<IP_ADDRESS>#443
#Twitter
server=/.twitter.com/<IP_ADDRESS>#443
server=/.t.co/<IP_ADDRESS>#443
server=/.bitly.com/<IP_ADDRESS>#443
server=/.twimg.com/<IP_ADDRESS>#443
server=/.tinypic.com/<IP_ADDRESS>#443
server=/.yfrog.com/<IP_ADDRESS>#443
#Dropbox
server=/.dropbox.com/<IP_ADDRESS>#443
#1024
server=/.t66y.com/<IP_ADDRESS>#443
#shadowsocks.org
server=/.shadowsocks.org/<IP_ADDRESS>#443
#btdigg
server=/.btdigg.org/<IP_ADDRESS>#443
#sf.net
server=/.sourceforge.net/<IP_ADDRESS>#443
#feedly
server=/.feedly.com/<IP_ADDRESS>#443
# Here Comes The ipset
#Google and Youtube
ipset=/.google.com/gfw
ipset=/.google.com.hk/gfw
ipset=/.gstatic.com/gfw
ipset=/.ggpht.com/gfw
ipset=/.googleusercontent.com/gfw
ipset=/.appspot.com/gfw
ipset=/.googlecode.com/gfw
ipset=/.googleapis.com/gfw
ipset=/.gmail.com/gfw
ipset=/.google-analytics.com/gfw
ipset=/.youtube.com/gfw
ipset=/.googlevideo.com/gfw
ipset=/.youtube-nocookie.com/gfw
ipset=/.ytimg.com/gfw
ipset=/.blogspot.com/gfw
ipset=/.blogger.com/gfw
#FaceBook
ipset=/.facebook.com/gfw
ipset=/.thefacebook.com/gfw
ipset=/.facebook.net/gfw
ipset=/.fbcdn.net/gfw
ipset=/.akamaihd.net/gfw
#Twitter
ipset=/.twitter.com/gfw
ipset=/.t.co/gfw
ipset=/.bitly.com/gfw
ipset=/.twimg.com/gfw
ipset=/.tinypic.com/gfw
ipset=/.yfrog.com/gfw
#Dropbox
ipset=/.dropbox.com/gfw
#1024
ipset=/.t66y.com/gfw
#shadowsocks.org
ipset=/.shadowsocks.org/gfw
#btdigg
ipset=/.btdigg.org/gfw
#sf.net
ipset=/.sourceforge.net/gfw
#feedly
ipset=/.feedly.com/gfw
#custom
server=/instagram.com/<IP_ADDRESS>#443
ipset=/instagram.com/gfw
server=/cdninstagram.com/<IP_ADDRESS>#443
ipset=/cdninstagram.com/gfw
#防火墙自定义规则
ipset -N gfw iphash
iptables -t nat -A PREROUTING -p tcp -m set --match-set gfw dst -j REDIRECT --to-port 1080
shadowsocks开启1080为透明代理端口，1081为socks5端口
PS：ChinaDNS或者pdnsd之类的都是不靠谱的，经常失效，而且是全部国外ip都走代理，不合理。ipset的方法，有两个关键的位置一个是<IP_ADDRESS>#443这里也可以换成自己架设的DNS，dnsmasq开启非标准端口监听即可然后绑定到外网ip上。dhcp的选项必须要填上去，我之前没填，反正就只能分配一次ip后面再次连接DHCP就不行了。上游DNS尽量选择响应快的，阿里的不靠谱


{{ comment.created_at|date:"d M Y" }} at {{ comment.created_at|date:"H:i" }}
{{ comment.content|linebreaksbr }}