DHCP Setup

From StarOS Community Wiki
Jump to navigation Jump to search

To setup ISC DHCP, go to System -> Services -> ISC DHCP Server -> Modify Configuration File.

ISC DHCP server is not available on the MIPS-COMPEX/WAR1 platform, so you will need to use udhcpd instead.

General Setup

There are a few variables that need to be set in all DHCP setups. Not doing so could result in the user having limited, sporadic, or no connectivity due to DNS or other problems. I'll cover the options set by default in StarOS, and what they do/mean.

option domain-name "mydomain.com";

This option just sets the "Domain Suffix" in windows to whatever you put here. In linux/BSD it sets the "domain" variable in /etc/resolv.conf to this. Most applications will suffix this to an invalid url. Ie, if you goto www with that, it'll try www.mydomain.com.


This tells the DHCP server what DNS servers to assign users. You can put more in there, but from my experience more than 3 is pushing it. Windows 95/98 seems to have issues with anything past the first one, and I've had mixed results with >3 servers. Linux/BSD are fine with more. To add more, just put a comma after the last ip and make sure the semi-colon is last. Ie, if you wanted to add a few more servers it would look like:


ddns-update-style none;

I can't really think of a good way to describe this, other than it's used for dynamically updating DNS entries when the client gets a new ip address. Most people won't need/want to change this.

default-lease-time 600;
max-lease-time 7200;

In seconds, what the default lease time and maximum lease time is for a computer to have an IP Address. After this time, the computer releases the IP it's been assigned and requests a new one from the DHCP server. It's pretty safe to set this pretty high, say in the 12-24 hour range. I'd avoid setting it too high as some DHCP implementations (Old Windows for example) have a nasty tendancy to break if set too high. Also, most of the time the IP won't change through the lease renewal process, so there's no real impact on connectivity.

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.

The comments pretty well describe this. If you want to have more than one DHCP server, that can be covered in a different section. But for now, leave that as it is.

Dynamic DHCP

This is probably the most common setup you'll encounter. By default, there are a few examples in Star-OS for you to use.

What you need do is go into the configuration file, and delete everything after the following text:

# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.

After that, you need to put this in there:

# Subnet with a range of dynamic IPs (150 IPs assigned)
subnet netmask {
 option routers;

Make sure to change the 192.168.123 number to whatever you've assigned on the interface you wish to give out ip addresses. Also note that this will only hand out IP addresses from .50 to .200. Most of the time the server will start from the top of the range, and hand out 200 first, and then work it's way down to 50.

I'd suggest leaving this as-is. The first and last 50 IP addresses tend to be used by various devices for various reasons, with .1 and .254 being the most common.

Static DHCP Assignments

This section will cover basic static DHCP assignments using the ISC DHCP built-in to StarOS

# To assign static DHCP assignments, use this syntax
host static_customer1 {
  # Your customer's MAC address
  hardware ethernet 00:4F:4E:0D:12:FF;
  # IP address to assign - not part of dynamic IP group above

The host directive needs to be unique and can be anything you want. The hardware ethernet is the MAC address of the computer's network card. And fixed-address is the IP you wish to assign them.

Note that in the example the IP is .201, which is after the last IP in the dynamic example above. It's easier to keep track of IPs that way, and it ensures that there isn't going to be any IP conflict. You can have as many of these as you want, as long as all of the host directives and IPs are unique.

Shared Network Statement (new version of ISC dhcpd included in StarV3 1.4.x)

If an interface you want to provide DHCP service on has more than one IP address assigned to it from different subnets, the shared-network descriptivename { } statement and subnet ip netmask { } statements should now be used to describe those other subnets. That includes subnets you are not providing IP addresses from: ISC dhcpd just needs to know about them. See the example below.

Full working example configuration

Here is a fully-working ISC dhcp config, just change things as appropriate to your network.

Please note my config includes deny unknown-clients; which you should remove if you intend to hand out DHCP leases to anybody.

I manually put each client's MAC address (see exampledynamicuser1 and exampledynamicuser2) in my DHCP servers.

If you don't intend to do that (or it's an open AP where that sort of thing isn't appropriate) then all you have to do is comment out deny unknown-clients; with a # in front of it. -Tog

option domain-name "yourispname.com";
option domain-name-servers,;
server-name "ap1.yourispname.com";
get-lease-hostnames true;
deny bootp;
deny unknown-clients;
one-lease-per-client true;
ddns-update-style none;
ddns-updates off;

default-lease-time 1800;
max-lease-time 1800;
min-lease-time 1800;

subnet netmask {
  option broadcast-address;
  option subnet-mask;
  option routers;

host examplestaticuser1 {
        hardware ethernet 00:80:c8:aa:bb:cc;

shared-network My-Multi-Subnet-Interface {
  subnet netmask { }  # no addresses to hand out
  subnet netmask {    # 100 addresses
    option routers;

host exampledynamicuser1 { hardware ethernet 00:15:e9:77:88:00; }
host exampledynamicuser2 { hardware ethernet 00:0f:b5:ee:aa:bb; }