A
A
Alexander Nazarov2018-06-20 17:50:03
linux
Alexander Nazarov, 2018-06-20 17:50:03

How to create a rule for iptables+geoip?

There is this rule:

iptables -I INPUT ! -i lo -m geoip ! --src-cc RU -m comment --comment test -j DROP

All traffic is closed, except for Russia. But there is a certain, non-Russian ip address ( 12.34.56.78 ), which I would like to open access to.
As a result, it should turn out that you can only connect to the server from Russian ip and from one non-Russian 12.34.56.78

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mureevms, 2018-06-20
@wergio

Matter of priority

iptables -I INPUT -s 12.34.56.78 -j ACCEPT
iptables -A INPUT ! -i lo -m geoip ! --src-cc RU -m comment --comment test -j DROP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question