[SOLVED] how does the dhcp offer get through this iptables configuration?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
how does the dhcp offer get through this iptables configuration?
eth0 is configured through a dhcp server connected directly to it. http://en.wikipedia.org/wiki/Dhcp#DHCP_offer is very clear: the answer of the server is a UDP to 255.255.255.255. Please tell me how can it pass through this iptables configuration, because it does.
Code:
iptables -nvL INPUT
(policy DROP)
3281 201K ACCEPT all -- eth1 * 192.168.69.0/24 0.0.0.0/0
0 0 ACCEPT all -- lo * 127.0.0.1 0.0.0.0/0
0 0 ACCEPT all -- lo * 192.168.69.1 0.0.0.0/0
0 0 ACCEPT all -- lo * 93.114.xx.xx 0.0.0.0/0
1253 93310 ACCEPT all -- * * 0.0.0.0/0 93.114.xx.xx state RELATED,ESTABLISHED
108 5388 tcp_packets tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0
2724 258K udp_packets udp -- eth0 * 0.0.0.0/0 0.0.0.0/0
1 56 icmp_packets icmp -- eth0 * 0.0.0.0/0 0.0.0.0/0
56 1568 DROP all -- eth0 * 0.0.0.0/0 224.0.0.0/8
iptables -nvL udp_packets
0 0 DROP udp -- eth0 * 0.0.0.0/0 93.114.xx.xx udp dpts:135:139
18 5923 DROP udp -- eth0 * 0.0.0.0/0 255.255.255.255 udp dpts:67:68
Maybe iptables is started after eth0 is configured, in spite of my pre-up iptables-restore [...] in eth0 configuration?
Last edited by doru; 06-05-2011 at 12:29 PM.
Reason: afterthought
Because the firewall is designed to block / direct unsolicited packets from outside. You said yourself that the DHCP server is sending an answer, so your system must have requested that answer, and so the firewall does not block it.
Because the firewall is designed to block / direct unsolicited packets from outside. You said yourself that the DHCP server is sending an answer, so your system must have requested that answer, and so the firewall does not block it.
If you refer to this line:
Code:
1253 93310 ACCEPT all -- * * 0.0.0.0/0 93.114.xx.xx state RELATED,ESTABLISHED
then you should explain why is a package accepted even though it has a destination of 255.255.255.255, when the required destination is 93.114.xx.xx.
1253 93310 ACCEPT all -- * * 0.0.0.0/0 93.114.xx.xx state RELATED,ESTABLISHED
then you should explain why is a package accepted even though it has a destination of 255.255.255.255, when the required destination is 93.114.xx.xx.
Yeah that was confusing me a little, however the starting point for the request is that there is no address on the interface, and in those circumstances I'm not clear how the rules are supposed to be interpreted anyway.
well I mean how extensive is your testing? I don't know what address i'd expect if it didn't have an IP to request already etc. I'm only testing this against my noddy cable router, not isc dhcpd etc...
well I mean how extensive is your testing? I don't know what address i'd expect if it didn't have an IP to request already etc. I'm only testing this against my noddy cable router, not isc dhcpd etc...
I just ran "tcpdump -vn -i wlan0"
Thank you for your answer. It is clear that dhcp does not follow Wikipedia's description. I did not try many combinations, I have the same address allocated every time through dhcp, and I am connected to a relatively large LAN which is flooding my tcpdump. This is what I got:
Code:
tcpdump -vvn | grep -i dhcp
21:16:47.401380 IP6 (hlim 1, next-header UDP (17) payload length: 99) fe80::c4a4:c1a2:596c:20d7.546 > ff02::1:2.547: dhcp6 solicit (xid=728da8 (elapsed time 6300) (client ID hwaddr/time type 1 time 357520540 6cf04957e2d8)[|dhcp6ext])
21:16:49.003227 IP (tos 0x10, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328) 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:a1:b0:f0:xx:xx, length 300, xid 0x37453e6a, Flags [none] (0x0000)
21:16:49.004430 IP (tos 0x10, ttl 16, id 0, offset 0, flags [none], proto UDP (17), length 328) 93.114.xx.1.67 > 93.114.xx.xx.68: BOOTP/DHCP, Reply, length 300, xid 0x37453e6a, Flags [none] (0x0000)
# The other terminal:
dhclient3 eth0
There should have been four packets, two out and two in, but we both see only two (I am not sure that the first one is mine; plus, tcpdump only catches what it can.) So this should clarify it all: "And the chaos, who created the chaos? The programmers did." Thanks again.
Flicking around briefly I think you're interpreting things incorrectly. As the exchanges we're both seeing are renewals not initial requests, therefore it is a different scenario. The full handshake not appropriate as it already has the information it wants, and just needs to confirm it. So once the server confirms the requested details it doesn't need to hear back again as it's been asked to confirm, not asked for new information.
Flicking around briefly I think you're interpreting things incorrectly. As the exchanges we're both seeing are renewals not initial requests, therefore it is a different scenario. The full handshake not appropriate as it already has the information it wants, and just needs to confirm it. So once the server confirms the requested details it doesn't need to hear back again as it's been asked to confirm, not asked for new information.
Right, it can be a completely different standard for renewal.
I did this:
Code:
ifdown eth0
ifconfig eth0 up
#now the other terminal
tcpdump -vvn | grep -i dhcp
#now back to the first terminal
dhclient3 eth0
#and I got this:
tcpdump -vvn | grep -i dhcp
tcpdump: WARNING: eth0: no IPv4 address assigned
21:46:58.003515 IP (tos 0x10, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328) 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:a1:b0:f0:xx:xx, length 300, xid 0x71534c7f, Flags [none] (0x0000)
21:46:58.004386 IP (tos 0x10, ttl 16, id 0, offset 0, flags [none], proto UDP (17), length 328) 93.114.xx.1.67 > 93.114.xx.xx.68: BOOTP/DHCP, Reply, length 300, xid 0x71534c7f, Flags [none] (0x0000)
It is pretty clear that it does not follow the standard. It could not pass through iptables if it did.
Or maybe they use a different standard, for the case of one single dhcp server in the lan.
Thanks for this.
Last edited by doru; 06-06-2011 at 08:27 AM.
Reason: afterthought
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.