1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

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!

Skynet - Asus Firewall Addition

Discussion in 'Asuswrt-Merlin' started by Adamm, Apr 16, 2014.

  1. Torson

    Torson Occasional Visitor

    Joined:
    Aug 3, 2018
    Messages:
    19
    My question is with regards to post #3191 - configuring fast-switch (aka wife-mode.)
    I'm running Skynet 6.5.3 and tried the suggestion in the above mentioned post to configure the custom filter url (to enable switching)

    sh /jffs/scripts/firewall fs www.google.com/filter.list (I replaced wm with fs). This results in:

    Fast Swap Enabled
    Custom Filter Detected: www.google.com/filter.list
    [*] 404 Error Detected - Stopping Banmalware

    Also, running 'firewall fs' yields a 'Skynet: [*] Wife-Mode URL Not Detected - Stopping Banmalware'.

    Any suggestions? BTW - under 11 - Settings in the main interface there's an option 9 - Fast Swap - I assume that wife-mode, fast-switch and fast swap are one and the same thing. Is that correct?
     
  2. Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!
  3. Adamm

    Adamm Very Senior Member

    Joined:
    Mar 26, 2013
    Messages:
    1,682
    You are right in saying the wording is.. inconsistent. I've corrected this and pushed an update so it is correctly referenced throughout the script as "Fast Switch".

    As for functionality, the command didn't work becuase you are supposed to replace the url with a real one, google certianly isn't hosting skynet content on its main domain :p
     
    Torson, TAG02 and bitmonster like this.
  4. JemTheWire

    JemTheWire Regular Contributor

    Joined:
    Jan 12, 2016
    Messages:
    90
    Location:
    UK, Manchester
    Just out of interest, what exactly is ‘wife mode’?

    I have heard it mentioned but cannot seem to find out what it means/does.

    Thanks
     
    consorts likes this.
  5. visortgw

    visortgw Senior Member

    Joined:
    Jun 18, 2015
    Messages:
    228
    "Wife mode" allows you to temporarily switch to an alternate filter typically to relax filters, allowing "wife" to shop, etc. on sites normally blocked.
     
    nodnarb91 and JemTheWire like this.
  6. Torson

    Torson Occasional Visitor

    Joined:
    Aug 3, 2018
    Messages:
    19
    Would it be possible to have a default of some 3 urls to chose from, known to be shopping etc friendly and then also the option to input your own? Something like Diversion where fast switch allows to have a current pair out of small / standard / medium / large lists plus edits.
     
  7. Adamm

    Adamm Very Senior Member

    Joined:
    Mar 26, 2013
    Messages:
    1,682
    I've pushed v6.5.5

    Code:
    Add connectivity test
    Lower lockfile kill timeout to 30mins from 3hrs
    Add cloudflare dns to exclusion filter
    Correct exit codes
    Better tmp file management (/tmp/skynet/)
    Fix whitelist removal bug
    The biggest change is the new connectivity test. Let me know if it causes any issues as Skynet will now only allow certain commands after it checks your internet connectivity (4 attempts over a 30s period) to prevent issues downloading lists/updates etc. Most of the other changes are internal.
     
    Quoc Huynh, SMS786, eclp and 7 others like this.
  8. bitmonster

    bitmonster Regular Contributor

    Joined:
    Sep 26, 2018
    Messages:
    181
    Thanks.. Really appreciate your work as always..

    What's Cloudflare exclusion about? I use Cloudflare DNS (1.1.1.1)

    Sent from my SM-G965F using Tapatalk
     
  9. skeal

    skeal Part of the Furniture

    Joined:
    Apr 30, 2016
    Messages:
    2,001
    Location:
    /etc
    In some user configs the 1.1.1.1 addressed was somehow banned. @Adamm fixed it.
     
    Adamm likes this.
  10. bitmonster

    bitmonster Regular Contributor

    Joined:
    Sep 26, 2018
    Messages:
    181
    There is a lot of junk on that route apparently so I could see why... Works fine though.

    Sent from my SM-G965F using Tapatalk
     
  11. NSNE

    NSNE Occasional Visitor

    Joined:
    Jan 23, 2011
    Messages:
    32
    Apologies if this was mentioned in one of the previous 169 pages, but why is the USB drive required?

    I'm contemplating installing Skynet because there's one IP address that will not leave my network alone. "EXPLOIT Remote Command Execution via Shell Script -2" every two or three hours.
     
  12. skeal

    skeal Part of the Furniture

    Joined:
    Apr 30, 2016
    Messages:
    2,001
    Location:
    /etc
    Skynet requires a swap file to operate now. The swap is put on your usb stick. This is done during the install.
     
    Adamm likes this.
  13. skeal

    skeal Part of the Furniture

    Joined:
    Apr 30, 2016
    Messages:
    2,001
    Location:
    /etc
    I would recommend you read the 1st post on the first page. It has everything you need.:oops::rolleyes::)
     
  14. Skeptical.me

    Skeptical.me Senior Member

    Joined:
    Sep 22, 2016
    Messages:
    239
    Location:
    Australia
    [​IMG] [​IMG]
    So, I'm trying to delete the old swap file path.

    The swap file doesn't exist but it's path remains in the router. And I'm not sure how to delete.

    However, I seem to have an issue. It appears Skynet won't start:
     
  15. Adamm

    Adamm Very Senior Member

    Joined:
    Mar 26, 2013
    Messages:
    1,682
    Use;

    Code:
    sh /jffs/scripts/firewall debug swap uninstall
    sh /jffs/scripts/firewall debug swap install
    If that doesn't work, you will need to remove the entry manually from the post-mount file and reboot.
     
    Skeptical.me likes this.
  16. Skeptical.me

    Skeptical.me Senior Member

    Joined:
    Sep 22, 2016
    Messages:
    239
    Location:
    Australia
    Thank you very much!! That fixed it, perfect.
     
  17. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,623
    Location:
    Switzerland
    Would be a good idea to add further checks in our swap tests for such cases.
    What I don't like is the device name/label in the path. The way Diversion starts Entware has so far proofed as being 100% reliable. I'm thinking of implementing the same for swap.
    But before I can start coding I have to solve my "cpu overtemperature error" on my workhorse. Asus Sabertooth z77 MB is a pain in the ass if you set the bios settings wrong, even resetting to default won't solve it.
    Something to do for a lazy Saturday I guess...
     
  18. Adamm

    Adamm Very Senior Member

    Joined:
    Mar 26, 2013
    Messages:
    1,682
    I anticipated this might happen a few months ago (pointing to a non existent swap file), so my uninstallation function will remove the post-mount entry if the file doesn't exist, I'm going to carry over a similar check to my startup code. Might be worth adjusting diversion in a similar way.

    Code:
                            if ! grep -qF "swapon" /jffs/scripts/post-mount 2>/dev/null; then echo "[*] No SWAP File Detected - Exiting!"; echo; exit 1; fi
                            swaplocation="$(grep -o "swapon .*" /jffs/scripts/post-mount | awk '{print $2}')"
                            Save_IPSets >/dev/null 2>&1
                            echo "[i] Unloading Skynet Components"
                            Unload_Cron "all"
                            Unload_IPTables
                            Unload_DebugIPTables
                            Unload_IPSets
                            echo "[i] Removing SWAP File ($swaplocation)"
                            if [ -f "$swaplocation" ]; then
                                sed -i '\~swapon ~d' /jffs/scripts/post-mount
                                swapoff "$swaplocation"
                                if rm -rf "$swaplocation"; then echo "[i] SWAP File Removed"; else "[*] SWAP File Partially Removed - Please Inspect Manually"; fi
                            else
                                sed -i '\~swapon ~d' /jffs/scripts/post-mount
                                echo "[*] SWAP File Partially Removed - Please Inspect Manually"
                            fi
    
     
    Last edited: Nov 3, 2018
  19. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,623
    Location:
    Switzerland
    amtm has better code for such situations and offers to correct paths or remove the post-mount entry. Diversion will have it in an upcoming update.
    I'm still thinking about having something like this in post-mount instead of the hard path:
    Code:
    swapFile="$(find /mnt/*/myswap.swp 2> /dev/null)"
    Now that my overheating problem is solved by getting a new CPU water cooler I might have some time.
     
  20. Marin

    Marin Senior Member

    Joined:
    Sep 15, 2015
    Messages:
    233
    @Adamm—-when I installed Skynet last night, went with 2GB option for my swap file as I wasn’t sure what to go with (option 4 I think). Is that too much space?

    I am currently using a Sandisk Ultra Flair 16GB thumb drive so I wasn’t very concerned.

    Thank you!




    Sent from my iPhone using Tapatalk
     
  21. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,623
    Location:
    Switzerland
    I usually set it to the same as the routers memory/RAM. 256MB works 99% of the time. Yours is certainly never exhausted.
     
    Marin likes this.
Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!