Re: question about dhcp 4.3.2

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: question about dhcp 4.3.2

Waitman Gobble
On Fri, Mar 13, 2015 at 11:47 AM, Waitman Gobble <[hidden email]> wrote:

> On Wed, Mar 11, 2015 at 11:19 PM, Waitman Gobble <[hidden email]> wrote:
>> I'm working on a dhcp server instance and the client is not assigning IP.
>>
>> I get DHCPDISOVER followed by DHCPOFFER on 192.168.1.50 then a DHCPNAK
>> and DHCPINFORM on 192.168.0.16 (wrong network) - same device/ MAC.
>>
>>
>> This machine has two interfaces, one on 192.168.0.1 network and the
>> other 192.168.1.1 network. However, they are not bridged.
>>
>> # uname -a
>> FreeBSD blynk.waitman.net 11.0-CURRENT FreeBSD 11.0-CURRENT #0
>> r275492: Fri Dec  5 06:52:11 PST 2014
>> [hidden email]:/usr/obj/usr/src/sys/BLYNK  amd64
>>
>>
>> I am wondering why the client is not assigning the IP. I see the
>> request and the offer repeated several times, while the client status
>> is 'Assigning IP' ... which times out (then i see the 'wrong network'
>> messages appear in log and the client status reports 'IP assignment
>> failed')
>>
>> Also, wondering about the 'wrong network' messages.
>>
>> Here is the log file:
>> https://gist.github.com/waitman/533706a4133026ed0838
>>
>>
>> dhcpd.conf:
>>
>> default-lease-time 86400;
>> ddns-update-style none;
>> deny bootp;
>> one-lease-per-client true;
>> authoritative;
>> log-facility local7;
>>
>> option routers 192.168.1.254;
>> option broadcast-address 192.168.1.255;
>> option subnet-mask 255.255.255.0;
>> subnet 192.168.1.0 netmask 255.255.255.0 {
>> range 192.168.1.50 192.168.1.199;
>> }
>>
>>
>> ifconfig:
>>
>> https://gist.github.com/waitman/b59d3a1c7e42a2a84407
>>
>>
>> Any help, tips or pointers are appreciated.
>>
>> Thank you,
>>
>> --
>> Waitman Gobble
>> Los Altos California USA
>> 510-830-7975
>
>
> After doing some more experimentation using different client machines
> and tcpdump it seems that the dhcpd server is sending replies out
> through wanl0 instead of wlan1
> (I was curious about 'why' I was getting what seemed to be backscatter
> about 192.168.0.x wrong network requests... )
>
> example:
>
> # tcpdump -i wlan0 -vvv -s 1500 '(port 67 or port 68)'
> tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size
> 1500 bytes
> capability mode sandbox enabled
> 11:34:42.040699 IP (tos 0x0, ttl 64, id 1926, offset 0, flags [none],
> proto UDP (17), length 328)
>     192.168.0.32.bootps > 255.255.255.255.bootpc: [udp sum ok]
> BOOTP/DHCP, Reply, length 300, xid 0xd19857ce, Flags [none] (0x0000)
>           Your-IP 192.168.1.116
>           Client-Ethernet-Address 00:e0:4c:81:81:ea (oui Unknown)
>           Vendor-rfc1048 Extensions
>             Magic Cookie 0x63825363
>             DHCP-Message Option 53, length 1: Offer
>             Server-ID Option 54, length 4: 192.168.1.1
>             Lease-Time Option 51, length 4: 86400
>             Subnet-Mask Option 1, length 4: 255.255.255.0
>             BR Option 28, length 4: 192.168.1.1
>             END Option 255, length 0
>             PAD Option 0, length 0, occurs 32
>
>
>
> I'm starting the dchpd process with wlan1 as the argument, for
> example: /usr/cust/sbin/dhcpd wlan1
>
> a few things of note:
> 1) there's no bridge between wlan0 and wlan1
> 2) no pf or firewall running on test server or client
>
> the worrisome issue for me is that dhcpd - 4.3.1 works fine, (started
> with /usr/local/sbin/dhcpd wlan1 using same config file) - it's when I
> start 4.3.2 that I see dhcpd replies coming out of wlan0 interface
> instead of wlan1 as they should.
>
> Thanks,
>
> --
> Waitman Gobble
> Los Altos California USA
> 510-830-7975




This issue was resolved, USE_SOCKETS was set to '1' in includes/config.h

/* Define to 1 to use the standard BSD socket API. */
/* #undef USE_SOCKETS 1 */

I believe I had inadvertently used configuration option:
--enable-use-sockets    use the standard BSD socket API (default is no)

According to the note in includes/site.h, this causes a problem when
there 'more than one network interface is configured'

/* Define USE_SOCKETS to use the standard BSD socket API.

   On many systems, the BSD socket API does not provide the ability to
   send packets to the 255.255.255.255 broadcast address, which can
   prevent some clients (e.g., Win95) from seeing replies.   This is
   not a problem on Solaris.

   In addition, the BSD socket API will not work when more than one
   network interface is configured on the server.

   However, the BSD socket API is about as efficient as you can get, so if
   the aforementioned problems do not matter to you, or if no other
   API is supported for your system, you may want to go with it.
*/


I have written BSD Makefiles for dhcp-4.3.2 in order to remove the
build dependencies on Python, GCC and GNU tools. This is particularly
useful to me at least, when building the dhcpd server on an ARM
system. On a RPI/ARMv6 device running FreeBSD 11.0-CURRENT, the build
takes about 15 minutes. Builds with clang/llvm and BSD make.

If anyone has a need, it's available at
https://github.com/waitman/dhcp-4.3.2-mod

Thank you,

--
Waitman Gobble
Los Altos California USA
510-830-7975
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users