1 |
Le Dimanche 28 Mai 2006 16:53, Dave S a écrit : |
2 |
> Yep, same here. I was trying to lock down my router. By default it allows |
3 |
> any outgoing packets and only allows incoming packets if they are related |
4 |
> to the incoming packets. |
5 |
> |
6 |
> I was trying to lock down my outgoing packets so services such as Samba |
7 |
> would not broadcast anything to the WAN. |
8 |
> |
9 |
> As such I defaulted outgoing to BLOCK and allowed only certain ports. |
10 |
> |
11 |
> However I then needed to allow ports between computers ie for Samba again. |
12 |
> |
13 |
> When I opened the port on the LAN between computers my router wanted at |
14 |
> least one IP address for the WAN. I did not want to give it a real address |
15 |
> so choose 0.0.0.0 |
16 |
> |
17 |
> I was really asking ... |
18 |
> |
19 |
> (a) Is it worthwhile setting up my router this way, or am I being paranoid |
20 |
> :) |
21 |
|
22 |
I do not think it wise to setup your router that way. Here's a little of |
23 |
theory. I apologize if you're familiar with it, but it is necessary for |
24 |
latter development. |
25 |
|
26 |
When in a LAN, a packet will not reach the WAN unless you specify you want it |
27 |
to, that includes broadcasts. |
28 |
|
29 |
An element of an IP address is a number between 0 and 254. 255 is used only |
30 |
for broadcasting. |
31 |
|
32 |
Moreover, rsync and samba, and most daemons take as a paramater the address or |
33 |
address range they can accept connections from. An incoming connection from |
34 |
the WAN, could not connect to the daemon even if it wanted to. |
35 |
|
36 |
|
37 |
> (b) Is 0.0.0.0 and invalid IP address (I though it might be) because that |
38 |
> is what i was looking for to trick my router to send nothing to the WAN |
39 |
|
40 |
An IP address is meaningful only in conjunction with a mask. 0.0.0.0 with mask |
41 |
255.255.255.255 means broadcast to every single IP address that exists. Since |
42 |
the mask indicates between which boundaries the IP number can vary (in this |
43 |
case every IP address item can vary between 0 and 254). |
44 |
|
45 |
As a conclusion, this is definitely not what you want to do ! ;-) |
46 |
|
47 |
So, taking as a hypothesis that you trust everyone on your LAN, here's what |
48 |
you should do : |
49 |
- Et the policy for incomiong connections to BLOCK. |
50 |
- Unblock the services you actually need the net to access. Plus, in the |
51 |
config file of the daemon, specify it should listen to 0.0.0.0 |
52 |
- Allow traffic from your LAN to the WAN (again, if you trust everyone). And |
53 |
set up each daemon to only listen to 192.168.0.1/24 (which means only |
54 |
addresses that begin with 192.168.0). |
55 |
- Set up daemons to broadcast on 192.168.0.255 |
56 |
|
57 |
I hope this was clear, I have hardly slept last night ! |
58 |
|
59 |
-- Jonathan |
60 |
|
61 |
PS : No need to apologize for the delay, I know even gentooists have lives ;) |
62 |
|
63 |
-- |
64 |
gentoo-user@g.o mailing list |