* DHCP works but iptables should have dropped
@ 2007-10-12 21:32 pockiman
2007-10-14 21:22 ` Petr Pisar
0 siblings, 1 reply; 4+ messages in thread
From: pockiman @ 2007-10-12 21:32 UTC (permalink / raw)
To: netfilter
Hello,
i have a debian (etch) server/firewall with dhcp-server and iptables with eth3 connectet to a switch, and a Laptop without Batterypack and without any Harddisk, USB-Stick or whatever can store Information, also connected to that switch, no other computer is connect to that switch.
-I've set the default policy of both ipv4 and ipv6 for all chains to DROP (debian server)
-there is no rule specified
-the dhcp-server is configured (by MAC) to delivery the ip xx.xx.xx.34 to the Laptop
-the Laptop has a DVD-drive with a Knoppix-Distribution configured to use DHCP
if i boot the Laptop, there are 4 Packet registered to be dropped by the INPUT-default-policy, but the Laptop gets the ip-address.
In the syslog of the server, there are entries from the dhcp-deamon for the request and the answers., but the OUTPUT - chain - Packet-Counter is already at 0.
How are the packets (i thought it would be UDP) transmitted.
Thanks in advance,
pockiman
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: DHCP works but iptables should have dropped
2007-10-12 21:32 DHCP works but iptables should have dropped pockiman
@ 2007-10-14 21:22 ` Petr Pisar
2007-10-15 12:03 ` Gáspár Lajos
0 siblings, 1 reply; 4+ messages in thread
From: Petr Pisar @ 2007-10-14 21:22 UTC (permalink / raw)
To: netfilter
On 2007-10-12, pockiman@freenet.de <pockiman@freenet.de> wrote:
>
> i have a debian (etch) server/firewall with dhcp-server and iptables
[...]
> -I've set the default policy of both ipv4 and ipv6 for all chains to
> DROP (debian server)
[...]
> if i boot the Laptop, there are 4 Packet registered to be dropped by
> the INPUT-default-policy, but the Laptop gets the ip-address.
> In the syslog of the server, there are entries from the dhcp-deamon
> for the request and the answers., but the OUTPUT - chain
> - Packet-Counter is already at 0.
>
> How are the packets (i thought it would be UDP) transmitted.
>
Use "netstat -lnp |grep dhcp". You can see that dhcpd has open 2 sockets.
One is UDP socket for reply packet transmission, the second one is raw
socket for request recieving.
The raw socket has one important attribute: it recieves packets before
netfilter. The same mechanism is used by tcpdump/libcap.
Therefore dhcpd can recieve packet even if they are blocked by
netfilter. This is feature, not a bug. I have not idea why ISC' DHCP
sever is implemented in this manner, but it is. (May be because of indirect
broadcast destination IP address in DISCOVERY client request.)
-- Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: DHCP works but iptables should have dropped
2007-10-14 21:22 ` Petr Pisar
@ 2007-10-15 12:03 ` Gáspár Lajos
2007-10-15 15:39 ` Petr Pisar
0 siblings, 1 reply; 4+ messages in thread
From: Gáspár Lajos @ 2007-10-15 12:03 UTC (permalink / raw)
To: Petr Pisar; +Cc: netfilter
[...]
> Use "netstat -lnp |grep dhcp". You can see that dhcpd has open 2 sockets.
> One is UDP socket for reply packet transmission, the second one is raw
> socket for request recieving.
>
> The raw socket has one important attribute: it recieves packets before
> netfilter. The same mechanism is used by tcpdump/libcap.
>
>
Are you saying that We CAN NOT "protect" the DHCP-server with iptables?
> Therefore dhcpd can recieve packet even if they are blocked by
> netfilter. This is feature, not a bug. I have not idea why ISC' DHCP
> sever is implemented in this manner, but it is. (May be because of indirect
> broadcast destination IP address in DISCOVERY client request.)
>
> -- Petr
>
Swifty
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: DHCP works but iptables should have dropped
2007-10-15 12:03 ` Gáspár Lajos
@ 2007-10-15 15:39 ` Petr Pisar
0 siblings, 0 replies; 4+ messages in thread
From: Petr Pisar @ 2007-10-15 15:39 UTC (permalink / raw)
To: netfilter
On 2007-10-15, Gáspár Lajos <swifty@freemail.hu> wrote:
>> The raw socket has one important attribute: it recieves packets before
>> netfilter. The same mechanism is used by tcpdump/libcap.
>>
> Are you saying that We CAN NOT "protect" the DHCP-server with iptables?
>
The way how you say it is bad but it's true.
OTOH, how do you want to protect server before malicous packets which
have source address 0.0.0.0? It makes no sense. Just omit the interface
name in argument list of dhcpd and be happy ;)
-- Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-15 15:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-12 21:32 DHCP works but iptables should have dropped pockiman
2007-10-14 21:22 ` Petr Pisar
2007-10-15 12:03 ` Gáspár Lajos
2007-10-15 15:39 ` Petr Pisar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox