Gentoo Archives: gentoo-user

From: Marco <listworks@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Is this firewall safe?
Date: Fri, 24 Apr 2009 17:53:15
Message-Id: 93d30e950904241053x55b9f169x887296edc4a74830@mail.gmail.com
In Reply to: Re: [gentoo-user] Is this firewall safe? by Eric Martin
1 On Fri, Apr 24, 2009 at 4:59 PM, Eric Martin <freak4uxxx@×××××.com> wrote:
2 > Marco wrote:
3 >> Hi all,
4 >>
5 >> I set up my first firewall on my notebook (not running any services
6 >> reachable from outside) using iptables. Since I am new to the topic,
7 >> could you please verify if the output of 'iptables -L -v' is
8 >> considered to be a safe firewall? Thanks!
9 >>
10 >> Chain INPUT (policy DROP 0 packets, 0 bytes)
11 >>  pkts bytes target     prot opt in     out     source
12 >> destination
13 >>     0     0 ACCEPT     all  --  lo     any     anywhere
14 >> anywhere
15 >>     0     0 ACCEPT     all  --  eth0   any     anywhere
16 >> anywhere            state RELATED,ESTABLISHED
17 >>     0     0 REJECT     tcp  --  eth0   any     anywhere
18 >> anywhere            reject-with tcp-reset
19 >>     0     0 REJECT     udp  --  eth0   any     anywhere
20 >> anywhere            reject-with icmp-port-unreachable
21 >>     0     0 DROP       udp  --  eth0   any     anywhere
22 >> anywhere            udp spt:bootps
23 >>     0     0 LOG        all  --  eth0   any     anywhere
24 >> anywhere            LOG level warning prefix `INPUT   '
25 >>     1    79 ACCEPT     all  --  wlan0  any     anywhere
26 >> anywhere            state RELATED,ESTABLISHED
27 >>     0     0 REJECT     tcp  --  wlan0  any     anywhere
28 >> anywhere            reject-with tcp-reset
29 >>     0     0 REJECT     udp  --  wlan0  any     anywhere
30 >> anywhere            reject-with icmp-port-unreachable
31 >>     0     0 DROP       udp  --  wlan0  any     anywhere
32 >> anywhere            udp spt:bootps
33 >>     0     0 LOG        all  --  wlan0  any     anywhere
34 >> anywhere            LOG level warning prefix `INPUT   '
35 >>
36 >> Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
37 >>  pkts bytes target     prot opt in     out     source
38 >> destination
39 >>     0     0 LOG        all  --  any    any     anywhere
40 >> anywhere            LOG level warning prefix `FORWARD '
41 >>     0     0 LOG        all  --  any    any     anywhere
42 >> anywhere            LOG level warning prefix `FORWARD '
43 >>
44 >> Chain OUTPUT (policy ACCEPT 5 packets, 1691 bytes)
45 >>  pkts bytes target     prot opt in     out     source
46 >> destination
47 >>     0     0 ACCEPT     all  --  any    lo      anywhere
48 >> anywhere
49 >>     0     0 LOG        all  --  any    eth0    anywhere
50 >> anywhere            LOG level warning prefix `OUTPUT  '
51 >>     1    52 LOG        all  --  any    wlan0   anywhere
52 >> anywhere            LOG level warning prefix `OUTPUT  '
53 >>
54 >>
55 > It all depends on what you're trying to do.  My internet facing boxes
56 > have a default OUTPUT policy of DROP and I only allow certain traffic
57 > off of the box (helps protect me from unauthorized services).  Also,
58 > you're dropping bootps (same ports as dhcp) on udp so I don't think you
59 > can get a dhcp address like that.  If you're running any services you
60 > won't be able to talk to them (ssh).  Turn off forwarding in the kernel
61 > config (via /etc/sysctl.conf) as well.
62
63 I am dropping bootps to not have my log file flooding due to the DHCP
64 server in my wireless router (as suggested in
65 www.novell.com/coolsolutions/feature/18139.html). As it seems I still
66 get a dynamic ip from it.
67
68 So far, I am not running any services that have to be exposed to the outside.
69
70 > It also took me a few runs to figure out the firewall config (due to the
71 > rules and formatting).  The last two output rules can be combined into
72 > one.  Have 1 log line at the bottom of your tables and that will take
73 > care of that.  Clean and short configs will help immensely when things
74 > don't work.
75
76 Sorry for the bad format. gmail decided to insert some sub ideal pagebreaks...
77
78 Talking about the 1 log line at the bottom you mean I should configure
79 it to not specify an interface (eth0, wlan0)?
80
81 Thanks!

Replies

Subject Author
Re: [gentoo-user] Is this firewall safe? Eric Martin <freak4uxxx@×××××.com>