Created
October 21, 2011 13:12
-
-
Save dcarley/1303820 to your computer and use it in GitHub Desktop.
IPtables negating ports in a rule
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
[root@puppet ~]# cat /etc/redhat-release | |
CentOS release 5.7 (Final) | |
[root@puppet ~]# service iptables stop | |
Flushing firewall rules: [ OK ] | |
Setting chains to policy ACCEPT: filter [ OK ] | |
Unloading iptables modules: [ OK ] | |
[root@puppet ~]# iptables -t filter -A INPUT -p tcp -m tcp -m multiport --dports 80,443 -m comment --comment "foo" -j ACCEPT | |
[root@puppet ~]# service iptables status | |
Table: filter | |
Chain INPUT (policy ACCEPT) | |
num target prot opt source destination | |
1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp multiport dports ! 80:443 /* foo */ | |
Chain FORWARD (policy ACCEPT) | |
num target prot opt source destination | |
Chain OUTPUT (policy ACCEPT) | |
num target prot opt source destination |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment