I created it with this command exactly: sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 Cablevision-ASN asnum=AS6128 # Route-Altice-One traffic via WanHow to you create your ipset? When you run “cru l | grep ipset”, do you see cronjob that save your ipset?
You should see something like this. It is stored in /opt/tmp directory.
Code:0 2 * * * ipset save $IPSET_NAME > /opt/tmp/$IPSET_NAME
When I run cru l | grep ipset it doesn't appear to do anything with SSH. I mean it works for some time but then it seems like they get deleted on there own. Like I just reran the commands to make the IPSETs and now it shows thisHow to you create your ipset? When you run “cru l | grep ipset”, do you see cronjob that save your ipset?
You should see something like this. It is stored in /opt/tmp directory.
Code:0 2 * * * ipset save $IPSET_NAME > /opt/tmp/$IPSET_NAME
By right you should have cronjob to save ipset entries. You can try to manually save a copy first.When I run cru l | grep ipset it doesn't appear to do anything with SSH. I mean it works for some time but then it seems like they get deleted on there own. Like I just reran the commands to make the IPSETs and now it shows this
AMAZONPRIME - 6397
Cablevision-ASN - 68
HULU - 3954
However.. Sometimes I reboot and it shows 0 and then the rules don't work.
admin@RT-AC86U-DBA8:/tmp/home/root# cru l | grep ipset
0 2 * * * ipset save Astro > /opt/tmp/Astro #Astro#
…snipped…
admin@RT-AC86U-DBA8:/tmp/home/root# wc -l /opt/tmp/Astro
765 /opt/tmp/Astro
admin@RT-AC86U-DBA8:/tmp/home/root# liststats
Astro - 764
Hmm, not sure what went wrong. You mentioned you have to recreate the rules after reboot. By right you don’t need to. The rules are stored in /jffs/scripts/nat-start and /jffs/config/dnsmasq.conf.addHere's what happens. When I run cru l I don't see anything mentioned about IPSET's
How do I do that?Hmm, not sure what went wrong. You mentioned you have to recreate the rules after reboot. By right you don’t need to. The rules are stored in /jffs/scripts/nat-start and /jffs/config/dnsmasq.conf.add
Can you check if the rules exists in these files?
I think you are right that you don't see this in dnsmasq.conf.add because you are using asnum. My use case is a bit different as I don't use asnum. Instead I use dnsmasq.So this is my nat-start:
#!/bin/sh
sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 AMAZONPRIME asnum=AS16509
sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 HULU asnum=AS20940
sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 Cablevision-ASN asnum=AS6128
sh /jffs/scripts/x3mRouting/x3mRouting.sh ipset_name=AMAZONPRIME asnum=AS16509
sh /jffs/scripts/x3mRouting/x3mRouting.sh ipset_name=HULU asnum=AS20940
sh /jffs/scripts/x3mRouting/x3mRouting.sh ipset_name=Cablevision-ASN asnum=AS6128
I DO NOT SEE A /jffs/config/dnsmasq.conf.add when I browse using SFTP cyperduck..
admin@RT-AC86U-DBA8:/# sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 AMAZONPRIME asnum=AS16509
(x3mRouting.sh): 29579 Starting Script Execution 1 0 AMAZONPRIME asnum=AS16509
(x3mRouting.sh): 29579 IPSET created: AMAZONPRIME hash:net family inet hashsize 1024 maxelem 65536
(x3mRouting.sh): 29579 Selective Routing Rule via WAN created for AMAZONPRIME fwmark 0x8000/0x8000
(x3mRouting.sh): 29579 iptables -t mangle -D PREROUTING -i br0 -m set --match-set AMAZONPRIME dst -j MARK --set-mark 0x8000/0x8000 2>/dev/null added to /jffs/scripts/x3mRouting/vpnclient1-route-up
(x3mRouting.sh): 29579 iptables -t mangle -A PREROUTING -i br0 -m set --match-set AMAZONPRIME dst -j MARK --set-mark 0x8000/0x8000 added to /jffs/scripts/x3mRouting/vpnclient1-route-up
(x3mRouting.sh): 29579 iptables -t mangle -D PREROUTING -i br0 -m set --match-set AMAZONPRIME dst -j MARK --set-mark 0x8000/0x8000 2>/dev/null added to /jffs/scripts/x3mRouting/vpnclient1-route-pre-down
(x3mRouting.sh): 29579 sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 AMAZONPRIME asnum=AS16509 added to /jffs/scripts/nat-start
(x3mRouting.sh): 29579 Completed Script Execution
admin@RT-AC86U-DBA8:/# sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ipset_name=test dnsmasq=test.com
(x3mRouting.sh): 1089 Starting Script Execution 1 0 ipset_name=test dnsmasq=test.com
(x3mRouting.sh): 1089 CRON schedule created: #test# '0 2 * * * ipset save test'
(x3mRouting.sh): 1089 Completed Script Execution
Great that you found the issue. Just don't install x3mRouting option 2. Option 2 OVPN Client screen does not work with VPN Director. Use option 3.So I think I found the problem. I have inactive rules in VPN Director. I notice that if I enable or disable or even modify those rules then after I reboot the router the IPSET lists go back to 0. It seems to be an incompatibility with x3mrouting and VPN Director. I now seem to have fixed it by just having the four devices I actually use with VPN Director. So I removed all the rules that I have created just in case I needed them and now it seems stable. It seems like editing the VPN Director rule list it messes up the IPSETS.
I am. That is why I thought I wouldn't have any issues. It appears if you play around with the rules list and your using option 3 it messes up the IPSET lists after a reboot. Must be some incompatibility but at least it works if I don't touch anything. Hopefully someone takes over x3mrouting to update it for Director.Great that you found the issue. Just don't install x3mRouting option 2. Option 2 OVPN Client screen does not work with VPN Director. Use option 3.
The script uses https://api.bgpview.io to download the ipset content from. This site has been known to ratelimit quite a bit (it has affected Skynet as well). You’ll have to look deeper into what‘s happening when the script tries to download the asn data. The script author is MIA for a long time.Any idea on why every reboot my ipsets become 0 ? I have never had this problem before @RMerlin
Certainly, most likely. The question is if you or anyone else would invest the time to do it.So is there a way to make IPSets without this script and also it works it just like erases after reboot.
Download_ASN_Ipset_List()
you will find how the asn ipsets are downloaded and put in the set.
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!