IPSETD-NG SQLite driver manual

IPSETD-NG SQLite driver is part of the package IPSET-NG and operates only in the server part IPSETD-NG.
SQLite database driver is the secondary driver of the IPSET-NG system, use this driver we recommend on platforms where there is no installed package libipset and you can not install it.
We recommend to use the ipset driver in connection with its fuller functionality and direct appeals to the resources of the system, which reduces the overall load in more traffic.
Support direct Internet protocol version 4 and 6 for iptables operation compatible.
For details, see the settings in the configuration file.

  • SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file. SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world.
  • SQLite is provided under public domain License.

Support and features:

Tables command:

  • create <table name>: create table name in specific SQLite database and create same name iptables chain, a rule is created in the iptable specifies the INPUT to check IP address of the created chain. Iptables target table in IPv4 or IPv6 determined by the HASH table type automatically.
  • destroy <table name>: delete table name in specific SQLite database and delete same name iptables chain, a same name rule in ip table specifies the INPUT also remove.
  • flush <table name>: erase body data in SQLite table table name and flush same name iptables chain.

Items command:

  • add <ip address>: add ip address to specific table in SQLite database and insert or append ip address to same name chain. Iptables target table is IPv4 or IPv6 is determined by the type of IP addresses automatically.
  • del <ip address>: delete ip address to specific table in SQLite database and delete ip address to the same name chain.
  • test <ip address>: check availability ip address in specific table from SQLite database.

Example configuration file

Example configuration file to set SQLite driver: ipsetd-ng.conf, ipsetcmd-ng.conf:


        [driver]
        # path to dynamic driver directory
        # create automaticaly from make, default: '/usr/lib/ipsetng'
        path = /usr/lib/ipsetng

        # name of use driver, explore: /usr/lib/ipsetng/drv-<name>-ng.so
        name = sqlite3

        # WARNING: this iptables setting can be used in all drivers except the driver ipset
        # enable iptables add or delete direct to kernel
        iptenable = yes

        # chain of iptables
        iptchain = INPUT

        # table of iptables
        ipttable = filter

        # target of iptables
        iptrule =  DROP

        # method for adding to table: insert | append
        iptmethod = append


        # SQL Lite 3 diver
        [drv-sqlite3]

        # path & file data base
        dbase = /path/myipdb.db

        # path & file to exec on add or delete ip address
        exec = /path/to/file.sh



  Meta Tags: IPSETD-NG SQLite driver ipset