How do I block IPs from a certain country with nftables?

Linode Staff

I'm seeing a lot of attacks lately from a specific country, and I'd like to be able to block all of its IP addresses using nftables.

1 Reply

You can't. You can, however, block lists of IP addresses and networks with a single rule. You need some mechanism for forming the lists based on a list of sources of such data. Maintaining the lists manually is never going to work out.

-- sw


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct