Differences between revisions 8 and 9
Revision 8 as of 2015-01-16 17:51:07
Size: 2751
Comment: Move to design related discussion to Design/*
Revision 9 as of 2015-02-13 04:39:44
Size: 2785
Comment: Include FreedomBox portal in footer
Deletions are marked like this. Additions are marked like this.
Line 43: Line 43:
<<Include(FreedomBox/Portal)>>

This page is for working on how to configure DNSMasq as part of a FreedomBox Router

The main documentation for DNSMasq is all within its man page, which is also available on the project's website. Locally, all configuration is done through either /etc/dnsmasq.conf or, /etc/default/dnsmasq. Preferably all config options should be done in /etc/dnsmasq.conf directly.

The version shipped in the ?DreamPlug debian image is in a near default state. All configuration options in /etc/dnsmasq.conf are commented out and the only option set in /etc/default/dnemasq is:

  • # Whether or not to run the dnsmasq daemon; set to 0 to disable.

    ENABLED=1

    DNSMASQ_OPTS="--cache-size=200 --interface=uap0 --listen-address=192.168.1.1"

The first step is to move these options to the /etc/dnsmasq.conf file. Simply search for the long form option names from the above code inside /etc/dnsmasq.conf, uncomment them, and enter their values from above. So your new /etc/dnsmasq.conf should have the following uncommented lines now:

cache-size=200

interface=uap0

listen-address=192.168.1.1

That allows you to comment out all the options in /etc/default/dnsmasq without changing any of the behavior of your plug.

For some reason, the default debian image shipped on the ?DreamPlug does not use dnsmasq for dhcp. I am not actually clear what it used for dhcp since /root/init_setup.sh calls udhcpd but udhcpd is disabled in /etc/default/udhcpd. Regardless, we want to use dnsmasq for dhcp so we need to add the following line to /etc/dnsmasq.conf:

dhcp-range=192.168.1.50,192.168.1.150,1h

That tells dnsmasq to act as a dhcp server and to give out ip addresses between 192.168.0.50 and 192.168.0.150, all with 1 hour leases. If you save that config, run an apt-get remove --purge udhcpd and comment out the /etc/init.d/udhcpd start line in /root/init_setup.sh you should be good to go with dnsmasq as a basic dns and dhcp server. Now you can either restart your box or simply /etc/init.d/dnsmasq restart to restart dnsmasq.

I also added two options to, as the config file says, make my plug a better "netizen":

domain-needed

and

bogus-priv

If you are having trouble getting a network connection to work with this setup, it is most likely because the default iptables rules don't have NAT configured for the wireless AP and only have it set up for one of the two ethernet ports. See ?Firewall page for details on how to manage masquerading.


Intro

Information

Support

Contribute

Reports

Promote

Vision

Hardware

Live Help

Where To Start

Translate

Calls

Talks

Overview

Download

Q&A

To Do

Design

Releases

Press

Features

Manual

Contributors

Code

Blog

FreedomBox for Communities

FreedomBox Developer Manual

HELP & DISCUSSIONS: Discussion Forum - Matrix - Mailing List - #freedombox irc.debian.org | CONTACT Foundation | JOIN Project

Next call: Saturday, April 13 at 14:00 UTC

This page is copyright its contributors and is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.


CategoryFreedomBox