-
-
Notifications
You must be signed in to change notification settings - Fork 217
Add OpenWrt router guide #1232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Add OpenWrt router guide #1232
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cf6e9f7
add openwrt router guide
ihatetoregister 0732399
update mkdocs
ihatetoregister 13dab04
fix issues
ihatetoregister 36c25ca
fix issues
ihatetoregister 80319cb
fix issues
ihatetoregister 391e1eb
fix issues
ihatetoregister File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,76 @@ | ||||
# OpenWrt | ||||
|
||||
Here's a short guide to configure Pi-hole as the DNS server for your OpenWrt router. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
This guide was written for OpenWrt version 24.10 but the principle should hold for any earlier or later release although Web UI might look different. | ||||
|
||||
## Requirements | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this whole section is not needed. It should be clear that a guide for OpenWrt & Pi-hole requires an OpenWrt router and Pi-hole.... |
||||
|
||||
* OpenWrt router (already installed and accessible) | ||||
* Pi-hole installed on a device in your network (e.g. Raspberry Pi or LXC container) | ||||
* Access to OpenWrt LuCI Web Interface or SSH terminal | ||||
|
||||
## Configuration | ||||
|
||||
Ensure Pi-hole has a fixed IP. For example: `192.168.1.2`. | ||||
|
||||
### Option 1: Tell DHCP clients to use Pi-hole (Recommended) | ||||
|
||||
#### Web UI: Network > Interfaces > LAN | ||||
|
||||
For the selected interface, eg *lan*, click *Edit*. Then under *DHCP Server* > *Advanced settings* set *DHCP-Options*: | ||||
|
||||
`6,192.168.1.2` | ||||
|
||||
*Meaning: 6 = DNS server, followed by IP.* | ||||
|
||||
 | ||||
|
||||
#### Terminal: | ||||
|
||||
```shell | ||||
$ uci add_list dhcp.lan.dhcp_option='6,192.168.1.2' | ||||
<no output> | ||||
$ uci commit dhcp | ||||
<no output> | ||||
$ /etc/init.d/dnsmasq restart | ||||
<no output> | ||||
``` | ||||
|
||||
### Option 2: Forward requests to Pi-hole | ||||
|
||||
*Note: This makes all requests look like they come from the router in Pi-hole.* | ||||
|
||||
#### Web UI: Network > DHCP and DNS > Forwards | ||||
|
||||
Add your Pi-hole IP under DNS forwards | ||||
|
||||
 | ||||
|
||||
#### Terminal: | ||||
|
||||
```shell | ||||
$ uci add_list dhcp.@dnsmasq[0].server='192.168.1.2' | ||||
<no output> | ||||
$ uci commit dhcp | ||||
<no output> | ||||
$ /etc/init.d/dnsmasq restart | ||||
<no output> | ||||
``` | ||||
|
||||
### Restart Network Clients | ||||
|
||||
Reboot your devices or release/renew their DHCP leases so they pick up the new DNS server. | ||||
|
||||
## Verification | ||||
|
||||
On a client, run: | ||||
|
||||
```shell | ||||
$ nslookup example.com | ||||
Server: 192.168.1.2 | ||||
Address: 192.168.1.2#53 | ||||
``` | ||||
|
||||
Ensure the server address is your Pi-hole IP. | ||||
|
||||
Visit the Pi-hole dashboard and check query log for activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this image can be cropped. The relevant section is only in the upper quarter of it.