Discussion:
[Dnsmasq-discuss] Problem using dnsmasq as dhcp
Archimede Pitagorico
2017-01-02 04:50:42 UTC
Permalink
_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-***@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Kurt H Maier
2017-01-03 19:15:12 UTC
Permalink
On Mon, Jan 02, 2017 at 05:50:42AM +0100, Archimede Pitagorico wrote:
> I am trying to migrate from dhcpd to dnsmasq for my home network, without
> much luck.

Make sure you don't have any iptables rules in place that would
interfere with dnsmasq. ISC's dhcp server uses a lower-level network
model than dnsmasq, and can work despite iptables rules to the contrary.
Check for rules that are dropping packets with sources or destinations
like 0.0.0.0 or 255.255.255.255.


khm
Archimede Pitagorico
2017-01-04 17:38:30 UTC
Permalink
_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-***@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Kurt H Maier
2017-01-04 17:50:05 UTC
Permalink
On Wed, Jan 04, 2017 at 06:38:30PM +0100, Archimede Pitagorico wrote:
> I have another question however about this:
> > ISC's dhcp server uses a lower-level network model than dnsmasq, and can
> work despite iptables rules to the contrary.
> How can an app bypass the kernel firewall? Can you please suggest a
> reference for me to understand better?

Depending on how it's packaged, it can use something like libpcap to
access networking information, similar to how tcpdump works. Some
distributors also ship their dhcpd packages with install-time scripts
that molest your firewall rules to ensure it works.

khm
/dev/rob0
2017-01-04 21:44:46 UTC
Permalink
On Wed, Jan 04, 2017 at 06:38:30PM +0100, Archimede Pitagorico wrote:
> <html><head></head><body><div style="font-family:
...

Um, please don't post HTML to mailing lists. Many of the more
helpful people you might encounter are using console-based MUAs, and
they won't get to see your fancy fonts and formatting. Also, top-
posting is awkward to read. Please trim your quotes and keep them
with the relevant reply text ("inline quoting".)

> <div>it was a&nbsp;rule in the PREROUTING chain of the raw
> table:</div>
>
> <div>rpfilter --invert -j DROP&nbsp;</div>
>
> <div>that caused messages incoming from clients to be dropped.

And here's another problem: be careful with filtering in the raw
table. Filtering should be done in the filter table (which, go
figure, may be why they named it "filter".)

> <div>&nbsp;</div>
>
> <div>It is easy to modify the rule to allow dhcp traffic
> through, so problem solved.</div>
>
> <div>&nbsp;</div>
>
> <div>I have another question however about this:</div>
>
> <div>&gt;&nbsp;ISC&#39;s dhcp server uses a lower-level
> network&nbsp;model than dnsmasq, and can work despite
> iptables rules to the contrary.</div>
>
> <div>How can an app bypass the kernel firewall? Can you please
> suggest a reference for me to understand better?&nbsp;</div>

Well, that's overstating it a bit.

ISC dhcpd uses raw sockets, and those are (like tcpdump) seen before
the netfilter subsystem.

But note, a complete DHCP exchange is "DORA": Discover by the client;
Offer by the server; Request by the client; and Ack by the server.
With dhcpd only DO are not blockable. RA certainly are.
--
http://rob0.nodns4.us/
Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
Archimede Pitagorico
2017-01-07 16:57:06 UTC
Permalink
Thanks for your comments.

> Um, please don't post HTML to mailing lists.
It is the evil web-mail I use, which use HTML by default, no fancy formatting.


> And here's another problem: be careful with filtering in the raw
> table. Filtering should be done in the filter table (which, go
> figure, may be why they named it "filter".)

I was just following some online examples of firewalls, for instance
the one on the arch wiki:
https://wiki.archlinux.org/index.php/Simple_stateful_firewall
which states:
This can be done with netfilter instead if statistics (and better logging) are desired:
# iptables -t raw -I PREROUTING -m rpfilter --invert -j DROP

Anyway, rpfilter can only be used in the raw table, I think.

By the way, filtering in iptables seems not exactly identical to rp_filter in sysctl.
The one in iptables blocks messages from 0.0.0.0 to 255.255.255.255. Sysctl doesn't.
Continue reading on narkive:
Search results for '[Dnsmasq-discuss] Problem using dnsmasq as dhcp' (Questions and Answers)
3
replies
Can I link two wifi devices without a router?
started 2016-01-09 00:15:47 UTC
computer networking
Loading...