Tried that too but it doesn't work.You could try parent control built in the router
Tried that too but it doesn't work.You could try parent control built in the router
Depends on which VPN you're using. Some work fine. I was using VPN.ac with no issues after I got my DNS configuration straightened out. However, I'm going to switch to another VPN because of speed issues in the evenings. Anyone else experience a 30Mbps drop in download speeds in the evenings compared to the morning?Netflix wont work with VPN. They blocked it.
Thanks @ledan, I wanted blanket DNS filtering for all home devices though. I guess there's no way to do it unless the VPN provider builds this into their DNS servers?To set dns filtering while using vpn, you need to set accept dns configuration to disable in vpn client page. Then set opendns in wan page
It should work as you want but you will have dns leak. There is no point to use a vpn if you create leak with your config.
The way I setup mine is ...
policy rules for the computer using vpn. Accept dns configuration to exclusive so only this computer use vpn dns, so no filtering for this one. Other computers goes directly to wan and use wan dns which are opendns family.
Netflix works fine here with my vpn provider. I would say that it depends on your vpn provider.Netflix wont work with VPN. They blocked it.
NF will work with TorGuard if you get the Private IP option. I have used them for 1.5 years now.. If you want to bypass NF traffic to the VPN to the WAN, I recommend a read thru the Selective Routing threadIs there a way in the policy rules to allow devices to connect to WAN if going to Netflix, i.e., Netflix IP range will go through WAN instead of VPN? Does Netflix have a IP range?
netflix.com. 59 IN A 52.5.89.35
netflix.com. 59 IN A 52.45.81.31
netflix.com. 59 IN A 52.5.104.12
netflix.com. 59 IN A 52.45.226.110
netflix.com. 59 IN A 52.54.71.157
netflix.com. 59 IN A 52.54.76.119
netflix.com. 59 IN A 52.5.79.73
netflix.com. 59 IN A 52.54.254.24
www.netflix.com. 1724 IN CNAME www.geo.netflix.com.
www.geo.netflix.com. 1570 IN CNAME www.us-west-2.prodaa.netflix.com.
www.us-west-2.prodaa.netflix.com. 46 IN A 52.42.246.49
www.us-west-2.prodaa.netflix.com. 46 IN A 52.42.235.31
www.us-west-2.prodaa.netflix.com. 46 IN A 52.43.10.174
www.us-west-2.prodaa.netflix.com. 46 IN A 52.42.68.185
www.us-west-2.prodaa.netflix.com. 46 IN A 52.42.250.151
www.us-west-2.prodaa.netflix.com. 46 IN A 52.42.228.237
www.us-west-2.prodaa.netflix.com. 46 IN A 52.43.110.107
www.us-west-2.prodaa.netflix.com. 46 IN A 52.43.211.100
netflix.com. 899 IN SOA ns-81.awsdns-10.com. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 1800
I don't use netflix so this is needed test.
TAG_MARK=0x7000
ip rule add fwmark $TAG_MARK table main prio 9990
iptables -A PREROUTING -t mangle -m set --match-set NETFLIX dst -j MARK --set-mark $TAG_MARK/$TAG_MARK
TAG_MARK=0x7000
ip rule del prio 9990
ip rule add fwmark $TAG_MARK table main prio 9990
iptables -D PREROUTING -t mangle -m set --match-set NETFLIX dst -j MARK --set-mark $TAG_MARK/$TAG_MARK
iptables -A PREROUTING -t mangle -m set --match-set NETFLIX dst -j MARK --set-mark $TAG_MARK/$TAG_MARK
Weird. I tested your rule before with Youtube.
With my rules, other sites are connected via my US VPS and Youtube was connected via my Wan.
But with your rules, all sites accessed via my VPS.
To me, my rules work and your rules not work.
ip rule
ip route
ip route show table 11x
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
111.111.111.254 dev eth0 proto kernel scope link
111.111.111.0/24 dev eth0 proto kernel scope link src 111.111.111.111
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.1
127.0.0.0/8 dev lo scope link
default via 111.111.111.254 dev eth0
Error: argument "11x" is wrong: table id value is invalid
There is nothing on table 100~120.
# Unsure if necessary, but most policy-based routing scripts disable reverse path filtering
for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do
echo 0 > $i
done
iptables -t mangle -F PREROUTING
<sigh>
By all means you should use custom scripts that work for your environment, but please don't publish flawed script solutions to others.
@RMerlin has expended considerable time and effort to ensure that it very easy to manage Selective Routing and manually adding two simple rules (to implement Selective ipset/port Routing) surely has to be more reliable, so why take risks by 're-inventing the wheel' with flawed scripts?
Now I am testing re-write script as your advice.
#!/bin/sh
sleep 3
TAG_MARK=0x7000
ip rule del prio 9990
ip rule add fwmark $TAG_MARK table main prio 9990
modprobe xt_set
ipset -N netflix hash:ip
iptables -t mangle -D PREROUTING -m set --match-set socks dst -j MARK --set-mark $TAG_MARK/$TAG_MARK
iptables -t mangle -A PREROUTING -m set --match-set socks dst -j MARK --set-mark $TAG_MARK/$TAG_MARK
#!/bin/sh
TAG_MARK=0x7000
iptables -t mangle -D PREROUTING -m set --match-set socks dst -j MARK --set-mark $TAG_MARK/$TAG_MARK
ip rule del prio 9990
ipset -F netflix
ipset -X netflix
ip rule del fwmark 0x1000
ip rule add fwmark 0x1000 table 111 prio 10001
iptables -t mangle -D PREROUTING -i br0 -m set --match-set netflix dst -j MARK --set-mark 0x1000/0x1000
iptables -t mangle -A PREROUTING -i br0 -m set --match-set netflix dst -j MARK --set-mark 0x1000/0x1000
Now, it works as you said. many thanks @Martineau
I have one more question. How to reverse this rules ?
Main connection goes to WAN and some sites go to VPN.
DummyVPNX 172.16.0.X 0.0.0.0 VPN
Chain PREROUTING (policy ACCEPT 792K packets, 282M bytes)
num pkts bytes target prot opt in out source destination
1 0 0 MARK tcp -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set VPN5 src,dst MARK or 0x5000
2 0 0 MARK tcp -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set VPN4 src,dst MARK or 0x4000
3 0 0 MARK tcp -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set VPN4 src,dst MARK or 0x3000
4 0 0 MARK tcp -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set VPN2 src,dst MARK or 0x2000
5 0 0 MARK tcp -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set VPN1 src,dst MARK or 0x1000
6 0 0 MARK tcp -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set WAN0 src,dst MARK or 0x7000
9990: from all fwmark 0x7000 lookup main
9991: from all fwmark 0x1000 lookup NewYork
9992: from all fwmark 0x2000 lookup UK
9993: from all fwmark 0x3000 lookup ovpnc3
9994: from all fwmark 0x4000 lookup Glenmorangie
9995: from all fwmark 0x5000 lookup ovpnc5
the problem with Netflix is it uses to many subnets worldwide for one to put them all in a VPN policy rule.Maybe this will help as well as another check.
Netflix.com
I got these NF IP addresses from http://digwebinterface.com/?hostnames=Netflix.com&type=&ns=resolver&useresolver=8.8.4.4&nameservers=
www.netflix.comCode:netflix.com. 59 IN A 52.5.89.35 netflix.com. 59 IN A 52.45.81.31 netflix.com. 59 IN A 52.5.104.12 netflix.com. 59 IN A 52.45.226.110 netflix.com. 59 IN A 52.54.71.157 netflix.com. 59 IN A 52.54.76.119 netflix.com. 59 IN A 52.5.79.73 netflix.com. 59 IN A 52.54.254.24
http://digwebinterface.com/?hostnam...&ns=resolver&useresolver=8.8.4.4&nameservers=
vortex.netflix.comCode:www.netflix.com. 1724 IN CNAME www.geo.netflix.com. www.geo.netflix.com. 1570 IN CNAME www.us-west-2.prodaa.netflix.com. www.us-west-2.prodaa.netflix.com. 46 IN A 52.42.246.49 www.us-west-2.prodaa.netflix.com. 46 IN A 52.42.235.31 www.us-west-2.prodaa.netflix.com. 46 IN A 52.43.10.174 www.us-west-2.prodaa.netflix.com. 46 IN A 52.42.68.185 www.us-west-2.prodaa.netflix.com. 46 IN A 52.42.250.151 www.us-west-2.prodaa.netflix.com. 46 IN A 52.42.228.237 www.us-west-2.prodaa.netflix.com. 46 IN A 52.43.110.107 www.us-west-2.prodaa.netflix.com. 46 IN A 52.43.211.100
http://digwebinterface.com/?hostnam...&ns=resolver&useresolver=8.8.4.4&nameservers=
Code:netflix.com. 899 IN SOA ns-81.awsdns-10.com. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 1800
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!