<div dir="ltr"><div class="gmail_default" style="font-family:'times new roman',serif">The relay is just dhcrelay3 running with default options. 10.90.95.121 is the address of the machine running dnsmasq.</div><div class="gmail_default" style="font-family:'times new roman',serif"><br></div><div class="gmail_default" style="font-family:'times new roman',serif">/usr/sbin/dhcrelay3 -d -i bond0.1274 -i bond0.1215 -c 12 -A 576 -m discard 10.90.95.121<br></div><div class="gmail_default" style="font-family:'times new roman',serif"><br></div><div class="gmail_default" style="font-family:'times new roman',serif">Looking at the dhcrelay source code, it looks like it just sets giaddr to the first ip address assigned on the system running the relay:</div><div class="gmail_default" style="font-family:'times new roman',serif"><br></div><div class="gmail_default" style="font-family:'times new roman',serif"><div class="gmail_default">   741     if (!packet->giaddr.s_addr)</div><div class="gmail_default">   742         packet->giaddr = ip->addresses[0]</div></div><div class="gmail_default" style="font-family:'times new roman',serif"><br></div><div class="gmail_default" style="font-family:'times new roman',serif">If dnsmasq really does rely on giaddr being set to an address in the correct subnet, it looks like I may have to replace dhcrelay3. Unfortunately, it's running on Brocade vRouter (a routing platform with a Linux control plane based on the earlier Vyatta product and related to the open-source VyOS product), so that might be tricky.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 11, 2016 at 12:06 PM, Simon Kelley <span dir="ltr"><<a href="mailto:simon@thekelleys.org.uk" target="_blank">simon@thekelleys.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<br>
</span>OK, so the "ignored" thing was a red-herring, now we have the actual log<br>
s.<br>
<br>
You're ASCII art got mangled, so I can't work out exactly what the<br>
network topology is, but the logs show why no address is being allocated<br>
:<br>
<span class=""><br>
dnsmasq-dhcp: 529627704 available DHCP subnet: <a href="http://10.90.95.65/255.255.255.1" rel="noreferrer" target="_blank">10.90.95.65/255.255.255.1</a><br>
92<br>
dnsmasq-dhcp: 529627704 DHCPDISCOVER(bond0) 0c:c4:7a:8e:1d:62 no<br>
address available<br>
<br>
</span>As  0c:c4:7a:8e:1d:62 only has a dhcp-host address on<br>
<a href="http://10.88.177.0/255.255.255.128" rel="noreferrer" target="_blank">10.88.177.0/255.255.255.128</a> but dnsmasq thinks it's on<br>
<a href="http://10.90.95.65/255.255.255.192" rel="noreferrer" target="_blank">10.90.95.65/255.255.255.192</a>.<br>
<br>
What needs to happen is that the DHCP relay forwards the DHCP discover<br>
packet to dnsmasq, and before it does that, it sets the "giaddr" field<br>
to the relay's address _on_the_subnet_where_the_host_<wbr>is.<br>
<br>
So in this case, giaddr should be set to 10.88.177.1, which would<br>
enable dnsmasq to allocate it an address on that subnet, and not the<br>
subnet where the request arrives at the dnsmasq server.<br>
<br>
How is the DHCP relay configured?<br>
<br>
Simon.<br>
<div><div class="h5"><br>
<br>
On 10/08/16 02:25, James Brown wrote:<br>
> Hi Simon:<br>
><br>
> The string "ignore" does not occur in my config. Below is the<br>
> current entire config that I'm running on while I test this,<br>
> without the networks re-written into the clearer forms above:<br>
><br>
> no-resolv server=8.8.8.8 no-daemon no-hosts log-facility=/dev/null<br>
> log-dhcp log-queries enable-tftp tftp-root=/srv/install/tftp<br>
> port=0 dhcp-option=6,10.90.95.113<br>
> dhcp-range=10.88.81.65,static,<wbr>255.255.255.192<br>
> dhcp-range=10.90.95.65,static,<wbr>255.255.255.192<br>
> dhcp-range=10.91.78.0,static,<wbr>255.255.255.192<br>
> dhcp-range=10.88.177.0,static,<wbr>255.255.255.128<br>
> dhcp-host=0c:c4:7a:8e:1d:62,<wbr>10.88.177.107<br>
> dhcp-option=3,10.88.177.1<br>
><br>
> And the output when trying to boot the machine listed under<br>
> dhcp-host:<br>
><br>
> dnsmasq: started, version 2.76 DNS disabled dnsmasq: compile time<br>
> options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua<br>
> TFTP no-conntrack ipset auth no-DNSSEC loop-detect inotify<br>
> dnsmasq-dhcp: DHCP, static leases only on 10.88.177.0, lease time<br>
> 1h dnsmasq-dhcp: DHCP, static leases only on 10.91.78.0, lease time<br>
> 1h dnsmasq-dhcp: DHCP, static leases only on 10.90.95.65, lease<br>
> time 1h dnsmasq-dhcp: DHCP, static leases only on 10.88.81.65,<br>
> lease time 1h dnsmasq-tftp: TFTP root is /srv/install/tftp<br>
> dnsmasq-dhcp: 529627704 available DHCP subnet:<br>
> <a href="http://10.90.95.65/255.255.255.192" rel="noreferrer" target="_blank">10.90.95.65/255.255.255.192</a> dnsmasq-dhcp: 529627704<br>
> DHCPDISCOVER(bond0) 0c:c4:7a:8e:1d:62 no address available<br>
> dnsmasq-dhcp: 529627704 available DHCP subnet:<br>
> <a href="http://10.90.95.65/255.255.255.192" rel="noreferrer" target="_blank">10.90.95.65/255.255.255.192</a> dnsmasq-dhcp: 529627704<br>
> DHCPDISCOVER(bond0) 0c:c4:7a:8e:1d:62 no address available<br>
> dnsmasq-dhcp: 4100833080 available DHCP subnet:<br>
> <a href="http://10.90.95.65/255.255.255.192" rel="noreferrer" target="_blank">10.90.95.65/255.255.255.192</a> dnsmasq-dhcp: 4100833080<br>
> DHCPDISCOVER(bond0) 0c:c4:7a:8e:1d:62 no address available<br>
> dnsmasq-dhcp: 4100833080 available DHCP subnet:<br>
> <a href="http://10.90.95.65/255.255.255.192" rel="noreferrer" target="_blank">10.90.95.65/255.255.255.192</a> dnsmasq-dhcp: 4100833080<br>
> DHCPDISCOVER(bond0) 0c:c4:7a:8e:1d:62 no address available<br>
><br>
> On Wed, Aug 3, 2016 at 2:57 PM, Simon Kelley<br>
</div></div>> <<a href="mailto:simon@thekelleys.org.uk">simon@thekelleys.org.uk</a>> wrote: "dnsmasq-dhcp: 1302931552<br>
<div><div class="h5">> DHCPDISCOVER(bond0) 00:aa:bb:cc:dd:ee ignored"<br>
><br>
> Implies that you've somehow configured dnsmasq to ignore this<br>
> client, either with<br>
><br>
> dhcp-host=<stuff to id client>,ignore<br>
><br>
> or<br>
><br>
> dhcp-ignore=<some tags><br>
><br>
><br>
> Maybe take a look at the rest of the config you didn't post or post<br>
> it here? Fixing this problem is necessary before looking at the<br>
> subnet address selection stuff, which should be possible using a<br>
> DHCP relay.<br>
><br>
> Cheers,<br>
><br>
> Simon.<br>
><br>
><br>
><br>
> On 02/08/16 23:43, James Brown wrote:<br>
>>>> I have a setup roughly like the following ASCII-art diagram<br>
>>>> (numbers and number of VLANs simplified greatly):<br>
>>>><br>
>>>><br>
>>>> |===== VLAN 1 : <a href="http://10.0.1.0/24" rel="noreferrer" target="_blank">10.0.1.0/24</a>  ======|    |============== VLAN<br>
>>>> 2: <a href="http://10.0.2.0/24" rel="noreferrer" target="_blank">10.0.2.0/24</a> ==============| |<br>
>>>> | | | |   |------------------|        |-------------| | |<br>
>>>> | admin host   |        |  gateway    | | |   |<br>
>>>> <a href="http://10.0.1.2/24" rel="noreferrer" target="_blank">10.0.1.2/24</a>   | | <a href="http://10.0.1.1/24" rel="noreferrer" target="_blank">10.0.1.1/24</a> |<br>
>>>> |----------------------------|      | | |------------------|<br>
>>>> | <a href="http://10.0.2.1/24" rel="noreferrer" target="_blank">10.0.2.1/24</a> |       |   client host | | |<br>
>>>> | etc         |       | should get static lease of |      |<br>
>>>> | |-------------|       | 10.0.2.x |      | | |    |<br>
>>>> |----------------------------|      |<br>
>>>> |=============================<wbr>=====|<br>
>>>> |=============================<wbr>====================|<br>
>>>><br>
>>>> ?We have multiple VLANs each of which has its own subnet.<br>
>>>> They're bridged by a single multi-homed gateway (actually, an<br>
>>>> HA pair of them, but whatever). The gateway is running<br>
>>>> dhrelay3 and forwarding DHCP requests to the admin host in<br>
>>>> the administrative VLAN, which is running dnsmasq with a<br>
>>>> database of addresses to hand out.? I would prefer to be able<br>
>>>> to avoid having to put that database on the gateway and have<br>
>>>> a bunch of dynamic host configuration on a router. The admin<br>
>>>> host is single-homed.<br>
>>>><br>
>>>> The dnsmasq config looks like the following (I've removed<br>
>>>> most of the entries and config to simplify the question):<br>
>>>><br>
>>>> port = 0 dhcp-range=10.0.1.0,static,<wbr>255.255.255.0<br>
>>>> dhcp-range=10.0.2.0,static,<wbr>255.255.255.0<br>
>>>> dhcp-option=6,10.0.2.3 dhcp-option=3,10.0.2.1<br>
>>>> dhcp-host=00:aa:bb:cc:dd:ee,<wbr>10.2.0.86<br>
>>>><br>
>>>> Unfortunately, dnsmasq seems to refuse to hand out addresses<br>
>>>> from a non-directly-connected subnet. When the requests come<br>
>>>> in from 00:aa:bb:cc:dd:ee, I just get the following logged:<br>
>>>><br>
>>>> dnsmasq: started, version 2.76 DNS disabled dnsmasq: compile<br>
>>>> time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP<br>
>>>> DHCPv6 no-Lua TFTP no-conntrack ipset auth no-DNSSEC<br>
>>>> loop-detect inotify dnsmasq-dhcp: DHCP, static leases only on<br>
>>>> 10.0.1.0, lease time 1h dnsmasq-dhcp: DHCP, static leases<br>
>>>> only on 10.0.2.0, lease time 1h dnsmasq-dhcp: DHCP, static<br>
>>>> leases only on 10.0.3.0, lease time 1h dnsmasq-dhcp:<br>
>>>> 1302931552 available DHCP subnet: <a href="http://10.0.1.0/255.255.255.0" rel="noreferrer" target="_blank">10.0.1.0/255.255.255.0</a><br>
>>>> dnsmasq-dhcp: 1302931552 DHCPDISCOVER(bond0)<br>
>>>> 00:aa:bb:cc:dd:ee ignored dnsmasq-dhcp: 1302931552 available<br>
>>>> DHCP subnet: <a href="http://10.0.1.0/255.255.255.0" rel="noreferrer" target="_blank">10.0.1.0/255.255.255.0</a> dnsmasq-dhcp: 1302931552<br>
>>>> DHCPDISCOVER(bond0) 00:aa:bb:cc:dd:ee ignored dnsmasq-dhcp:<br>
>>>> 4279941416 available DHCP subnet: <a href="http://10.0.1.0/255.255.255.0" rel="noreferrer" target="_blank">10.0.1.0/255.255.255.0</a><br>
>>>> dnsmasq-dhcp: 4279941416 DHCPDISCOVER(bond0)<br>
>>>> 00:aa:bb:cc:dd:ee ignored<br>
>>>><br>
>>>> ?Tcpdump of the packets being received by ?the host look<br>
>>>> roughly like the following:<br>
>>>><br>
>>>> 22:23:57.987953 IP (tos 0x0, ttl 64, id 48608, offset 0,<br>
>>>> flags [DF], proto UDP (17), length 328) 10.0.1.1.bootps ><br>
>>>> admin.bootps: BOOTP/DHCP, Request from 00:aa:bb:cc:dd:ee (oui<br>
>>>> Unknown), length 300, hops 1, xid 0x4ec4ba20, secs 24, Flags<br>
>>>> [none] Gateway-IP 10.0.1.1 Client-Ethernet-Address<br>
>>>> 00:aa:bb:cc:dd:ee (oui Unknown) Vendor-rfc1048 Extensions<br>
>>>> Magic Cookie 0x63825363 DHCP-Message Option 53, length 1:<br>
>>>> Discover Parameter-Request Option 55, length 13: Subnet-Mask,<br>
>>>> BR, Time-Zone, Classless-Static-Route Domain-Name,<br>
>>>> Domain-Name-Server, Hostname, YD YS, NTP, MTU, Option 119<br>
>>>> Default-Gateway<br>
>>>><br>
>>>> ?I would like for the admin host (<a href="http://10.0.1.1/24" rel="noreferrer" target="_blank">10.0.1.1/24</a>) to be able to<br>
>>>> hand out IP addresses to hosts in any VLAN without having to<br>
>>>> multi-home it. Is this just impossible in dnsmasq, or is<br>
>>>> there some magic option that will tell it to hand out IP<br>
>>>> addresses on a non-connected subnet when the request goes<br>
>>>> through a relay?<br>
>>>><br>
>>>> I've attempted to go through the source code, but even once<br>
>>>> I figured out the idiosyncratic indentation style of<br>
>>>> rfc2131.c, I still can't figure out precisely where the logic<br>
>>>> to generate this message lives.<br>
>>>><br>
>>>> ?Thanks for any help y'all can provide.?<br>
>>>><br>
>>>><br>
>>>><br>
>>>> ______________________________<wbr>_________________<br>
>>>> Dnsmasq-discuss mailing list<br>
>>>> <a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.<wbr>thekelleys.org.uk</a><br>
>>>> <a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">http://lists.thekelleys.org.<wbr>uk/mailman/listinfo/dnsmasq-<wbr>discuss</a><br>
>>>><br>
>><br>
>><br>
>>>><br>
______________________________<wbr>_________________<br>
>> Dnsmasq-discuss mailing list<br>
>> <a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.<wbr>thekelleys.org.uk</a><br>
>> <a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">http://lists.thekelleys.org.<wbr>uk/mailman/listinfo/dnsmasq-<wbr>discuss</a><br>
><br>
><br>
><br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2.0.22 (GNU/Linux)<br>
<br>
</div></div>iQIcBAEBCAAGBQJXrMy7AAoJEBXN2m<wbr>rhkTWiNWEP/<wbr>0r2KXUyWqYHP1ULlQyiDny8<br>
LXQSkvPp/<wbr>FeyExHQdunvtkyXnmKfHpUkNSl8b5z<wbr>hYyH1xouobHwe9DTdju6qRb79<br>
gfMRRRS7R1wRzemzfE872/<wbr>zRpXPI9kCZoWuh3ff2AewqXKwjkdWt<wbr>gURghF0A5AfW<br>
gVNYYIjnASj88EGVlsRwL/<wbr>u4fULc34peAYuFZ0qnw1qjZPt3otaW<wbr>Ltu2iz2qCG1x<br>
oHMCC+<wbr>r2XiaHGSxcUxwYOj2vbKGEb3axcFtS<wbr>QvrsrS7MjeHHy8Q7GP6D8kN/N7ir<br>
vtohdof709/75WJG7BPh2o6fKe1+<wbr>4cujM7YojbcGsakqXSPnCzZm7FNfjd<wbr>PXoj4c<br>
oYKAFdPnebzza8aQbrD0lf3ssDvbp+<wbr>LMWEGosjyw4uNX0YMZm+<wbr>qPykALXReL4dbT<br>
OC8cIT36grNrdW4ajL1VgisgqDbt4F<wbr>EAKFAXdWvVodI4h00Ohul9hPBYT1Jm<wbr>n30t<br>
rdlI+uZZosQ17d/uXYudU8v/<wbr>trkrKNhh/BDYBWCvGRvK2zWDNUA/<wbr>53uUcVOneI56<br>
co3LF9W6/<wbr>9Um6edulGbFNPuOBpWCLN75DU2yTmg<wbr>mUlyVPk+yu+g9mcgGyz7RvqNI<br>
NRDsVDhv4oF4kp7/QkGqE+/<wbr>EFyeTLrzGMgvoKy6wV+uc+<wbr>0olHlKaiJ31e45XOhxL<br>
RIftDYws8P9cYt5rmWYh<br>
=qm0U<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><font face="times new roman, serif">James Brown</font><div><font face="times new roman, serif">Engineer</font></div></div></div>
</div>