Monday, November 01, 2021

Re: Dhcp client configuration in 7.0

Hi Benno,


It looks like it is working right now, even after a restart of the router the extra dns server is not added to
resolv.conf with resolvd enabled and started. The first nameserver 213.75.116.129 entry was added when i enabled
resolvd again, and did not have the "ignore dns" options in place. Then i did the steps you asked for.

* run "route -n monitor"
* empty the dhcpleased.conf: mv /etc/dhcpleased.conf /etc/X.dhcpleased.conf
* cat /etc/resolv.conf, copy the output into an email.

nameserver 213.75.116.129 # resolvd: vlan4
lookup file bind
nameserver 127.0.0.1

* restart dhcpleased: doas /etc/rc.d/dhcpleased restart
* copy the output of "route -n monitor" into the email
fw# route -n monitor
got message of size 176 on Mon Nov  1 09:15:38 2021
RTM_DELETE: Delete Route: len 176, priority 8, table 0, if# 1, name em0, pid: 0, seq 0, errno 0
flags:<UP,HOST,DONE,MULTICAST>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 239.255.255.250 192.168.2.1 00:24:81:82:19:6d 192.168.2.1
got message of size 176 on Mon Nov  1 09:16:05 2021
RTM_ADD: Add Route: len 176, priority 8, table 0, if# 1, name em0, pid: 0, seq 0, errno 0
flags:<UP,HOST,DONE,MULTICAST>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 239.255.255.250 192.168.2.1 00:24:81:82:19:6d 192.168.2.1
got message of size 232 on Mon Nov  1 09:16:31 2021
RTM_PROPOSAL: config proposal: len 232, source dhcp, table 0, if# 9, name vlan4, pid: 49678, seq 1, errno 0
flags:<UP,DONE>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
proposals: <DNS>
 INET []
got message of size 192 on Mon Nov  1 09:16:31 2021
RTM_DELETE: Delete Route: len 192, priority 3, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<UP,HOST,DONE,LLINFO,CLONED,CACHED>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 10.200.240.1 link#9 00:24:81:82:19:6e 10.200.240.46
got message of size 192 on Mon Nov  1 09:16:31 2021
RTM_DELETE: Delete Route: len 192, priority 4, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<DONE,CLONING,CONNECTED>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA>
 10.200.240.0 10.200.240.46 255.255.252.0 00:24:81:82:19:6e 10.200.240.46
got message of size 176 on Mon Nov  1 09:16:31 2021
RTM_DELETE: Delete Route: len 176, priority 1, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<HOST,DONE,BROADCAST>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 10.200.243.255 10.200.240.46 00:24:81:82:19:6e 10.200.240.46
got message of size 192 on Mon Nov  1 09:16:31 2021
RTM_DELETE: Delete Route: len 192, priority 1, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<HOST,DONE,LOCAL>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 10.200.240.46 00:24:81:82:19:6e 00:24:81:82:19:6e 10.200.240.46
got message of size 96 on Mon Nov  1 09:16:31 2021
RTM_DELADDR: address being removed from iface: len 96, if# 9, name vlan4, metric 0, flags:
sockaddrs: <NETMASK,IFP,IFA,BRD>
 255.255.252.0 00:24:81:82:19:6e 10.200.240.46 10.200.243.255
got message of size 232 on Mon Nov  1 09:16:31 2021
RTM_DELETE: Delete Route: len 232, priority 8, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<UP,GATEWAY,DONE,STATIC>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA,LABEL>
 213.75.112.0 10.200.240.1 255.255.248.0 00:24:81:82:19:6e 10.200.240.46 "dhcpleased"
got message of size 176 on Mon Nov  1 09:16:31 2021
RTM_DELETE: Delete Route: len 176, priority 8, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<UP,HOST,DONE,MULTICAST,MPATH>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 224.3.2.6 10.200.240.46 00:24:81:82:19:6e 10.200.240.46


* cat /etc/resolv.conf, copy the output into the email.

lookup file bind
nameserver 127.0.0.1


then run dhcpleased with the configuration file:

* run "route -n monitor"
* mv /etc/X.dhcpleased.conf /etc/dhcpleased.conf
* cat /etc/dhcpleased.conf and copy the output into the email

interface vlan4 {
send vendor class id "IPTV_RG"
ignore dns
}

* cat /etc/resolv.conf, copy the output into the email.


lookup file bind
nameserver 127.0.0.1

* restart dhcpleased: doas /etc/rc.d/dhcpleased restart
* copy the output of "route -n monitor" into the email

got message of size 176 on Mon Nov  1 09:19:40 2021
RTM_DELETE: Delete Route: len 176, priority 8, table 0, if# 1, name em0, pid: 0, seq 0, errno 0
flags:<UP,HOST,DONE,MULTICAST>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 224.3.2.6 192.168.2.1 00:24:81:82:19:6d 192.168.2.1
got message of size 176 on Mon Nov  1 09:20:05 2021
RTM_ADD: Add Route: len 176, priority 8, table 0, if# 1, name em0, pid: 0, seq 0, errno 0
flags:<UP,HOST,DONE,MULTICAST>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 239.255.255.250 192.168.2.1 00:24:81:82:19:6d 192.168.2.1
got message of size 232 on Mon Nov  1 09:20:49 2021
RTM_PROPOSAL: config proposal: len 232, source dhcp, table 0, if# 9, name vlan4, pid: 83653, seq 1, errno 0
flags:<UP,DONE>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
proposals: <DNS>
 INET []
got message of size 96 on Mon Nov  1 09:20:51 2021
RTM_NEWADDR: address being added to iface: len 96, if# 9, name vlan4, metric 0, flags:
sockaddrs: <NETMASK,IFP,IFA,BRD>
 255.255.252.0 00:24:81:82:19:6e 10.200.240.46 0.0.0.0
got message of size 192 on Mon Nov  1 09:20:51 2021
RTM_ADD: Add Route: len 192, priority 1, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<UP,HOST,DONE,LLINFO,LOCAL>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 10.200.240.46 00:24:81:82:19:6e 00:24:81:82:19:6e 10.200.240.46
got message of size 192 on Mon Nov  1 09:20:51 2021
RTM_ADD: Add Route: len 192, priority 4, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<UP,DONE,CLONING,CONNECTED>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA>
 10.200.240.0 10.200.240.46 255.255.252.0 00:24:81:82:19:6e 10.200.240.46
got message of size 176 on Mon Nov  1 09:20:51 2021
RTM_ADD: Add Route: len 176, priority 1, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<UP,HOST,DONE,BROADCAST>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 10.200.243.255 10.200.240.46 00:24:81:82:19:6e 10.200.240.46
got message of size 192 on Mon Nov  1 09:20:51 2021
RTM_ADD: Add Route: len 192, priority 3, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<UP,HOST,DONE,LLINFO,CLONED>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 10.200.240.1 link#9 00:24:81:82:19:6e 10.200.240.46
got message of size 232 on Mon Nov  1 09:20:51 2021
RTM_ADD: Add Route: len 232, priority 8, table 0, if# 9, name vlan4, pid: 83653, seq 2, errno 0
flags:<UP,GATEWAY,DONE,STATIC>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA,LABEL>
 213.75.112.0 10.200.240.1 255.255.248.0 00:24:81:82:19:6e 10.200.240.46 "dhcpleased"
got message of size 232 on Mon Nov  1 09:20:51 2021
RTM_PROPOSAL: config proposal: len 232, source dhcp, table 0, if# 9, name vlan4, pid: 83653, seq 3, errno 0
flags:<UP,DONE>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
proposals: <DNS>
 INET []
got message of size 176 on Mon Nov  1 09:20:51 2021
RTM_ADD: Add Route: len 176, priority 8, table 0, if# 9, name vlan4, pid: 0, seq 0, errno 0
flags:<UP,HOST,DONE,MULTICAST>
fmask:
use:        0   mtu:        0    expire:        0
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 224.3.2.6 10.200.240.46 00:24:81:82:19:6e 10.200.240.46

* cat /etc/resolv.conf, copy the output into the email.

lookup file bind
nameserver 127.0.0.1


On Zaterdag, Oktober 30, 2021 23:46 CEST, Sebastian Benoit <benoit-lists@fb12.de> wrote:
 Arnoud Otten(arnoud@beekberg.nl) on 2021.10.30 22:18:09 +0200:
> Hi,
>
> Maybe i am wrong and do not understand this right, but wat should the ???ignore dns??? option do when used in the dhcpleased .conf config file?
> Here @xs4all our IPTV network on a separate vlan also gets an ip address and the dhcp offer also sends a dns server which should be ignored.
> I also thought that with the ???ignore dns??? option, this dns server was blocked, but that is not what the option does?
>
> Regards,
>
> Arnoud

The "ignore dns" config option causes dhcpleased to send a RTM_PROPOSAL
message to resolvd with an empty DNS proposal for that interface. This
causes resolvd to remove any nameserver entry for that interface from
/etc/resolv.conf.

Note that resolvd adds comments to the lines it touches in resolv.conf, for
example:
nameserver 192.168.1.1 # resolvd: iwm0

Anyone who thinks the "ignore dns" option does not work could help to debug
this with the following:

* run "route -n monitor"
* empty the dhcpleased.conf: mv /etc/dhcpleased.conf /etc/X.dhcpleased.conf
* cat /etc/resolv.conf, copy the output into an email.
* restart dhcpleased: doas /etc/rc.d/dhcpleased restart
* copy the output of "route -n monitor" into the email
* cat /etc/resolv.conf, copy the output into the email.

then run dhcpleased with the configuration file:

* run "route -n monitor"
* mv /etc/X.dhcpleased.conf /etc/dhcpleased.conf
* cat /etc/dhcpleased.conf and copy the output into the email
* cat /etc/resolv.conf, copy the output into the email.
* restart dhcpleased: doas /etc/rc.d/dhcpleased restart
* copy the output of "route -n monitor" into the email
* cat /etc/resolv.conf, copy the output into the email.

send that email as a reply to this thread.

Thanks,
Benno

> > On 30 Oct 2021, at 21:00, Sebastian Benoit <benoit-lists@fb12.de> wrote:
> >
> > ???Z?? Loff(zeloff@zeloff.org) on 2021.10.29 18:30:29 +0100:
> >>> On Fri, Oct 29, 2021 at 03:37:56PM +0300, Samarul Meu wrote:
> >>> Hello to you all!
> >>>
> >>> Prior to 7.0 I was using this line in /etc/dhclient.conf
> >>> supersede domain-name-servers 127.0.0.1;
> >>> so that I do not get the DNS from the ISP provider.
> >>>
> >>> I am using unbound to resolve my queries. With the new changes I can not
> >>> get the same functionality.
> >>>
> >>> I tried to add this in /etc/dhcpleased.conf
> >>> interface urtwn0 ignore dns
> >>> where urtwn0 is my interface or disable resolvd.
> >>>
> >>> If resolvd is on I get my ISP DNS server, if not when unbound starts
> >>> resolvd adds the ISP DNS server to resolv.conf.
> >>>
> >>> Can you please tell me what am I doing wrong and how can I have only
> >>> 127.0.0.1 on the resolv.conf file?
> >>>
> >>> Thank you!
> >>
> >> This works for me:
> >>
> >>
> >> /etc/hostname.em0:
> >>
> >> inet autoconf
> >>
> >>
> >> /etc/resolv.conf:
> >>
> >> nameserver 127.0.0.1
> >>
> >>
> >> /etc/dhcpleased.conf:
> >>
> >> interface em0 {
> >> ignore dns
> >> }
> >
> >
> > If you never intend to use other nameservers on this system, you can also
> > deactivate resolvd:
> >
> > rcctl stop resolvd
> > rcctl disable resolvd
> >
> > and remove dhcpleased.conf again.
> >
> >
>

--
 


 

No comments:

Post a Comment