Re: [Dnsmasq-discuss] Doing something wrong with dhcp-option=option:router

2012-08-27 Thread Bernard Higonnet

Hello,

I did try tcpdump but was not able to get the easy-to-read output you 
showed.


However, turning on --log-dhcp provided that information in the dnsmasq 
log file.


Turns out that dnsmasq is doing what I asked it to do. It would appear 
that I ignored this in the manual: SIGHUP does NOT re-read the 
configuration file.  which makes a difference...


Thanks!
Bernard Higonnet

On 26/08/2012 21:48, Ryan Chapman wrote:

Hi Bernard,


2) can someone indicate simple way to see what either FreeBSD or Windows 
machines receive?

You can use tcpdump on the machine running dnsmasq to see what the DHCP 
response looks like

tcpdump -s 0 -vv -ni interface port bootpc or port bootps


As an example, I just tested:

dnsmasq is running on 10.16.1.5 (netmask 255.255.255.0), handing out addresses 
in the range 10.16.1.190 to 10.16.1.200, the router is at 10.16.1.1.  --port 0 
is given to turn off dns

[root@pxe01 etc]# dnsmasq --port 0 --dhcp-range=10.16.1.190,10.16.1.200 
--dhcp-option=option:router,10.16.1.1
[root@pxe01 etc]# tcpdump -s 0 -vv -ni eth0 port bootpc or port bootps
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 
bytes
15:34:35.390104 IP (tos 0x0, ttl  20, id 0, offset 0, flags [none], proto: UDP 
(17), length: 576) 0.0.0.0.bootpc  255.255.255.255.bootps: [udp sum ok] 
BOOTP/DHCP, Request from 00:50:56:9c:75:ce, length: 548, xid:0x579c75ce, secs:4, 
flags: [Broadcast] (0x8000)
   Client Ethernet Address: 00:50:56:9c:75:ce
   Vendor-rfc1048:
 DHCP:DISCOVER
 
PR:SM+TZ+DG+IEN+NS+RL+HN+BS+DN+SS+RP+EP+VO+SID+VC+BF+T128+T129+T130+T131+T132+T133+T134+T135
 MSZ:1260
 GUID:0.66.28.81.31.120.27.85.238.229.243.224.197.110.93.30.108
 ARCH:0
 NDI:1.2.1
 VC:PXEClient:Arch:0:UNDI:002001
15:34:37.505455 IP (tos 0x0, ttl  20, id 1, offset 0, flags [none], proto: UDP 
(17), length: 576) 0.0.0.0.bootpc  255.255.255.255.bootps: [udp sum ok] 
BOOTP/DHCP, Request from 00:50:56:9c:75:ce, length: 548, xid:0x589c75ce, secs:6, 
flags: [Broadcast] (0x8000)
   Client Ethernet Address: 00:50:56:9c:75:ce
   Vendor-rfc1048:
 DHCP:DISCOVER
 
PR:SM+TZ+DG+IEN+NS+RL+HN+BS+DN+SS+RP+EP+VO+SID+VC+BF+T128+T129+T130+T131+T132+T133+T134+T135
 MSZ:1260
 GUID:0.66.28.81.31.120.27.85.238.229.243.224.197.110.93.30.108
 ARCH:0
 NDI:1.2.1
 VC:PXEClient:Arch:0:UNDI:002001
15:34:38.139657 IP (tos 0x0, ttl  64, id 1952, offset 0, flags [none], proto: UDP 
(17), length: 328) 10.16.1.5.bootps  255.255.255.255.bootpc: [bad udp cksum 
47eb!] BOOTP/DHCP, Reply, length: 300, xid:0x579c75ce, secs:4, flags: [Broadcast] 
(0x8000)
   Your IP: 10.16.1.193
   Server IP: 10.16.1.5
   Client Ethernet Address: 00:50:56:9c:75:ce
   Vendor-rfc1048:
 DHCP:OFFER
 SID:10.16.1.5
 LT:3600
 RN:1800
 RB:3150
 SM:255.255.255.0
 BR:10.16.1.255
 BR:10.16.1.255
 NS:10.16.1.5
 DG:10.16.1.1


The DG (default gateway) is what is of interest here.





On Aug 26, 2012, at 11:36 AM, Bernard Higonnet bthigon...@gmail.com wrote:


Hello,

I want a machine getting an IP through DHCP to have a specific gateway and not 
go through the machine running dnsmasq.

In my dnsmasq.conf I have

dhcp-option=option:router,192.168.4.1


running dnsmasq --test says syntax is OK.

but it would appear (sic) that this isn't working. Both a FreeBSD machine and a 
Windows7 machine are using the address of the machine running dnsmasq.

Questions:

1) is there some variant of --test which shows what will be sent in reply to a 
DHCP request?
2) can someone indicate simple way to see what either FreeBSD or Windows 
machines receive?

TIA
Bernard Higonnet

___
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] MX forwarding

2012-08-27 Thread Gene Czarcinski

On 08/25/2012 04:23 PM, Gene Czarcinski wrote:

On 08/25/2012 03:07 PM, Gene Czarcinski wrote:

On 08/24/2012 03:26 PM, Gene Czarcinski wrote:

On 08/23/2012 10:26 AM, Gene Czarcinski wrote:

For a query from test2 of host xxx, the response were:

query[A]: config xxx.tst is NXDOMAIN-IPv6
query[A]: config xxx is NODATA-IPv4
query[]: config xxx is NODATA-IPv6
query[MX]: forwarded xxx to 192.168.122.1 
In the interest in moving this along, I took a look at the code. 
Unfortunately, I not quite sure where an actual fix should be done. I 
did a little test and added two lines to extract_request() in 
rfc1035.c .. I duplicated the T_ANY test and changed ANY to MX.


The result was what I had hoped ... from the syslog:
  query[MX]: config xxx is NODATA-IPv4

However, as I said in a previous message, I believe that no 
plain-names should be forwarded is --domain-needed is specified ... 
regardless of what --local= is.




OK, here is a little patch which seems to make thing work the way I 
believe they should ... that does not make it right or the correct 
thing to do. 
More refining the patch.  This is essentially the same as the previous 
patch except that I fixed up the comments.


Essentially but not really the same.  The significant difference is the 
flags is not set to F_NXDOMAIN rather then F_NOERR.  As a result, 
the /usr/bin/host command is doing the right thing and gives a 
reasonable response to the user for a badhost query.


I believe that the patch changes the way dnsmasq response but I am not 
certain that this is the right thing to do ... even if it makes sense 
to me.


As usual, the patch is inline below as well as being attached.

Gene

---
diff -uNr dnsmasq-2.59.orig/src/forward.c dnsmasq-2.59/src/forward.c
--- dnsmasq-2.59.orig/src/forward.c2011-10-07 10:09:30.0 -0400
+++ dnsmasq-2.59/src/forward.c2012-08-27 14:11:06.581948635 -0400
@@ -207,10 +207,11 @@
   }
   }

-  if (flags == 0  !(qtype  F_QUERY) 
+  /* if domain-needed is specified, don't forward queries for
+simple names (not just A or ), except the empty name */
+  if (flags == 0 
   option_bool(OPT_NODOTS_LOCAL)  !strchr(qdomain, '.')  
namelen != 0)
-/* don't forward A or  queries for simple names, except the 
empty name */

-flags = F_NOERR;
+flags = F_NXDOMAIN;

   if (flags == F_NXDOMAIN  check_for_local_domain(qdomain, now))
 flags = F_NOERR;

diff -uNr libvirt-0.9.11.4.orig/src/network/bridge_driver.c libvirt-0.9.11.4/src/network/bridge_driver.c
--- libvirt-0.9.11.4.orig/src/network/bridge_driver.c	2012-06-15 14:23:21.0 -0400
+++ libvirt-0.9.11.4/src/network/bridge_driver.c	2012-08-22 12:16:45.263488789 -0400
@@ -490,8 +490,15 @@
  */
 virCommandAddArgList(cmd, --strict-order, --bind-interfaces, NULL);
 
-if (network-def-domain)
+if (network-def-domain) {
 virCommandAddArgList(cmd, --domain, network-def-domain, NULL);
+virCommandAddArgFormat(cmd, --local=/%s/, network-def-domain);
+virCommandAddArgList(cmd, --domain-needed, --filterwin2k, NULL);
+}
+else { /* need to specify local even if no domain specified */
+virCommandAddArg(cmd, --local=//);
+virCommandAddArgList(cmd, --domain-needed, --filterwin2k, NULL);
+}
 
 if (pidfile)
 virCommandAddArgPair(cmd, --pid-file, pidfile);
diff -uNr libvirt-0.9.11.4.orig/tests/networkxml2argvdata/isolated-network.argv libvirt-0.9.11.4/tests/networkxml2argvdata/isolated-network.argv
--- libvirt-0.9.11.4.orig/tests/networkxml2argvdata/isolated-network.argv	2012-06-15 14:21:54.0 -0400
+++ libvirt-0.9.11.4/tests/networkxml2argvdata/isolated-network.argv	2012-08-22 12:20:37.700995728 -0400
@@ -1,4 +1,5 @@
-@DNSMASQ@ --strict-order --bind-interfaces --conf-file= \
+@DNSMASQ@ --strict-order --bind-interfaces \
+--local=// --domain-needed --filterwin2k --conf-file= \
 --except-interface lo --dhcp-option=3 --no-resolv \
 --listen-address 192.168.152.1 \
 --dhcp-range 192.168.152.2,192.168.152.254 \
diff -uNr libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network.argv libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network.argv
--- libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network.argv	2012-06-15 14:21:54.0 -0400
+++ libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network.argv	2012-08-22 12:21:24.481703184 -0400
@@ -1,4 +1,5 @@
-@DNSMASQ@ --strict-order --bind-interfaces --conf-file= \
+@DNSMASQ@ --strict-order --bind-interfaces \
+--local=// --domain-needed --filterwin2k --conf-file= \
 --except-interface lo --listen-address 192.168.122.1 \
 --listen-address 192.168.123.1 --listen-address 2001:db8:ac10:fe01::1 \
 --listen-address 2001:db8:ac10:fd01::1 --listen-address 10.24.10.1 \
diff -uNr libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network-dns-hosts.argv libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network-dns-hosts.argv
--- libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network-dns-hosts.argv	

[Dnsmasq-discuss] DHCPv6 isn't working with Linux

2012-08-27 Thread e9hack
Hi,

I'm not able to get DHCPv6 running on Linux, but Windows 7 isn't a problem. I'm 
using
Opensuse 11.2 on a real PC and Opensuse 11.4 in a Virtual Box on the Windows 7 
PC. Dnsmasq
is running on a WLan router. The DHCPv6 client is ether the binary from the 
distribution
or self compiled from http://fedorahosted.org/dhcpv6. I did use tcpdump to 
capture a few
frames, but I don't know what is wrong on the Linux machines. One is configured 
for
'information only'. The other shall request a IPv6 lease. For this PC, I get 
many lines in
the lease file with different lease time entries like:

1346267260 100 fec0:::0:0::50 VBox-Linux 
00:01:00:01:dd:dd:dd:dd:dd:dd:dd:dd:dd:dd
1346267143 100 fec0:::0:0::50 VBox-Linux 
00:01:00:01:dd:dd:dd:dd:dd:dd:dd:dd:dd:dd
1346267016 100 fec0:::0:0::50 VBox-Linux 
00:01:00:01:dd:dd:dd:dd:dd:dd:dd:dd:dd:dd
1346266906 100 fec0:::0:0::50 VBox-Linux 
00:01:00:01:dd:dd:dd:dd:dd:dd:dd:dd:dd:dd

Regards,
Hartmut
20:08:02.227950 IP6 (hlim 1, next-header UDP (17) payload length: 46) 
fe80:::::.546  ff02::1:2.547: [udp sum ok] dhcp6 inf-req 
(xid=de7e4c (client-ID hwaddr/time type 1 time 1329653624 ) 
(elapsed-time 65535) (option-request DNS-server DNS-search-list lifetime))
20:08:02.232950 IP6 (hlim 64, next-header UDP (17) payload length: 78) 
fe80:::::.547  fe80:::::.546: [udp sum ok] 
dhcp6 reply (xid=de7e4c (client-ID hwaddr/time type 1 time 1329653624 
) (server-ID hwaddr/time type 1 time 399398608 00aa) 
(DNS-server fec0:0:0:::2) (Client-FQDN))
20:09:56.155950 IP6 (hlim 1, next-header UDP (17) payload length: 46) 
fe80:::::.546  ff02::1:2.547: [udp sum ok] dhcp6 inf-req 
(xid=de7e4c (client-ID hwaddr/time type 1 time 1329653624 ) 
(elapsed-time 65535) (option-request DNS-server DNS-search-list lifetime))
20:09:56.159950 IP6 (hlim 64, next-header UDP (17) payload length: 78) 
fe80:::::.547  fe80:::::.546: [udp sum ok] 
dhcp6 reply (xid=de7e4c (client-ID hwaddr/time type 1 time 1329653624 
) (server-ID hwaddr/time type 1 time 399398608 00aa) 
(DNS-server fec0:0:0:::2) (Client-FQDN))
20:10:06.702950 IP6 (hlim 1, next-header UDP (17) payload length: 99) 
fe80:::::.546  ff02::1:2.547: [udp sum ok] dhcp6 solicit 
(xid=d29363 (elapsed-time 0) (client-ID hwaddr/time type 1 time 388005577 
00bbb) (IA_NA IAID:184558125 T1:0 T2:0) (Client-FQDN) (vendor-class) 
(option-request DNS-search-list DNS-server vendor-specific-info Client-FQDN))
20:10:06.710950 IP6 (hlim 64, next-header UDP (17) payload length: 164) 
fe80:::::.547  fe80:::::.546: [udp sum ok] 
dhcp6 advertise (xid=d29363 (client-ID hwaddr/time type 1 time 388005577 
00bbb) (server-ID hwaddr/time type 1 time 399398608 00aa) 
(IA_NA IAID:184558125 T1:86400 T2:151200 (IA_ADDR fec0:::0:0::2 
pltime:172800 vltime:172800) (status-code success) (preference 255)[|dhcp6ext]) 
(preference 255) (DNS-server fec0:0:0:::2) (Client-FQDN))
20:10:07.706950 IP6 (hlim 1, next-header UDP (17) payload length: 145) 
fe80:::::.546  ff02::1:2.547: [udp sum ok] dhcp6 request 
(xid=d29363 (elapsed-time 0) (client-ID hwaddr/time type 1 time 388005577 
00bbb) (server-ID hwaddr/time type 1 time 399398608 00aa) 
(IA_NA IAID:184558125 T1:86400 T2:151200 (IA_ADDR fec0:::0:0::2 
pltime:172800 vltime:172800)[|dhcp6ext]) (Client-FQDN) (vendor-class) 
(option-request DNS-search-list DNS-server vendor-specific-info Client-FQDN))
20:10:07.729950 IP6 (hlim 64, next-header UDP (17) payload length: 164) 
fe80:::::.547  fe80:::::.546: [udp sum ok] 
dhcp6 reply (xid=d29363 (client-ID hwaddr/time type 1 time 388005577 
00bbb) (server-ID hwaddr/time type 1 time 399398608 00aa) 
(IA_NA IAID:184558125 T1:86400 T2:151200 (IA_ADDR fec0:::0:0::2 
pltime:172800 vltime:172800) (status-code success) (preference 255)[|dhcp6ext]) 
(preference 255) (DNS-server fec0:0:0:::2) (Client-FQDN))
20:11:47.847950 IP6 (hlim 1, next-header UDP (17) payload length: 46) 
fe80:::::.546  ff02::1:2.547: [udp sum ok] dhcp6 inf-req 
(xid=de7e4c (client-ID hwaddr/time type 1 time 1329653624 ) 
(elapsed-time 65535) (option-request DNS-server DNS-search-list lifetime))
20:11:47.952950 IP6 (hlim 64, next-header UDP (17) payload length: 78) 
fe80:::::.547  fe80:::::.546: [udp sum ok] 
dhcp6 reply (xid=de7e4c (client-ID hwaddr/time type 1 time 1329653624 
) (server-ID hwaddr/time type 1 time 399398608 00aa) 
(DNS-server fec0:0:0:::2) (Client-FQDN))
20:12:14.000950 IP6 (hlim 1, next-header UDP (17) payload length: 64) 
fe80:::::.546  ff02::1:2.547: [udp sum ok] dhcp6 solicit 
(xid=ffce30 (client-ID hwaddr/time type 1 time 384732886