Re: [Dnsmasq-discuss] debugging dhcpv6 requests forwarded via relay agent

2019-01-10 Thread Geert Stappers
On Thu, Jan 10, 2019 at 05:48:26PM +0530, Sandeep K M wrote:
> On Wed, Jan 9, 2019 at 10:33 PM Simon Kelley wrote:
> > On 04/01/2019 06:25, Sandeep K M wrote:
> > >
> > > Attached are the packet captures:
> > >
> > > 1. Packets exchanged between client and relay (client-relay.pcap)
> > > 2.  Packets exchanged between relay and server (relay-server.pcap)
> > > 3. strace of dnsmasq (dnsmasq.trace)
> > >
   ...
> >
> > I'm sure this was tested with a relay, but the current test harnesses
> > here would take some work to get into a position to test this code, so
> > I'm going to try and use you as a tester, if that's OK?
> >
> >
> > Looking at the strace output, dnsmasq logs that it's sending a
> > DHCPADVERTISE reply, but it never calls sendto() to actually send the
> > packet. This is definitely a dnsmasq bug, and not something in your
> > network that's causing the packet to get lost: it never gets sent.
> >
> >
> > What's confusing me is that manually tracing the code paths from what's
> > known to be working (log the DHCPADVERTISE) to the sendto() call that
> > should send that packet, I can't see any reason why the code should fail.
> >
> > Are you in a position to run dnsmasq under gdb and step through the
> > relevant code? I can give you detailed instructions on where to set
> > breakpoints and where the reply packet could be getting lost. The path
> > is maybe 50 lines.
> >
> > Staring at the code has found me one bug, but it's not relevant in this
> > case. (The code to avoid copying an RFC6939 link address option in a
> > relay request to the reply to the relay actually sends a zero-length
> > option, instead of eliding it entirely.)
> >
> 
> I will be happy to be your tester :)
> 
> Its fairly a simple setup with two hosts and a switch. I can create this
> any time you want.
> 
> Please provide me the instructions. I am using dnsmasq version 2.78.


Keeping the ML in loop would be good.
At least for the sake of the mailinglist archive.


Regards
Geert Stappers


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Debugging dnsmasq on Ubuntu

2017-03-30 Thread Joel Whitehouse



I had tried dbus-monitor but message sniffing was disabled on my system 
and it gave me no useful information.


I also considered tcpdump/wireshark to watch for outbound traffic on 
port 53 but I also wanted to know when queries were being resolved from 
cache, not just when they were resolved through external dns servers.


Syslog was exactly what I needed.

Thanks Pali!

-Joel

On 03/29/2017 10:11 AM, Pali Rohár wrote:

On Wednesday 29 March 2017 09:43:33 Joel Whitehouse wrote:

Both the file /var/run/NetworkManager/dnsmasq.conf and the directory
/etc/NetworkManager/dnsmasq.d/ are empty, so it's likely that dnsmasq is
receiving its resovlers from Network Manager over the dbus interface.


Right.


Is there any way to get dnsmasq to log when it issues a new query to a
resolver?


I have all information in syslog.

dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21
dhclient: DHCPREQUEST of X.X.X.X on wlan0 to 255.255.255.255 port 67
dhclient: DHCPOFFER of X.X.X.X from X.X.X.X
dhclient: DHCPACK of X.X.X.X from X.X.X.X
dhclient: bound to X.X.X.X -- renewal in X seconds.
NetworkManager[1977]:  (wlan0): DHCPv4 state changed preinit -> bound
NetworkManager[1977]:address X.X.X.X
NetworkManager[1977]:prefix X (X.X.X.X)
NetworkManager[1977]:gateway X.X.X.X
NetworkManager[1977]:nameserver 'X.X.X.X'
NetworkManager[1977]:domain name 'X'
NetworkManager[1977]:  Activation (wlan0) Stage 5 of 5 (IPv4 Configure 
Commit) scheduled...
NetworkManager[1977]:  Activation (wlan0) Stage 5 of 5 (IPv4 Commit) 
started...
NetworkManager[1977]:  (wlan0): writing resolv.conf to /sbin/resolvconf
dnsmasq[4160]: setting upstream servers from DBus
dnsmasq[4160]: using nameserver X.X.X.X#53

So when NetworkManager via dbus reconfigure list of nameservers then
dnsmasq logs them into syslog.




___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Debugging dnsmasq on Ubuntu

2017-03-29 Thread Risto Suominen
Hi Joel,

2017-03-29 17:43 UTC+03.00, Joel Whitehouse :
>
> Is there any way to get dnsmasq to log when it issues a new query to a 
> resolver?
>
You can run tcpdump on upstream interface and port 53.

Risto

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Debugging dnsmasq on Ubuntu

2017-03-29 Thread Chris Green
On Wed, Mar 29, 2017 at 09:43:33AM -0500, Joel Whitehouse wrote:
> I'm running ubuntu 14, which uses dnsmasq as a local resolver on 127.0.1.1.
> When I issue a dig query, dig informs me it's using 127.0.1.1 as its
> resolver:
> 
> ;; Query time: 3 msec
> ;; SERVER: 127.0.1.1#53(127.0.1.1)
> ;; WHEN: Wed Mar 29 09:36:06 CDT 2017
> ;; MSG SIZE  rcvd: 63
> 
> 
> However, I would like to know what host dnsmasq is using as its resolver.
> On my system, `ps ax' shows that dnsmasq is started with the command:
> 
> /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts
> --bind-interfaces
> --pid-file=/run/sendsigs.omit.d/network-manager.dnsmasq.pid
> --listen-address=127.0.1.1 --conf-file=/var/run/NetworkManager/dnsmasq.conf
> --cache-size=0 --proxy-dnssec
> --enable-dbus=org.freedesktop.NetworkManager.dnsmasq
> –conf-dir=/etc/NetworkManager/dnsmasq.d
> 
> 
> Both the file /var/run/NetworkManager/dnsmasq.conf and the directory
> /etc/NetworkManager/dnsmasq.d/ are empty, so it's likely that dnsmasq is
> receiving its resovlers from Network Manager over the dbus interface.
> 
> 
> Is there any way to get dnsmasq to log when it issues a new query to a
> resolver?
> 
This is basically the same question that I asked a few weeks ago, the
answer was to look in syslog for dnsmasq messages.  You should be able
to find messages like:-

syslog.1:Mar 28 09:08:53 t430 dnsmasq[1501]: setting upstream servers from 
DBus
syslog.1:Mar 28 09:08:53 t430 dnsmasq[1501]: using nameserver 
192.168.1.2#53(via wlan0)
 
(On my LAN there's a Raspberry Pi at 192.168.1.2 running dnsmasq for
local name resolution)

What I see on the Raspberry Pi at startup is:-

Mar 29 16:48:35 pi dnsmasq[2086]: using local addresses only for domain 
zbmc.eu
Mar 29 16:48:35 pi dnsmasq[2086]: reading /etc/resolv.conf
Mar 29 16:48:35 pi dnsmasq[2086]: using nameserver 208.67.220.220#53
Mar 29 16:48:35 pi dnsmasq[2086]: using nameserver 216.146.36.36#53
Mar 29 16:48:35 pi dnsmasq[2086]: using nameserver 212.159.13.49#53

However I think in your case you should be looking for the 'setting
upstream servers' message.

-- 
Chris Green

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Debugging dnsmasq on Ubuntu

2017-03-29 Thread Pali Rohár
On Wednesday 29 March 2017 09:43:33 Joel Whitehouse wrote:
> Both the file /var/run/NetworkManager/dnsmasq.conf and the directory
> /etc/NetworkManager/dnsmasq.d/ are empty, so it's likely that dnsmasq is
> receiving its resovlers from Network Manager over the dbus interface.

Right.

> Is there any way to get dnsmasq to log when it issues a new query to a
> resolver?

I have all information in syslog.

dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21
dhclient: DHCPREQUEST of X.X.X.X on wlan0 to 255.255.255.255 port 67
dhclient: DHCPOFFER of X.X.X.X from X.X.X.X
dhclient: DHCPACK of X.X.X.X from X.X.X.X
dhclient: bound to X.X.X.X -- renewal in X seconds.
NetworkManager[1977]:  (wlan0): DHCPv4 state changed preinit -> bound
NetworkManager[1977]:address X.X.X.X
NetworkManager[1977]:prefix X (X.X.X.X)
NetworkManager[1977]:gateway X.X.X.X
NetworkManager[1977]:nameserver 'X.X.X.X'
NetworkManager[1977]:domain name 'X'
NetworkManager[1977]:  Activation (wlan0) Stage 5 of 5 (IPv4 Configure 
Commit) scheduled...
NetworkManager[1977]:  Activation (wlan0) Stage 5 of 5 (IPv4 Commit) 
started...
NetworkManager[1977]:  (wlan0): writing resolv.conf to /sbin/resolvconf
dnsmasq[4160]: setting upstream servers from DBus
dnsmasq[4160]: using nameserver X.X.X.X#53

So when NetworkManager via dbus reconfigure list of nameservers then
dnsmasq logs them into syslog.

-- 
Pali Rohár
pali.ro...@gmail.com

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Debugging dnsmasq on Ubuntu

2017-03-29 Thread Albert ARIBAUD
Hi Joel,

Le Wed, 29 Mar 2017 09:43:33 -0500
Joel Whitehouse  a écrit:

> I'm running ubuntu 14, which uses dnsmasq as a local resolver on 
> 127.0.1.1.  When I issue a dig query, dig informs me it's using 
> 127.0.1.1 as its resolver:
> 
> ;; Query time: 3 msec
> ;; SERVER: 127.0.1.1#53(127.0.1.1)
> ;; WHEN: Wed Mar 29 09:36:06 CDT 2017
> ;; MSG SIZE  rcvd: 63
> 
> 
> However, I would like to know what host dnsmasq is using as its 
> resolver.  On my system, `ps ax' shows that dnsmasq is started with
> the command:
> 
> /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts 
> --bind-interfaces 
> --pid-file=/run/sendsigs.omit.d/network-manager.dnsmasq.pid 
> --listen-address=127.0.1.1 
> --conf-file=/var/run/NetworkManager/dnsmasq.conf --cache-size=0 
> --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq 
> –conf-dir=/etc/NetworkManager/dnsmasq.d
> 
> 
> Both the file /var/run/NetworkManager/dnsmasq.conf and the directory 
> /etc/NetworkManager/dnsmasq.d/ are empty, so it's likely that dnsmasq
> is receiving its resovlers from Network Manager over the dbus
> interface.
> 
> 
> Is there any way to get dnsmasq to log when it issues a new query to
> a resolver?

You can spy on DBus -- I think that's what Network Manager uses to
configure dnsmasq on the fly.

> -Joel

Amicalement,
-- 
Albert.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Debugging dnsmasq on Ubuntu

2017-03-29 Thread Beniamino Galvani
On Wed, Mar 29, 2017 at 09:43:33AM -0500, Joel Whitehouse wrote:
> I'm running ubuntu 14, which uses dnsmasq as a local resolver on 127.0.1.1.
> When I issue a dig query, dig informs me it's using 127.0.1.1 as its
> resolver:
> 
> ;; Query time: 3 msec
> ;; SERVER: 127.0.1.1#53(127.0.1.1)
> ;; WHEN: Wed Mar 29 09:36:06 CDT 2017
> ;; MSG SIZE  rcvd: 63
> 
> 
> However, I would like to know what host dnsmasq is using as its resolver.
> On my system, `ps ax' shows that dnsmasq is started with the command:
> 
> /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts
> --bind-interfaces
> --pid-file=/run/sendsigs.omit.d/network-manager.dnsmasq.pid
> --listen-address=127.0.1.1 --conf-file=/var/run/NetworkManager/dnsmasq.conf
> --cache-size=0 --proxy-dnssec
> --enable-dbus=org.freedesktop.NetworkManager.dnsmasq
> –conf-dir=/etc/NetworkManager/dnsmasq.d
> 
> 
> Both the file /var/run/NetworkManager/dnsmasq.conf and the directory
> /etc/NetworkManager/dnsmasq.d/ are empty, so it's likely that dnsmasq is
> receiving its resovlers from Network Manager over the dbus interface.

Correct. You should find in system logs the list of name servers pushed
by NM to dnsmasq through D-Bus:

 dnsmasq[6620]: setting upstream servers from DBus
 dnsmasq[6620]: using nameserver 192.168.10.1#53(via ens3)

With NM > 1.6 name servers in use are also printed in the 'nmcli'
output.

> Is there any way to get dnsmasq to log when it issues a new query to a
> resolver?

Try:

 echo log-queries > /etc/NetworkManager/dnsmasq.d/log-queries

and restart NetworkManager.

Beniamino


signature.asc
Description: PGP signature
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Debugging dnsmasq on Ubuntu

2017-03-29 Thread Joel Whitehouse
I'm running ubuntu 14, which uses dnsmasq as a local resolver on 
127.0.1.1.  When I issue a dig query, dig informs me it's using 
127.0.1.1 as its resolver:


;; Query time: 3 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Wed Mar 29 09:36:06 CDT 2017
;; MSG SIZE  rcvd: 63


However, I would like to know what host dnsmasq is using as its 
resolver.  On my system, `ps ax' shows that dnsmasq is started with the 
command:


/usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts 
--bind-interfaces 
--pid-file=/run/sendsigs.omit.d/network-manager.dnsmasq.pid 
--listen-address=127.0.1.1 
--conf-file=/var/run/NetworkManager/dnsmasq.conf --cache-size=0 
--proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq 
–conf-dir=/etc/NetworkManager/dnsmasq.d



Both the file /var/run/NetworkManager/dnsmasq.conf and the directory 
/etc/NetworkManager/dnsmasq.d/ are empty, so it's likely that dnsmasq is 
receiving its resovlers from Network Manager over the dbus interface.



Is there any way to get dnsmasq to log when it issues a new query to a 
resolver?


-Joel

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Debugging

2014-02-11 Thread Brian Rak
Is there any way to get additonal debugging information out of dnsmasq?  
I'm running into an issue where I'm seeing 'DHCPDISCOVER(eth0) X Y no 
address available', but it's not particularly clear to me why this is 
happening.  Is there a way to log the contents of the DISCOVER packet?  
I know I can use tcpdump, but that doesn't show me what dnsmasq actually 
thinks is in the packet.


In my case, I should be seeing a subscriber-id in the packets.  I see it 
in tcpdump, but I'm not clear if dnsmasq is actually parsing it.


___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Debugging

2014-02-11 Thread Simon Kelley

On 11/02/14 15:12, Brian Rak wrote:

Is there any way to get additonal debugging information out of dnsmasq?
  I'm running into an issue where I'm seeing 'DHCPDISCOVER(eth0) X Y no
address available', but it's not particularly clear to me why this is
happening. Is there a way to log the contents of the DISCOVER packet? I
know I can use tcpdump, but that doesn't show me what dnsmasq actually
thinks is in the packet.

In my case, I should be seeing a subscriber-id in the packets. I see it
in tcpdump, but I'm not clear if dnsmasq is actually parsing it.




log-dhcp


will help.


Cheers,

Simon.



_

Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss




___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Debugging

2014-02-11 Thread Brian Rak

Sorry, should have mentioned that I already have that enabled.

That gives me some extra info:

Feb 11 11:14:07 x dnsmasq-dhcp[2278]: 3227716451 DHCPDISCOVER(eth0) 
00:25:90:d6:ac:25 no address available
Feb 11 11:14:08 x dnsmasq-dhcp[2278]: 467005255 available DHCP range: 
10.x.10 -- 10.x.250
Feb 11 11:14:08 x dnsmasq-dhcp[2278]: 467005255 available DHCP range: 
10.y.10 -- 10.y.250
Feb 11 11:14:08 x dnsmasq-dhcp[2278]: 467005255 available DHCP range: 
10.z.10 -- 10.z.250

Feb 11 11:14:08 x dnsmasq-dhcp[2278]: 467005255 vendor class: udhcp 1.12.0

but doesn't appear to log the subscriber ID.  I can't tell if its 
supposed to be logged in that case either.


On 2/11/2014 10:50 AM, Simon Kelley wrote:

On 11/02/14 15:12, Brian Rak wrote:

Is there any way to get additonal debugging information out of dnsmasq?
  I'm running into an issue where I'm seeing 'DHCPDISCOVER(eth0) X Y no
address available', but it's not particularly clear to me why this is
happening. Is there a way to log the contents of the DISCOVER packet? I
know I can use tcpdump, but that doesn't show me what dnsmasq actually
thinks is in the packet.

In my case, I should be seeing a subscriber-id in the packets. I see it
in tcpdump, but I'm not clear if dnsmasq is actually parsing it.




log-dhcp


will help.


Cheers,

Simon.



_

Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss




___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss



___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss