What's new

How do I find the domains this TV App is Using ?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Code:
* * */1 * * sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128

This should kick off the command everyday.

Code:
Examples
Let us add cron job on Asuswrt Merlin Wifi router to ping gateway every 1 hour, run:

cru a pinggw "0 * * * * /bin/ping -c 10 -q 192.168.2.254"

cru = cron
a = add
pinggw = name

"timers * * * */1 * * command to be run"

Code:
cru addAS6128 "* * */1 * * sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128"

 
Last edited:
Code:
* * */1 * * sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128

This should kick off the command everyday.

Code:
Examples
Let us add cron job on Asuswrt Merlin Wifi router to ping gateway every 1 hour, run:

cru a pinggw "0 * * * * /bin/ping -c 10 -q 192.168.2.254"

cru = cron
a = add
pinggw = name

"timers * * * */1 * * command to be run"

Code:
cru addAS6128 "* * */1 * * sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128"

Ok I was able to do it by typing that in the command line but when I rebooted the router it was gone.. How do I keep it after reboot? so I don't have to re-run
cru a AS6128 "* * */1 * * sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128"

Thanks =)
 
Add it and probably a nvram save or nvram write
so just to confirm all I do is run that command right ? or do I have to create a file in jffs ? or edit a file in jffs to have cru a AS6128 "* * */1 * * sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128 inside of it ? also how do I nvram save / write?
 
Code:
* * */1 * * sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128

This should kick off the command everyday.

Code:
Examples
Let us add cron job on Asuswrt Merlin Wifi router to ping gateway every 1 hour, run:

cru a pinggw "0 * * * * /bin/ping -c 10 -q 192.168.2.254"

cru = cron
a = add
pinggw = name

"timers * * * */1 * * command to be run"

Code:
cru addAS6128 "* * */1 * * sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128"

So I'm just confused I can't get the cron job to be in cru l after reboot.. Meaning it appears if I run the command cru a AS6128 "* * */1 * * sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128 but then after reboot its gone. I tried pasting that command into services-start and still it doesn't appear.. Idk what to do ?
 
I don't know about JFFS anything because I don't use ASUS. Someone will respond or you can google it.

I use Linux as my router and there are subtleties between the two for syntax. What works for me won't work for you in Asus w/o a translation into Asus syntax. You're on the right track though with getting it to be persistent but, you need to do just a little bit of research to make it persistent in the nvram.
 
 
You could put something in the minute field if needed but, it should only run once per day with the */1 in the day field.
 
You could put something in the minute field if needed but, it should only run once per day with the */1 in the day field.
Code:
# cru a test "* * */1 * * logger test"
# cru l
* * */1 * * logger test #test#
# grep " test" /tmp/syslog.log
May 31 21:35:00 rtradmin: test
May 31 21:36:00 rtradmin: test
May 31 21:37:00 rtradmin: test
May 31 21:38:00 rtradmin: test
 
@dave14305
I suppose in this instance moving it to the hourly position would be more effective. or it needs a demarcation in the hour or minute field.

This is why we test things and verify them before leaving them to do what they're setup to do. Right?
 
@dave14305
I suppose in this instance moving it to the hourly position would be more effective. or it needs a demarcation in the hour or minute field.

This is why we test things and verify them before leaving them to do what they're setup to do. Right?
Wait now I’m even more confused lol. The cron posted above will run every minute??.. so what’s the correct code ? Also how exactly do I get this code to run automatically after each reboot ? If someone could explain it would be great =)
 
Looking at it again, the issue is ipset is not getting populated during reboot. However, it works afterward by manually run the command. Probably some timing issue?
The x3mRouting command should be in /jffs/scripts/nat-start. During bootup, when x3mRouting is run in nat-start, Entware is usually not ready yet. x3mRouting has a 120 timer waiting for Entware. Have you go through syslog during bootup to see what are the x3mRouting logs?
Code:
May  5 13:05:24 (x3mRouting.sh): 2804 Entware  not available - wait time 119 secs left
May  5 13:05:25 (x3mRouting.sh): 2804 Entware  not available - wait time 118 secs left

If Entware is ready before timer expired and x3mRouting is started properly, you probably should see something like this in your syslog. Can you check if you have something like this?
Code:
(x3mRouting.sh): IPSET created: ALTICE hash:net family inet hashsize 1024 maxelem 65536

Probably can try this: In /jffs/scripts/nat-start file, add a 10s sleep and see if it helps.
Code:
#!/bin/sh
sleep 10

By the way, this is how it gets the ip prefix for AS 6128.
Code:
curl -fsL --retry 3 --connect-timeout 3 "https://api.bgpview.io/asn/6128/prefixes" | grep -oE '.{20}([0-9]{1,3}\.){3}[0-9]{1,3}\\/[0-9]{1,2}' | grep -vF "parent" | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}\\/[0-9]{1,2}' | tr -d "\\"
 
Last edited:
I just try your command and this is seen in syslog.
Code:
Jun  1 15:46:21 RT-AC86U-DBA8 (x3mRouting.sh): 10528 Starting Script Execution 1 0 ALTICE asnum=AS6128
Jun  1 15:46:22 RT-AC86U-DBA8 (x3mRouting.sh): 10528 IPSET created: ALTICE hash:net family inet hashsize 1024 maxelem 65536
Jun  1 15:46:23 RT-AC86U-DBA8 (x3mRouting.sh): 10528 Selective Routing Rule via WAN created for ALTICE fwmark 0x8000/0x8000
Jun  1 15:46:23 RT-AC86U-DBA8 (x3mRouting.sh): 10528 iptables -t mangle -D PREROUTING -i br0 -m set --match-set ALTICE dst -j MARK --set-mark 0x8000/0x8000 2>/dev/null added to /jffs/scripts/x3mRouting/vpnclient1-route-up
Jun  1 15:46:23 RT-AC86U-DBA8 (x3mRouting.sh): 10528 iptables -t mangle -A PREROUTING -i br0 -m set --match-set ALTICE dst -j MARK --set-mark 0x8000/0x8000 added to /jffs/scripts/x3mRouting/vpnclient1-route-up
Jun  1 15:46:23 RT-AC86U-DBA8 (x3mRouting.sh): 10528 iptables -t mangle -D PREROUTING -i br0 -m set --match-set ALTICE dst -j MARK --set-mark 0x8000/0x8000 2>/dev/null added to /jffs/scripts/x3mRouting/vpnclient1-route-pre-down
Jun  1 15:46:23 RT-AC86U-DBA8 (x3mRouting.sh): 10528 sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128 added to /jffs/scripts/nat-start
Jun  1 15:46:23 RT-AC86U-DBA8 (x3mRouting.sh): 10528 Completed Script Execution

Everything looks good. When I run ipset list ALTICE I can see the full ip prefixes.
Code:
admin@RT-AC86U-DBA8:/tmp/home/root# iptables -nvL PREROUTING -t mangle
    0     0 MARK       all  --  br0    *       0.0.0.0/0            0.0.0.0/0            match-set ALTICE dst MARK or 0x8000
   
admin@RT-AC86U-DBA8:/tmp/home/root# liststats
ALTICE - 80

When I ping one of the IP from my pc routed to OpenVPN Client 1, I can see the counter increases. So it is sent over WAN.
Code:
admin@RT-AC86U-DBA8:/tmp/home/root# iptables -nvL PREROUTING -t mangle
    2   120 MARK       all  --  br0    *       0.0.0.0/0            0.0.0.0/0            match-set ALTICE dst MARK or 0x8000

When I got the chance I will try to reboot the router to reproduce the issue.
 
I just rebooted my router but unfortunately unable to reproduce the issue. IP prefixes are properly populated in the ipset. Will need to look into your syslog during bootup and see if can find anything abnormal.
Here is the syslog.
Code:
Jun  1 16:13:03 (x3mRouting.sh): 4575 Starting Script Execution 1 0 ALTICE asnum=AS6128
Jun  1 16:13:04 (x3mRouting.sh): 4575 Entware  not available - wait time 119 secs left
Jun  1 16:13:05 (x3mRouting.sh): 4575 Entware  not available - wait time 118 secs left
Jun  1 16:13:07 RT-AC86U-DBA8 (x3mRouting.sh): 4575 Selective Routing Rule via WAN created for ALTICE fwmark 0x8000/0x8000
Jun  1 16:13:07 RT-AC86U-DBA8 (x3mRouting.sh): 4575 Completed Script Execution
Jun  1 16:13:14 RT-AC86U-DBA8 (x3mRouting.sh): 9840 Starting Script Execution 1 0 ALTICE asnum=AS6128
Jun  1 16:13:22 RT-AC86U-DBA8 (x3mRouting.sh): 9840 Selective Routing Rule via WAN deleted for ALTICE fwmark 0x8000/0x8000
Jun  1 16:13:22 RT-AC86U-DBA8 (x3mRouting.sh): 9840 Selective Routing Rule via WAN created for ALTICE fwmark 0x8000/0x8000
Jun  1 16:13:26 RT-AC86U-DBA8 (x3mRouting.sh): 9840 Completed Script Execution
 
Looking at it again, the issue is ipset is not getting populated during reboot. However, it works afterward by manually run the command. Probably some timing issue?
The x3mRouting command should be in /jffs/scripts/nat-start. During bootup, when x3mRouting is run in nat-start, Entware is usually not ready yet. x3mRouting has a 120 timer waiting for Entware. Have you go through syslog during bootup to see what are the x3mRouting logs?
Code:
May  5 13:05:24 (x3mRouting.sh): 2804 Entware  not available - wait time 119 secs left
May  5 13:05:25 (x3mRouting.sh): 2804 Entware  not available - wait time 118 secs left

If Entware is ready before timer expired and x3mRouting is started properly, you probably should see something like this in your syslog. Can you check if you have something like this?
Code:
(x3mRouting.sh): IPSET created: ALTICE hash:net family inet hashsize 1024 maxelem 65536

Probably can try this: In /jffs/scripts/nat-start file, add a 10s sleep and see if it helps.
Code:
#!/bin/sh
sleep 10

By the way, this is how it gets the ip prefix for AS 6128.
Code:
curl -fsL --retry 3 --connect-timeout 3 "https://api.bgpview.io/asn/6128/prefixes" | grep -oE '.{20}([0-9]{1,3}\.){3}[0-9]{1,3}\\/[0-9]{1,2}' | grep -vF "parent" | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}\\/[0-9]{1,2}' | tr -d "\\"
I was able to get the cron job to stay after reboot by doing
#!/bin/sh
# This script gets called after all other system services
# have been started at boot on router
# ---------------------------------------------------------
#Altice x3mRouting Cron Job
sleep 180
cru a AS6128 "0 4 * * * sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ALTICE asnum=AS6128"

Thanks for this suggestion - (x3mRouting.sh): 2804 Entware not available---- I did your suggestion in /jffs/scripts/nat-start file I enabled
#!/bin/sh
sleep 10
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top