Answer the question
In order to leave comments, you need to log in
How to add IP ranges to IPTABLES whitelist?
iptables -I INPUT -p tcp -m multiport --dports http,https -s 173.245.48.0 -j ACCEPT
How to add ranges according to command examples above?
173.245.48.0/20
103.21.21.244.0 /22
​​103.22.200.0.0 /22
​​103.31.4.0/22 ​​141.101.64.0/18 108.162.192.192.0
/
18
190.93.240.0/20
188.114.96.0/20
197.234.240.0/22
​​198.41.128.0/17.0/17.0/17.28.0/17.28.0/17.28.28.28.28.28.28.28.28.28.28.28.28.28.28.28.28.28.28.28.28.28.28.2L
162.158.0.0/15
104.16.0.0/12
172.64.0.0/13
131.0.72.0/22
​​Found the script
https://gist.github.com/Manouchehri/cdd4e56db6596e...
Is this what you need?
Answer the question
In order to leave comments, you need to log in
Either one subnet per line and thus there will be several iptables commands, or, as advised above, collect them all into one ipset and submit its name to iptables (ipset is reset when the OS is rebooted)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question