- echo "200 outwall" >> /etc/iproute2/rt_tables
- 修改firewall.user:
ipset create outwall iphash -existip rule add fwmark 1 table outwalliptables -t mangle -I PREROUTING -m set --match-set outwall dst -j MARK --set-mark 1 - 修改/etc/ppp/vpnup.sh:
#!/bin/sh
vpn_rule_ids=`ip rule list | grep 'lookup vpn' | sed 's/://g' | awk '{print $1}'`for rule_id in $vpn_rule_idsdoip ru del prio $rule_iddoneip route add default dev pptp-vpn table outwall - 修改/etc/ppp/ip-up.d/vpnup:#!/bin/shexport PATH="/bin:/sbin:/usr/sbin:/usr/bin"VPNGW=`ip route show | grep '^default' | grep 'pptp-vpn' | sed -e 's/default via \([^ ]*\).*/\1/ ' | head -1`if [ $VPNGW == '' ]; thenexit 0fiif [ ! -e /tmp/vpngw ]; thenecho $VPNGW >> /tmp/vpngwfiroute del default gw $VPNGWroute add -host 8.8.8.8 gw $VPNGW
- 执行:chmod a-x /etc/ppp/ppp.d/vpn-up
- 将下边地址下的三个文件放在/etc/dnsmasq.d/
https://github.com/lifetyper/FreeRouter_V2/tree/master/OpenWRT/etc/dnsmasq.d - 在路由器里配置vpn,名字为vpn。
- 重启路由器,应该可以翻墙了。
- 同理,在6的位置上可以搞定adblock的。
参考:
https://blog.sorz.org/p/openwrt-outwall/
2.3.51版测试通过。
2.3.51版测试通过。