Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:advanced:ipset_extras [2023/09/23 01:13] – [Instructions] fix typo vgaetera | docs:guide-user:advanced:ipset_extras [2023/10/18 07:56] – consolidate terminology vgaetera | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| * Fetch ASN prefixes using [[https:// | * Fetch ASN prefixes using [[https:// | ||
| * Fetch GeoIP data using [[https:// | * Fetch GeoIP data using [[https:// | ||
| - | * Use [[docs: | + | * Use [[docs: |
| ===== Commands ===== | ===== Commands ===== | ||
| Line 41: | Line 41: | ||
| config_foreach ipset_proc_" | config_foreach ipset_proc_" | ||
| uci_commit firewall | uci_commit firewall | ||
| - | / | + | service |
| fw4 reload-sets | fw4 reload-sets | ||
| } | } | ||
| Line 52: | Line 52: | ||
| config_list_foreach " | config_list_foreach " | ||
| config_list_foreach " | config_list_foreach " | ||
| - | config_list_foreach " | + | config_list_foreach " |
| } | sort -u > " | } | sort -u > " | ||
| config_list_foreach " | config_list_foreach " | ||
| Line 108: | Line 108: | ||
| } | } | ||
| - | ipset_geo() { | + | ipset_geoip() { |
| local IPSET_ENTRY=" | local IPSET_ENTRY=" | ||
| wget -O - " | wget -O - " | ||
| Line 118: | Line 118: | ||
| . / | . / | ||
| - | # Fetch IP sets | + | # Configure hotplug |
| - | cat << " | + | mkdir -p / |
| - | if lock -n / | + | cat << " |
| + | if [ -z " | ||
| + | && [ ! -e / | ||
| + | || [ -n " | ||
| + | && | ||
| + | && sleep 10 | ||
| then . / | then . / | ||
| ipset setup | ipset setup | ||
| lock -u / | lock -u / | ||
| - | fi | ||
| - | EOF | ||
| - | . / | ||
| - | |||
| - | # Configure hotplug | ||
| - | mkdir -p / | ||
| - | cat << " | ||
| - | if [ ! -e / | ||
| - | then . / | ||
| fi | fi | ||
| EOF | EOF | ||
| Line 141: | Line 137: | ||
| # Configure cron | # Configure cron | ||
| cat << " | cat << " | ||
| - | 0 */3 * * * . /etc/nftables.d/ | + | 0 */3 * * * . /etc/hotplug.d/online/70-ipset-setup |
| EOF | EOF | ||
| - | / | + | service |
| </ | </ | ||
| Line 162: | Line 158: | ||
| uci add_list dhcp.example.asn=" | uci add_list dhcp.example.asn=" | ||
| uci add_list dhcp.example.asn=" | uci add_list dhcp.example.asn=" | ||
| - | uci add_list dhcp.example.geo=" | + | uci add_list dhcp.example.geoip=" |
| - | uci add_list dhcp.example.geo=" | + | uci add_list dhcp.example.geoip=" |
| uci commit dhcp | uci commit dhcp | ||