O
O
ObehanProger2019-07-20 15:06:13
bash
ObehanProger, 2019-07-20 15:06:13

How to transfer ip addresses from file to ipset?

We need a bash script that would read line by line the file-list of ip-addresses badips.txt, compare each ip with badips already in ipset and add new ones (those that are not in ipset) to this ipset. How to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CityCat4, 2019-07-20
@CityCat4

Obviously man ipset read:
add SETNAME ADD-ENTRY [ ADD-OPTIONS ]
Add a given entry to the set. If the -exist option is specified, ipset ignores if the
entry already added to the set.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question