0

how to load ipset definition (one setname or more) on reboot from certain file ?

for example I have ssh access to linuxbox and want to update setname periodically that way that I have one simple textfile for each setname that will be modified through the winscp editor for example... or load it from remote file http or ftp accessible - this would be good for more managed linuxboxes from one place.

Peter Maly
  • 31
  • 2
  • 6

1 Answers1

1

very very shortened version:

wget -qN http://192.168.10.50:9997/MT/maclist_raw
maclist_data=$(cat maclist_raw)
ipset create ipset_list_name hash:mac
for row_data in $maclist_data; do ipset add ipset_list_name ${row_data}; done
  • automation after restart not included because of much versions of linux os's. create self. this is manual method... every line is code self

1./ download source data with mac list (one MAC on one line)
2./ read data from the downloaded file into variable
3./ create some ipset list "ipset_list_name" - type: "hash:mac"
4./ loop through every line of variable and use it as input data for ipsec command add one MAC to list

Peter Maly
  • 31
  • 2
  • 6