What's new

Ipset availability

  • 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!

robcore

New Around Here
Hey folks!
New to the crew and have to thank everyone (especially RMerlin of course) for the knowledge and useful tools I've gained from lurking.

Quick question because the wiki doesn't have it listed: does the 86U kernel support ipset? Just want to double check so I know which direction to go with a utility I'm writing. Thanks and take care!
 
Hey folks!
New to the crew and have to thank everyone (especially RMerlin of course) for the knowledge and useful tools I've gained from lurking.

Quick question because the wiki doesn't have it listed: does the 86U kernel support ipset? Just want to double check so I know which direction to go with a utility I'm writing. Thanks and take care!

Using on my AC88U.
Code:
ipset -v
ipset v6.32, protocol version: 6

Code:
#cat dnsmasq.conf.add

ipset=/cbs.com/cbsnews.com/www.cbsnews.com/cbssports.com/cbssports.com/x3mRouting_CBS_WEB
ipset=/hulu.com/x3mRouting_HULU_WEB
ipset=/amazonaws.com/netflix.com/netflix.net/nflxvideo.net/nflximg.net/nflxext.com/nflxso.net/x3mRouting_NETFLIX_WEB
ipset=/co.uk/x3mRouting_BBC_WEB
 
Using on my AC88U.
Code:
ipset -v
ipset v6.32, protocol version: 6

Code:
#cat dnsmasq.conf.add

ipset=/cbs.com/cbsnews.com/www.cbsnews.com/cbssports.com/cbssports.com/x3mRouting_CBS_WEB
ipset=/hulu.com/x3mRouting_HULU_WEB
ipset=/amazonaws.com/netflix.com/netflix.net/nflxvideo.net/nflximg.net/nflxext.com/nflxso.net/x3mRouting_NETFLIX_WEB
ipset=/co.uk/x3mRouting_BBC_WEB
Thanks mate! Though the 88U is listed as supported, and despite having the entware package, I just need to know if the 86U kernel was built with the necessary patchset.
 
Here is a utility I wrote to display the number of entries in each IPSET list. Place the code in /jffs/configs/profile.add. The command will work when you open up a new SSH session. Type liststats at the command prompt.

Code:
liststats () {
    GREEN='\033[0;32m'
    RED='\033[0;31m'
    NC='\033[0m' # No Color
    true > /tmp/liststats
    for SETLIST in $(ipset -L -n); do
        printf '%s - %b%s%b\n' "$SETLIST" "$GREEN" "$(($(ipset -L "$SETLIST" | wc -l) - 8))" "$NC" >> /tmp/liststats
    done
    cat /tmp/liststats | sort
    rm /tmp/liststats
}
 
This is a handy utility first written by @redhat27 with some mods I had to make for my environment. It should work for everyone. At the command prompt, type MatchIP xx.xx.xx.xx. where the xx is an IP or NET address. It will then search thru all of the setlists for the entry.
Code:
MatchIP() { # Check IP against ipset lists
  if [ -z "$1" ]; then
    echo "Specify IP to check through ipset lists. Exiting."
  else
    GREEN='\033[0;32m'
    RED='\033[0;31m'
    NC='\033[0m' # No Color
do
    for SETLIST in $(ipset -L -n); do
          ipset -q test $SETLIST $1 && echo -e "$1 found in ${GREEN}${SETLIST}${NC}" || echo -e "$1 not found in ${RED}${SETLIST}${NC}"
    done
  fi
}
 

Similar threads

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