1 |
Marco wrote: |
2 |
> Hi all, |
3 |
> |
4 |
> I set up my first firewall on my notebook (not running any services |
5 |
> reachable from outside) using iptables. Since I am new to the topic, |
6 |
> could you please verify if the output of 'iptables -L -v' is |
7 |
> considered to be a safe firewall? Thanks! |
8 |
> |
9 |
> Chain INPUT (policy DROP 0 packets, 0 bytes) |
10 |
> pkts bytes target prot opt in out source |
11 |
> destination |
12 |
> 0 0 ACCEPT all -- lo any anywhere |
13 |
> anywhere |
14 |
> 0 0 ACCEPT all -- eth0 any anywhere |
15 |
> anywhere state RELATED,ESTABLISHED |
16 |
> 0 0 REJECT tcp -- eth0 any anywhere |
17 |
> anywhere reject-with tcp-reset |
18 |
> 0 0 REJECT udp -- eth0 any anywhere |
19 |
> anywhere reject-with icmp-port-unreachable |
20 |
> 0 0 DROP udp -- eth0 any anywhere |
21 |
> anywhere udp spt:bootps |
22 |
> 0 0 LOG all -- eth0 any anywhere |
23 |
> anywhere LOG level warning prefix `INPUT ' |
24 |
> 1 79 ACCEPT all -- wlan0 any anywhere |
25 |
> anywhere state RELATED,ESTABLISHED |
26 |
> 0 0 REJECT tcp -- wlan0 any anywhere |
27 |
> anywhere reject-with tcp-reset |
28 |
> 0 0 REJECT udp -- wlan0 any anywhere |
29 |
> anywhere reject-with icmp-port-unreachable |
30 |
> 0 0 DROP udp -- wlan0 any anywhere |
31 |
> anywhere udp spt:bootps |
32 |
> 0 0 LOG all -- wlan0 any anywhere |
33 |
> anywhere LOG level warning prefix `INPUT ' |
34 |
> |
35 |
> Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) |
36 |
> pkts bytes target prot opt in out source |
37 |
> destination |
38 |
> 0 0 LOG all -- any any anywhere |
39 |
> anywhere LOG level warning prefix `FORWARD ' |
40 |
> 0 0 LOG all -- any any anywhere |
41 |
> anywhere LOG level warning prefix `FORWARD ' |
42 |
> |
43 |
> Chain OUTPUT (policy ACCEPT 5 packets, 1691 bytes) |
44 |
> pkts bytes target prot opt in out source |
45 |
> destination |
46 |
> 0 0 ACCEPT all -- any lo anywhere |
47 |
> anywhere |
48 |
> 0 0 LOG all -- any eth0 anywhere |
49 |
> anywhere LOG level warning prefix `OUTPUT ' |
50 |
> 1 52 LOG all -- any wlan0 anywhere |
51 |
> anywhere LOG level warning prefix `OUTPUT ' |
52 |
> |
53 |
> |
54 |
It all depends on what you're trying to do. My internet facing boxes |
55 |
have a default OUTPUT policy of DROP and I only allow certain traffic |
56 |
off of the box (helps protect me from unauthorized services). Also, |
57 |
you're dropping bootps (same ports as dhcp) on udp so I don't think you |
58 |
can get a dhcp address like that. If you're running any services you |
59 |
won't be able to talk to them (ssh). Turn off forwarding in the kernel |
60 |
config (via /etc/sysctl.conf) as well. |
61 |
|
62 |
It also took me a few runs to figure out the firewall config (due to the |
63 |
rules and formatting). The last two output rules can be combined into |
64 |
one. Have 1 log line at the bottom of your tables and that will take |
65 |
care of that. Clean and short configs will help immensely when things |
66 |
don't work. |