[CentOS] Easy way to reject all incoming packets except from certain IPs?
Troy Engel
tengel at fluid.comWed Feb 1 00:38:18 UTC 2006
- Previous message: [CentOS] OT - Linux NAS for Windows Environment
- Next message: [CentOS] Easy way to reject all incoming packets except from certain IPs?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Preston Crawford wrote: > Is there an easy way to reject all incoming packets except those that > come from certain IPs? I can't find any way via iptables or via the GUI See this great iptables example: http://oceanpark.com/notes/firewall_example.html In your case it'll be a whole lot simpler, all you'll need are the initial drop rules for all traffic, then a rule or two to allow XYZ ip in. -te pseudo: iptables -P INPUT DROP iptables -P OUTPUT ACCEPT iptables -F INPUT iptables -F OUTPUT iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT # your IPs below iptables -A INPUT -i eth0 -s x.y.z.s/32 -j ACCEPT -- Troy Engel | Systems Engineer Fluid, Inc | http://www.fluid.com
- Previous message: [CentOS] OT - Linux NAS for Windows Environment
- Next message: [CentOS] Easy way to reject all incoming packets except from certain IPs?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list