Why does dhcp client require a router (gateway) specification?
Peter Dufault
dufault at hda.com
Wed Dec 17 13:28:16 UTC 2014
If I don't specify a router in the dhcpd.conf file for the system that provides leases to the RTEMS dhcp client when the lease time is 1/2 over I start to get these messages on the console. 118 is "EHOSTUNREACH".
++
bootpc_call: sosend: 118
bootpc_call: sosend: 118
BOOTP timeout for server 255.255.255.255
DHCP call failed -- error 116bootpc_call: sosend: 118
--
I get this logged at boot, note the gw 0.0.0.0 and the "error=114" message (ENETUNREACH):
++
dhcpc: smc: inet: 192.168.240.36 mask: 255.255.255.0
srv: 192.168.240.4 gw: 0.0.0.0
bootpc_adjust_interface: add net route, error=114
--
ifconfig shows that both the netmask and broadcast address for SMC0 are correct:
++
Ethernet Address: 50:2D:F4:01:D5:12
Address:192.168.240.36 Broadcast Address:192.168.240.255 Net mask:255.255.255.0
Flags: Up Broadcast Running Simplex
--
Here is the routing table:
++
[/] # route
Destination Gateway/Mask/Hw Flags Refs Use Expire Interface
127.0.0.1 127.0.0.1 UH 0 0 0 lo0
192.168.240.0 255.255.255.0 U 0 0 4 smc0
192.168.240.4 00:21:9B:01:EF:D0 UHL 1 1494 1209 smc0
[/] #
--
If I specify a router in dhcpd.conf, even to something that doesn't exist ("option routers 192.168.240.1;"), then DHCP works OK. Boot up is like this:
++
dhcpc: smc: inet: 192.168.240.36 mask: 255.255.255.0
srv: 192.168.240.4 gw: 192.168.240.1
--
And the routing table is like this:
++
[/] # route
Destination Gateway/Mask/Hw Flags Refs Use Expire Interface
default 192.168.240.1 UGS 1 0 0 smc0
127.0.0.1 127.0.0.1 UH 0 0 0 lo0
192.168.240.0 255.255.255.0 U 0 0 4 smc0
192.168.240.1 UHL 2 0 4 smc0
192.168.240.4 00:21:9B:01:EF:D0 UHL 1 1494 1209 smc0
255.255.255.255 192.168.240.1 UGH 0 1 3634 smc0
[/] #
--
I don't want the embedded system to have a default router. Is there something I need to do in my dhcp client setup, or is this a defect in RTEMS dhcpd?
Peter
-----------------
Peter Dufault
HD Associates, Inc. Software and System Engineering
More information about the users
mailing list