DHCP discover retries are too few and too seldom
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
CirrOS |
Triaged
|
Medium
|
Unassigned |
Bug Description
The 0.3.1 image uses the following dhcp client parameters by default:
$ ps -ef | grep dhcp
227 root udhcpc -R -n --timeout=60 -p /var/run/
It only sends up to 3 DHCP discover packets with a 60 second pause between. So when there is no DHCP replies from a server for whatever reason, it is like this:
t=0 send and wait 60
t=60 send and wait 60
t=120 send and give up, if this packet is not answered then the instance will never work without manual intervention.
A more reasonable default would be to retry 100 times with just 5 second pauses between.
This can be worked around by adding this line to the eth0 stanza of /etc/network/
udhcpc_opts -t 100 -T 5
and making a snapshot and booting from the snapshot instead.
$ udhcpc -?
udhcpc: invalid option -- ?
BusyBox v1.20.1 (2013-02-08 03:29:16 UTC) multi-call binary.
Usage: udhcpc [-fbnqoCRB] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]
[-V VENDOR] [-x OPT:VAL]... [-O OPT]...
-i,--interface IFACE Interface to use (default eth0) udhcpc/ default. script) option OPT Request option OPT from server (cumulative) default- options Don't request any options (unless -O is given)
-p,--pidfile FILE Create pidfile
-s,--script PROG Run PROG at DHCP events (default /usr/share/
-B,--broadcast Request broadcast replies
-t,--retries N Send up to N discover packets
-T,--timeout N Pause between packets (default 3 seconds)
-A,--tryagain N Wait N seconds after failure (default 20)
-f,--foreground Run in foreground
-b,--background Background if lease is not obtained
-n,--now Exit if lease is not obtained
-q,--quit Exit after obtaining lease
-R,--release Release IP on exit
-S,--syslog Log to syslog too
-a,--arping Use arping to validate offered address
-O,--request-
-o,--no-
-r,--request IP Request this IP address
-x OPT:VAL Include option OPT in sent packets (cumulative)
Examples of string, numeric, and hex byte opts:
-x hostname:bbox - option 12
-x lease:3600 - option 51 (lease time)
-x 0x3d:0100BEEFC0FFEE - option 61 (client id)
-F,--fqdn NAME Ask server to update DNS mapping for NAME
-V,--vendorclass VENDOR Vendor identifier (default 'udhcp VERSION')
-C,--clientid-none Don't send MAC as client identifier
Signals:
USR1 Renew lease
USR2 Release lease