Multiple Subnet DHCP Server in OpenSuse 10.2

Hi all, long time not writing about IT stuffs, I’ve been a little busy lately :P. Anyway you might be wandering why my writing always about OpenSuse, well it because in my workplace they all use OpenSuse as primary OS (even for servers) for software development, of course there are some Windows PC, but it’s only about 30 %, and some using Solaris, so it’s a Unix world here 😀

About a month ago my boss asked me to replace the old machine that did all from proxy, DNS, DHCP, and Internet gateway. So in my plan I want to divide the machine into 2 machine one for DHCP and DNS while the other for proxy and internet gateway. For now I will discuss about DHCP server for multiple subnet.

The first thing that you can do is install the DHCP server using Yast, you can take the rpms from the OpenSuse installation CD/DVD. In Yast you go to Software, Software Management, change the filter to patterns, and in server function tick DHCP and DNS server.

After that you have to enable the service by go to Yast, network services, DHCP Server, and you can select which NIC that will serve DHCP service, after that you can just next next next….no matter what we’ll edit it later 😛

Then you can edit /etc/dhcpd.conf, you can edit it using vi or gedit or kate or kwrite, here is the example of the conf file:

option domain-name “your domain”; #Define your domain name
option domain-name-servers internal DNS, external DNS; #Define your DNS server
ddns-update-style none; #No Dynamic DNS
max-lease-time 172800; #Max Lease Time in second
default-lease-time 14400; #Default Lease Time in second
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
range 192.168.1.20 192.168.1.170;
}
subnet 192.168.2.0 netmask 255.255.255.0 { #Service for subnet 192.168.2.0/24
option routers 192.168.2.1; #Gateway for that subnet
option broadcast-address 192.168.2.255; #Broadcast address
range 192.168.2.20 192.168.2.100; #Range of IP that will be leased
host user { #Make an IP reservation for this host
hardware ethernet 00:1B:12:F5:85:12; #Host MAC Address
fixed-address 192.168.2.2; #Reserved IP
}
}
subnet 192.168.5.0 netmask 255.255.255.0 {
option routers 192.168.5.1;
option broadcast-address 192.168.5.255;
range 192.168.5.20 192.168.5.70;
}
subnet 192.168.6.0 netmask 255.255.255.0 {
option routers 192.168.6.1;
option broadcast-address 192.168.6.255;
range 192.168.6.20 192.168.6.70;
}
subnet 192.168.8.0 netmask 255.255.255.0 {
}
In the above configuration file, the condition is the DHCP server is in subnet 192.168.8.0/24 and this server is serving DHCP for 4 subnets. :This config file also show you how to make IP Reservation. You might notice that in the last line I made configuration for subnet 192.168.8.0/24, in my case I don’t want to offer any IP in this subnet but you have to write this configuration since your DHCP server is in this subnet, otherwise it will cause some error.

Since this Server configuration is done all you can do now is to set your Router or layer 3 switch to relay every DHCP request to this server, and that is another thing to do 😛

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s