Created
December 4, 2018 10:25
-
-
Save nyrahul/2570a7b0d273b8bf7b6bc5f4c905aaf2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Iptables ip/port range spec: | |
Multiple individual ports: | |
iptables -t mangle -A OUTPUT -p udp --match multiport --dports 110,143,993,955 -j MARK --set-mark 13 | |
Port Range: | |
iptables -t mangle -A OUTPUT -p udp --match multiport --dports 1024:3000 -j MARK --set-mark 13 | |
Multiple Port ranges: | |
iptables -t mangle -A OUTPUT -p udp --match multiport --dports 1000:2000,3000:4000 -j MARK --set-mark 13 | |
Port ranges and individual ports mixed: | |
iptables -t mangle -A OUTPUT -p udp --match multiport --dports 1000:2000,3000:4000,10,20,30 -j MARK --set-mark 13 | |
IP address range: | |
iptables -t mangle -A OUTPUT -p udp -m iprange --dst-range 192.168.10.100-192.168.10.200 -j MARK --set-mark 13 | |
IP address range (last octet range) | |
iptables -t mangle -A OUTPUT -p udp -m iprange --dst-range 192.168.10.80-100 -j MARK --set-mark 13 | |
… matches ip address range 192.168.10.80 to 192.168.10.100 | |
IP address mask: | |
iptables -t mangle -A OUTPUT -p tcp -d 192.168.10.10/24 -j MARK --set-mark 13 | |
Filtering specific ports | |
iptables -A INPUT -s 81.48.0.0/16 -p udp --destination-port ! 80 -j DROP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment