Re: how to only allow tcp on dport 443 on the OUTPUT chain?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 08 Mar 2011 23:35:41 -0800
erikmccaskey64 <erikmccaskey64@xxxxxxxx> wrote:

> If i want to block udp on dport 80 on the output chain, then is this
> enough? i want to only allow tcp on it! iptables -P OUTPUT DROP
> iptables -A OUTPUT -o $PUBIF --dport 80 -j ACCEPT
> 
> 
> or i need this rule?
> iptables -P OUTPUT DROP
> iptables -A OUTPUT -o $PUBIF -p tcp --dport 80 -j ACCEPT
> 
> 
> the second one is the good one?
> 
> 

I think you need to use a a couple of rules like
iptables -A OUTPUT -o $PUBIF -p !tcp --dport 80 -j DROP
iptables -A OUTPUT -o $PUBIF -p tcp --dport 80 -j ACCEPT

The first rule will drop anything not tcp on port 80. The second rule
will accept anything tcp on port 80.  If you only want to drop udp,
change the first rule to
iptables -A OUTPUT -o $PUBIF -p udp --dport 80 -j DROP
iptables -A OUTPUT -o $PUBIF -p all --dport 80 -j ACCEPT

If you are using an output rule that accepts everything
outbound like the default Fedora firewall, you will have to put these
rules in front of that.
iptables -I OUTPUT -o $PUBIF -p tcp --dport 80 -j ACCEPT
iptables -I OUTPUT -o $PUBIF -p !tcp --dport 80 -j DROP
Note the reversed order, since these are being inserted instead of
appended.
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux