How to: add ipranges to iptables

Howto add ipranges to iptables

Do you need to add an iprange to iptables?

This is how you do it:

iptables -A INPUT -p tcp --destination-port 9090 -m iprange --src-range 192.168.0.2-192.168.0.200 -j ACCEPT

Then do not forget to save it:

service iptables save

Then you need to restart the service

service iptables restart

I am a Senior System Administrator that work daily with Virtualization,Xenserver, Linux, IT automation, Ansible,Windows, Active Directory, Exchange and a lot more. Here you will find tips and trix from early junior, middle junior and senior to unique information of the topics I mentioned earlier. If you need help with something do not hesitate to contact me I will gladly help.

Tagged with: ,