DHCP client fails -> Start a DHCP Server

Johan_Els

Well-Known Member
Joined
Feb 23, 2006
Messages
128
Reaction score
0
Location
Centurion
Good afternoon,

I would like to have an Ubuntu server on a network that during boot would detect if a DHCP server exists, then just get an IP and continue.

If no DHCP exists, so the client times out, to then start a DHCP server for that network.

Any ideas?

Thank you,
 
I think I found the first part. Assigning an IP if DHCP fails...

/etc/dhcp/dhclient.conf
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers,
dhcp6.fqdn, dhcp6.sntp-servers;

timeout 60;
lease {
interface "eth0";
fixed-address 10.2.1.1;
medium "link0 link1";
option host-name "appliance.whateveritshouldbe.co.za";
option subnet-mask 255.255.255.0;
option broadcast-address 10.2.1.255;
option routers 10.2.1.2;
option domain-name-servers 10.2.1.2;
}
 
And dnsmasq seems to just not start the DHCP server without the IP on the interface:

/etc/dnsmasq.conf
domain=whateveritshouldbe.co.za
interface=eth0
dhcp-range=10.2.1.10,10.2.1.254,12h
dhcp-option=3,10.2.1.2

So sorted....
 
Top
Sign up to the MyBroadband newsletter
X