Author Topic: Your iptables ruleset  (Read 4624 times)

0 Members and 1 Guest are viewing this topic.

Offline 0poitr

  • Peasant
  • *
  • Posts: 149
  • Cookies: 64
    • View Profile
Your iptables ruleset
« on: February 21, 2013, 10:15:03 pm »
What sort of topology do you have in your home network and how do you manage it with iptables? Specially if you're using it to build a firewall or a NAT box. Different people have different setups and I'm curious about decisions behind the rules. There are quite an array of extensions to be used with iptables, some being extremely usefull (e.g. conntrack, limit, recent etc) but only a handful have been used in example rule sets I've found on the interwebz.

So,  I'd request you guys to post your rule sets whether you manage a small and simple network setup or a complex one (and don't fear posting the rules to be a security hazard ;)
Also, the strategy you thought of while designing the rule-set would be helpful.

Here's mine (sitting behind NAT)::
Only the INPUT chain from filter
Code: [Select]
# iptables -t filter -L INPUT --line-numbers
Chain INPUT (policy DROP)
num  target     prot opt source               destination         
1    ACCEPT     all  --  anywhere             anywhere           
2    DROP       all  --  anywhere             anywhere             ctstate INVALID
3    ACCEPT     tcp  --  anywhere             anywhere             tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
4    ACCEPT     tcp  --  anywhere             anywhere             tcp flags:FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
5    ACCEPT     icmp --  anywhere             anywhere             icmp echo-request limit: avg 1/sec burst 5
6    ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
7    UDP        udp  --  anywhere             anywhere             ctstate NEW
8    TCP        tcp  --  anywhere             anywhere             tcp flags:FIN,SYN,RST,ACK/SYN ctstate NEW
9    REJECT     all  --  anywhere             anywhere             reject-with icmp-proto-unreachable
10   REJECT     tcp  --  anywhere             anywhere             recent: SET name: TCP-PORTSCAN side: source mask: 255.255.255.255 reject-with tcp-reset
11   REJECT     udp  --  anywhere             anywhere             recent: SET name: UDP-PORTSCAN side: source mask: 255.255.255.255 reject-with icmp-port-unreachable
« Last Edit: February 21, 2013, 10:15:56 pm by 0poitr »
Imagination is the first step towards Creation.

Offline 0poitr

  • Peasant
  • *
  • Posts: 149
  • Cookies: 64
    • View Profile
Re: Your iptables ruleset
« Reply #1 on: February 25, 2013, 08:53:46 pm »
Alright. So nobody uses iptables ! :|
Nobody cares about a damn firewall on their linux boxes!
I just wanted people to post their rule sets. And I think I know there are masters. Not a single reply. :/

Guess, I'll make a tut anyway.
« Last Edit: February 25, 2013, 08:54:52 pm by 0poitr »
Imagination is the first step towards Creation.

Offline Stackprotector

  • Administrator
  • Titan
  • *
  • Posts: 2515
  • Cookies: 205
    • View Profile
Re: Your iptables ruleset
« Reply #2 on: February 25, 2013, 09:13:23 pm »
Don't assume :)
~Factionwars