This script should help: https://www.snbforums.com/threads/selective-routing-for-netflix.42661/Hello!
Do you guys know if it is possible to whitelist some specific websites and online games when using OpenVPN?
For example no need to use VPN when using netflix or playing games.
Thank you great people!!
This script should help: https://www.snbforums.com/threads/selective-routing-for-netflix.42661/
@Xentrk
Oh i see, that seems to be a big project.
I wish merlin had something that is easy as dd-wrt's solution.
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1158919#1158919
./Xentrk_Martineau_IPSET_Domains.sh 0 REDDIT reddit.com
(Xentrk_Martineau_IPSET_Domains.sh): 17027 Starting Script Execution
(Xentrk_Martineau_IPSET_Domains.sh): 17027 IPSET created: REDDIT hash:net family inet hashsize 1024 maxelem 65536
(Xentrk_Martineau_IPSET_Domains.sh): 17027 CRON schedule created: #REDDIT# '0 2 * * * ipset save REDDIT'
(Xentrk_Martineau_IPSET_Domains.sh): 17027 Selective Routing Rule via WAN created (TAG fwmark 0x8000/0x8000)
(Xentrk_Martineau_IPSET_Domains.sh): 17027 Completed Script Execution
ipset list REDDIT
Name: REDDIT
Type: hash:net
Revision: 6
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 316
References: 1
Number of entries: 0
nslookup reddit.com
Server: 127.0.0.1
Address 1: 127.0.0.1 localhost.localdomain
Name: reddit.com
Address 1: 151.101.1.140
Address 2: 151.101.65.140
Address 3: 151.101.129.140
Address 4: 151.101.193.140
ipset list REDDIT
Name: REDDIT
Type: hash:net
Revision: 6
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 540
References: 1
Number of entries: 4
Members:
151.101.65.140
151.101.193.140
151.101.1.140
151.101.129.140
./Xentrk_Martineau_IPSET_Domains.sh 0 DVDNetflix www.dvd.netlfix.com
I have been trying to get this to work for a specific IP (dvd.netflix.com) but have not been successful. For those who have Netflix, this is the DVD section of the site. @Xentrk's Netflix script works well for streaming but for some reason it doesn't work for this particular section of the site.
Fortunately, when I use nslookup dvd.netflix.com, I only get one IP address. I tried the policy rules via and placed the IP of the above domain into the source IP (and WAN) but still can't access it.
@Martineau - I tried to use your above post to build a similar code into my /jffs/scripts/nat-start but I couldn't get it work:
Code:./Xentrk_Martineau_IPSET_Domains.sh 0 DVDNetflix www.dvd.netlfix.com
Anything I am doing wrong?
Thank you for your help!
nslookup www.dvd.netflix.com
Server: 127.0.0.1
Address 1: 127.0.0.1 localhost.localdomain
Name: www.dvd.netflix.com
Address 1: 207.45.72.201
nslookup dvd.netflix.com
Server: 127.0.0.1
Address 1: 127.0.0.1 localhost.localdomain
Name: dvd.netflix.com
Address 1: 207.45.72.201
ipset=/netflix.com/NETFLIX
Mar 10 21:48:32 dnsmasq[32249]: ipset add NETFLIX 207.45.72.201 www.dvd.netflix.com
ipset=/amazonaws.com/netflix.com/nflxext.com/nflximg.net/nflxso.net/nflxvideo.net/x3mRouting_NETFLIX_DNSMASQ
ipset=/amazonaws.com/netflix.com/nflxext.com/nflximg.net/nflxso.net/nflxvideo.net/dvd.netflix.com/x3mRouting_NETFLIX_DNSMASQ
If the domain 'www.dvd.netflix.com' truly resolves to a single IP address
Code:nslookup www.dvd.netflix.com Server: 127.0.0.1 Address 1: 127.0.0.1 localhost.localdomain Name: www.dvd.netflix.com Address 1: 207.45.72.201
then if manually adding the single IP to the Selective routing GUI doesn't work, then presumably the IP address probably isn't a single entity or you are missing another associated URL/domain?Code:nslookup dvd.netflix.com Server: 127.0.0.1 Address 1: 127.0.0.1 localhost.localdomain Name: dvd.netflix.com Address 1: 207.45.72.201
If however you are concerned that your IPSET DVDNetflix apparently isn't being populated, then this is probably because there may already be an existing dnsmasq directive that extracts any '*.netflix.com' ?
e.g. on my system it appears I already have:
entry...as shown by the following entry found in 'dnsmasq.log'Code:ipset=/netflix.com/NETFLIX
Code:Mar 10 21:48:32 dnsmasq[32249]: ipset add NETFLIX 207.45.72.201 www.dvd.netflix.com
@Marin, what script are you using?
In the IPSET_Netflix.sh script, I am pulling down AS2906 for Netflix IPv4 addresses. dvd.netflix.com belongs to another AS Number - AS394406. So, it is not included.
View attachment 16518
You can manually add it to the x3mRouting_NETFLIX ipset list using the syntax @Martineau posts above. e.g. ipset add x3mRouting_NETFLIX 207.45.72.201
However, the IPv4 address will get wiped out during a refresh.
In IPSET_Netflix_Domains.sh, lines with the reference
would need to be modified to include the dvd.netflix.com domain:Code:ipset=/amazonaws.com/netflix.com/nflxext.com/nflximg.net/nflxso.net/nflxvideo.net/x3mRouting_NETFLIX_DNSMASQ
Code:ipset=/amazonaws.com/netflix.com/nflxext.com/nflximg.net/nflxso.net/nflxvideo.net/dvd.netflix.com/x3mRouting_NETFLIX_DNSMASQ
If you manually update the ipset list domain names in dnsmasq.conf.add to include dvd.netflix.com, remember to bounce dnsmasq so it takes affect.
service restart_dnsmasq
Those are the work arounds for now. I have to fix one issue with the code. While in there, I can look into including dvd.netflix.com.
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!