sloko
December 14, 2023, 3:08pm
1
Hi,
I need to have OpenWRT push a specific name server to DHCP clients on the wireless interface whose nameservers can only be set using DHCP.
Currently it pushes 192.168.1.1 which is itself.
How, for example, can I get it to push only 1.1.1.1, and no IPv6 name servers?
TIA.
S
egc
December 14, 2023, 3:25pm
3
Use option 6:
/etc/config/dhcp
list dhcp_option '6,1.1.1.1'
Just add it in the Interface section you want it to use for, you can use tagging to set it for individual clients e.g.:
config tag 'tag1'
list dhcp_option '6,1.1.1.1'
config host
option name 'client1'
option mac '00:21:63:75:aa:17'
option ip '10.11.12.14'
option tag 'tag1'
config host
option name 'client2'
option mac '01:22:64:76:bb:18'
option ip '10.11.12.15'
option tag 'tag1'
2 Likes
sloko
December 14, 2023, 4:02pm
4
Can I add it for a specifically assigned address?
e.g like this:
config host
option name 'osmio4kplus'
option dns '1'
option mac '2C:CC:CC:CC:CC:CC'
option ip '192.168.1.191'
option list dhcp_option '6,1.1.1.1'
And will this ensure that no IPv6 DNS name server gets assigned? Unless of course something like 2606:4700:4700::1111 will work.
Although would not this command add DNS IPv4 for everything:
uci add_list dhcp.lan.dhcp_option="6,1.1.1.1"
Or could I use this to add multiple name servers?
uci add_list dhcp.lan.dhcp_option="6,1.1.1.1,2606:4700:4700::1111,8.8.8.8"
frollic
December 14, 2023, 4:05pm
5
Didn't look at the examples, did you?
It'll assign what you tell it to assign.
Clients honoring them, is a completely different topic though.
1 Like
sloko
December 14, 2023, 4:18pm
6
Didn't look at the examples, did you?
Yes, but reading does not mean I understood it. All I see is that I can break my DHCP by not decyphering the examples correctly.
e.g Why do I need to add vlan tagging to this?
Use the tag
classifier to create a tagged group
Although, I think I just do:
uci add_list dhcp.lan.dhcp_option="6,1.1.1.1,2606:4700:4700::1111" && uci commit dhcp && service dnsmasq restart
sloko
December 14, 2023, 4:28pm
7
egc:
option tag 'tag1'
I put this in the file:
config tag 'dns1111'
list dhcp_option '6,1.1.1.1,2606:4700:4700::1111'
....
config host
option name 'osmio4kplus'
option dns '1'
option mac 'xx:xx:xx:xx:xx:xx'
option ip '192.168.1.191'
option tag 'dns1111'
Does this correct?
egc
December 14, 2023, 4:58pm
8
sloko:
Can I add it for a specifically assigned address?
e.g like this:
config host
option name 'osmio4kplus'
option dns '1'
option mac '2C:CC:CC:CC:CC:CC'
option ip '192.168.1.191'
option list dhcp_option '6,1.1.1.1'
And will this ensure that no IPv6 DNS name server gets assigned? Unless of course something like 2606:4700:4700::1111 will work.
Although would not this command add DNS IPv4 for everything:
uci add_list dhcp.lan.dhcp_option="6,1.1.1.1"
Or could I use this to add multiple name servers?
uci add_list dhcp.lan.dhcp_option="6,1.1.1.1,2606:4700:4700::1111,8.8.8.8"
I think you have to use the tagging as described and it has nothing to do with vlans.
you can use multiple DNS servers, I use:
config tag 'tag1'
list dhcp_option '6,8.8.8.8,8.8.4.4'
But you cannot mix IPv6, the syntax for IPv6 is different.
For DNSMasq it should be something like:
dhcp-option=option6:dns-server, [2606:4700:4700::1111]
But I do not know how to translate this in uci
1 Like
sloko
December 14, 2023, 5:01pm
9
Thanks.
therefore I can have a separate line in /etc/config/dhcp for one of my posts with a line for specifying IPv6, and another line specifying IPv4.
sloko
December 14, 2023, 5:15pm
10
"But you need a device with large flash to run dnsmasq-full, as far as I understand this is the main reason we don’t have the full dnsmasq package included as default."
Hi,
I've been trying to configure openwrt dnsmasq to hand out dhcpv6 options to my clients.
For my specific interface I'm trying to set:
option dhcp_option 'option6:42,[2a00:8a60:0:20::123]'
or
option dhcp_option 'option6:ntp-server,[2a00:8a60:0:20::123]'
For reference:
https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
The dnsmasq crashes though. Is it possible that openwrt does not implement this option6?
Junicast
What makes no sense is that openwrt is pushing some Ipv6 to my devices which is already nameserver fd82:61c8:2ad1::1 .
egc
December 14, 2023, 5:19pm
11
Odhpcd is the OpenWrt-specific IPv6 addressing server for the Lan side. To my knowledge, it handles both DHCPv6 and slaac.
So I think you cannot do this with DNSMasq.
You can turn off the handout of IPv6 DNS address and you might not need it as DNS servers handout both IPv4 and IPv6 addresses if queried by IPv4.
See: https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#disabling_ipv6_dns_for_odhcpd
1 Like
sloko
December 14, 2023, 5:34pm
12
Done
Luci -> Network -> Interfaces -> lan / Edit -> Advanced Settings -> DHCP-Options : 6,1.1.1.1
and
Luci -> Network -> Interfaces -> lan / Edit -> IPv6 Settings -> Announced IPv6 DNS servers : 2606:4700:4700::1111
Thank-you everybody for your help, ideas, and patience.
system
Closed
December 24, 2023, 5:34pm
13
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.