The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

iptables, NAT & Packet Filtering by DMDx862002-06-14 06:47:51
  In general... by talon0720 2002-06-14 07:31:24
With ipchains, I set my default policy to deny, then set the ports I wanted open to accept. With ipchains its something like.... /sbin/ipchains -A input -i [interface] -s [source ip address of packet] -p [protocol] --sport [source port] --dport [destination port] -j [ACCEPT/DENY/REJECT]

-A, -i, and -j are the required ones, the others are optional, but very handy for blocking or opening specific ports or ipaddresses.

I prefer DENY to REJECT, since REJECT sends a polite packet back to them saying that they aren't allowed, where DENY just igores them and it looks like a timeout on their end, as if you aren't there.
/sbin/ipchains -A output -p icmp --icmp-type pong -i eth0 -j DENY -l
this blocks pongs from going back out onto the net, so if somebody is trying to ping your box to find a target for an attack, they don't see that you're there. Stealth mode on. Anyway, don't forget to log the packets you drop in your default deny, so you can look at /var/log/messages to see if you are dropping packets you need to accept and add another accept to your rules. I think that iptables is basically the same as ipchains, but gives you more options for filtering and forwarding. Hope that helps you find somewhere to start.
[ Reply ]

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)