Score:0

ad block of 100 IPs at once to Ubuntu 20.04.3

cn flag

I need to add 100+ IPs to a single interface, which is trivial to accomplish on other versions of Linux in one single line. How do I accomplish the same with Netplan or, if not even possible, with standard Debian networking ifupdown. And if the case is that Netplan can not do this, which is the canonical procedure to replace Netplan?

ar flag
Blocking IPs could be done by a firewall like `ufw` or `iptable`.
waltinator avatar
it flag
See https://netplan.io/ and read `man seq` (for generating 100+ IP Addresses)
user3021543 avatar
cn flag
do I need to add 254 lines or maybe 1000 lines to the config file?
ar flag
`sudo apt install ipset`. And use an "ipset" to store your IPs, and add a rule using that ipset to your firewall.
Score:0
us flag

netplan works on addresses, and neither it nor the Linux kernel has the concept of assigning "ranges" of addresses to an interface. You can list out your addresses in your netplan config; you can also write a script in the language of your choice to generate the netplan config based on your range of IPs.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.