- Linux Training
- Desktop Tutorials
- Server Tutorials
|Configuring the DHCP Server|
|Desktop - OpenSUSE|
What we will look at
1. Installing the DHCP Server on openSUSE
2. Configuring the Server with YaST
3. Configuring the Server from the command line
Installing the DHCP Server
We can install the DHCP Server by using the YaST Plugin. This is simple and installs the Server then takes us straight to the configuration. This is all that is needed and it does get the job done. For those that want to know a little more SUSE has there equivalent to Red Hat’s yum software management tool called zypper. Either way the objective is to install the DHCP server to deliver IPv4 addresses automatically.
To install from YaST, though the DHCP Server Plugin mast be installed. If it is not you then have to install that first. This can be achieved all from the command line to install both the plugin and the server in one go. So lets run the install from the command line and then look at YaST to manage this server later. It would seem pointless to install the plugin from the command line but not the server. Configuration I can accept may be easier from the YaST tools.
We will need root priviliges so from a terminal session on the server run to command :
to switch the to root account. Now we can use zypper to search (se) for and install (in) the required software:
From the output of the zypper search we can see that niether the dhcp-server or the yast2 module are installed but thay are available to install. To install both these options, the YaST module will allow us to configure DCHP from the GUI, we will use:
We hopefully can see now that the command line can be as easy to use as the GUI and quicker, but at least we now have the server installed so we can look at configuring it. From the command line we would need to edit two files and both start the server and configure it for auto-start, so arguably this is where the GUI starts to gain time.
Configuring DHCP Server with YaST
The great feature of YaST is that it can save a lot of work, we will see in the configuration we do not need to edit files directly nor do we need to start the service, this is all done my YaST. Havinf installed the plugin we should be able to start YaST and then select DHCP Server from Network Services.
The first page of the configuration wizard shows us the network interfaces we have configured on the server and, asks which one should the DHCP Server listen on. Here I will select eth1, with the static 172 address. We will see later that we are writing to the /etc/sysconfig/dhcpd file with this change.
The second page of the wizard ask some questions about network services such as the gateway and DNS. This is all written to the /etc/dhcpd.conf.
The third page then is the meat and vegetables of the configuration. The actual ip-address ranges to lease.
Okay, almost there. The next and final page asks about starting the service, this of course, will normally be selected to start on booting.
Cool, we are finished and you can test from a client. You may also want to check the output of netstat to show that the server is listening on port 67, the DHCP port.
Here we can see that the server is listening on all interfaces ( 0.0.0.0 ) on the dhcp port 67, using the command : netstat –aun
We can see then that the DHCP Server is running now, to check that it is configured for auto-start the output of : chkconfig –l dhcpd should confirm that the service should start in the text mode (runlevel 3) and the GUI Mode (runlevel 5)