good call, moved advantages under section headers

Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
Adam Hill
2019-02-09 14:24:14 -06:00
parent 064364bfa6
commit 3b7dfd52d4
+6 -6
View File
@@ -18,31 +18,31 @@ Here are details on setting up DHCP for Docker Pi-hole for various network modes
### Docker Pi-hole with host networking mode
**Advantages**: Simple, easy, and fast setup
Possibly the simplest way to get DHCP working with Docker Pi-hole is to use [host networking](https://docs.docker.com/network/host/) which makes the container be on your LAN Network like a regular Raspberry Pi-hole would be, allowing it to broadcast DHCP. It will have the same IP as your Docker host server in this mode so you may still have to deal with port conflicts.
- Inside your docker-compose.yml remove all ports and replace them with: `network_mode: host`
- `docker run --net=host` if you don't use docker-compose
**Advantages**: Simple, easy, and fast setup
### Docker Pi-hole with a Macvlan network
**Advantages**: Works well with NAS devices or hard port conflicts
A [Macvlan network](https://docs.docker.com/network/macvlan/) is the most advanced option since it requires more network knowledge and setup. This mode is similar to host network mode but instead of borrowing the IP of your docker host computer it grabs a new IP address off your LAN network.
Having the container get its own IP not only solves the broadcast problem but avoids port conflicts you might have on devices such as NAS devices with web interfaces. Tony Lawrence detailed macvlan setup for Pi-hole first in the second part of his great blog series about [Running Pi-hole on Synology Docker](http://tonylawrence.com/posts/unix/synology/running-pihole-inside-docker/), check it out here: [Free your Synology ports with Macvlan](http://tonylawrence.com/posts/unix/synology/free-your-synology-ports/)
**Advantages**: Works well with NAS devices or hard port conflicts
### Docker Pi-hole with a bridge networking
**Advantages**: Works well with container web reverse proxies like Nginx or Traefik
If you want to use docker's bridged network mode then you need to run a DHCP relay. A relay points to your containers forwarded port 67 and spreads the broadcast signal from isolated docker bridge onto your LAN network. Relays are very simple software, you just have to configure it to point to your Docker host's IP port 67.
Although uncommon, if your router is an advanced enough router it may support a DHCP relay. Try googling for your router manufacturer + DHCP relay or looking in your router's configuration around the DHCP settings or advanced areas.
If your router doesn't support it, you can run a software / container based DHCP relay on your LAN instead. The author of DNSMasq made a very tiny simple one called [DHCP-helper](http://thekelleys.org.uk/dhcp-helper/READ-ME). [DerFetzer](https://discourse.pi-hole.net/t/dhcp-with-docker-compose-and-bridge-networking/17038) kindly shared his great setup of a DHCP-helper container on the Pi-hole Discourse forums.
**Advantages**: Works well with container web reverse proxies like Nginx or Traefik
### Warning about the Default bridge network
The out of the box [default bridge network has some limitations](https://docs.docker.com/network/bridge/#differences-between-user-defined-bridges-and-the-default-bridge) that a user created bridge network won't have. These limitations make it painful to use especially when connecting multiple containers together.