|
How do I install DHCP on my Linux Server?I am planning to install DHCP on my Linux Server. I do not know that much in Linux (Red Hat), however. How can I install and configure a DHCP server on my system? First off, a definition. DHCP is the Dynamic Host Configuration Protocol and rather than use the default DHCP server included with your Red Hat / Fedora Linux system, I recommend that you pop over to the Internet Software Consortium and Download the latest version of the DHCP Server. As I write this, it's at version 3.0.3. Why is it important to have the latest version? In a word, security. As with any software that you're going to run on your server, it's critically important that you have the very latest version of this 'daemon' (as we Linux geeks call programs that run on the server without intervention) on your system. It's also very important to shut off any services you aren't using (a process I detail in my popular book Teach Yourself Unix System Administration in 24 Hours, by the way). So once you've downloaded the latest version of the software, you'll want to unpack it with: $ tar xzf ./dhcp-303-tar.gz
Now, move to the new directory that contains all the source and type in the following commands (the tons of output these commands have has been deleted to save our sanity here): $ ./configure
$ make Assuming all has gone well, switch to root by using the sudo command and install the new server: $ sudo make install
you'll be prompted for the root password, then, if you typed it in correctly, the new DHCP server will be installed onto your system. Good. Now you have the latest DHCP server it's time to configure it properly for your environment. This is best done by copying the file server/dhcp.conf from the installation directory into your /etc directory, like this: $ sudo cp server/dhcp.conf /etc
This time, since you just did a sudo command a few seconds ago, you won't be prompted for your password (an exceedingly slick feature of sudo, actually!) Now, again using sudo, it's time to edit the configuration file to match your system configuration. Here's what the dhcp.conf file looks like:
ddns-update-style interim # Redhat Version 8.0+
subnet 192.168.1.0 netmask 255.255.255.0 { # The range of IP addresses the server will issue to range 192.168.1.201 192.168.1.220; # Set the amount of time in seconds that default-lease-time 86400; option broadcast-address 192.168.1.255; option domain-name-servers 192.168.1.100; option netbios-name-servers 192.168.1.100; } # List an unused interface here host smallfry { As with many Linux configuration files, this is actually fairly well documented, especially since you should be able to type man dhcp-options to get an exhaustive explanation of each and every configuration option. In particular, make sure you set the domain name properly, identify your set of DNS servers by name, and define the subnet range for which you want to provide services via DHCP. Once that's all configured to your liking, a little bit more tweaking is required to get everything checked and started properly: $ sudo touch /var/lib/dhcp/dhcp.leases
Will make sure that you have a 'leases' file, a critical part of how the DHCP server tracks what systems it's seen and serviced. $ sudo chkconfig --level 35 dhcpd on
This will check your configuration and make sure it will be added to the list of daemons to start up at boot time from now on. Very useful if you don't want to remember to restart it each time! $ /etc/init.d/dhcp restart
Now you should be running a DHCP server on your system. Check to make sure it's running by using ps aux | grep dhcp but you should be -- hopefully -- good to go!
Categorized:
Unix and Linux Help
(Article 4170,
Written by Dave Taylor)
Tagged: Previous: Why Does My Mac Always Try to Boot Off the Wrong Disk? Next: How do I build a cool LinkedIn Signature Box? Subscribe!
unless you really need to flexibility and power of a true blue dhcp server, try udhcpd. just google for it. its small and fairly stable for what its built for. kjteoh Posted by: kjteoh at February 7, 2006 4:57 AMI want to know whether dhcp works across VLAN. We're getting a bit out of my depths, but as far as I understand, you'd need a different DHCP server on each LAN segment. Posted by: Dave Taylor at February 28, 2006 9:03 AMYou don't need a DHCP server per VLAN. You will need to configure the L3 switch or router to forward IP broadcasts - Cisco uses IP helper command. When the router forwards the DHCP request it will "tell" the DHCP server from which subnet the request came. Your DHCP will then (if it supports it) allocate an appropriate IP address (ie one from that subnet). Some DHCP servers will only allocate addresses from their own subnet (in which case it won't work). Posted by: Steve Worrall at May 31, 2006 4:05 PMFor different vlans how can i set up my dhcp server so that my client in diff.vlans get ip from dhcp server. hello Suport, now i have dhcp server but that is very old now i want migrate this in new one , please guide me how can i take the backup of old ane restor same in new also let me know what configuration is require for dhcp installation in linux box. i have downloaded the .tar, unpacked it, ./configure-make, are the commands i have done so far. but i have this lines after the make command cc -g -I/root/dhcp-3.0.6 -I/root/dhcp-3.0.6/includes -DLINUX_MAJOR=2 -DLINUX_MINOR=4 -c -o raw.o raw.c In version 3.0.6 you must issue the commands at the top of this page in this order. (3 seperate commands) ./configure Then continue like normal ... Posted by: Ben DeMott at November 20, 2007 11:32 PMi have a Intel P4 Pc with 945/946 intel motherboard and SATA HDD. How I can install RHEL 4 or Fedora core 5. How I can creat VPN, DHCP, DNS server in RHEL4/Fedora core 5. Posted by: titas at December 4, 2007 8:16 AMWhere do i find the DHCp after its installed? Posted by: Student at January 7, 2008 7:50 AMI saw the post above that gets an error after make but can't find the resolution. it worked after i installed the gcc compiler. Posted by: jay at February 6, 2008 5:29 PMThe error output is from make - it means that a compiler - 'cc' - isn't in your path. So installing gcc will fix this. You can check compilation/setup options by entering ./configure --help before actually configuring the package. If you for example want to install it somewhere other than /usr/local you need to set it in the configure line like so ./configure --prefix=/folder/to/install/into
Hi Dev, How can i configure a DHCPD IN FEDORA 5 AND THE FTP SERVICE.. Regards, Dear Dev, How to configure vsftpd in fedora 5 Regards, supposed help to others when it is INCOMPLETE is really frustrating. How the hell does one find where the output to the tar command went? Without knowing this, installing dhcp server is IMPOSSIBLE. from a frusterated biginner. noname, tar archives unpack in the current directory, either spewing their files everywhere in the current directory or, ideally, creating a subdirectory of their own with all the files therein. In this case, look for a new subdirectory called "dhcp-303" or similar. Posted by: Dave Taylor at July 15, 2008 11:52 AMThis is pretty helpful. I've configured my DHCP, but I have a (maybe stupid) question... I'm using a Linksys WRT54G router as my switch. What physical connection do I have to make between the DHCP and the switch in order to get my server functioning? Do I just attach it to the stanard ports? Posted by: Colin at November 1, 2008 12:03 PMPlease post me Posted by: kirtan at November 21, 2008 2:04 AMhow can i install fedora 9 server on sunfire x4200,x2200 amd server with firewall,squid proxy,email server Posted by: vijay at December 16, 2008 7:15 AMI am unable to get dhcp to start on Fedora 8, I have the config file for dhcp, but it does not show up on the enable list for the firewall, would that be the reason that it will not start through the terminal? Posted by: unknown at April 21, 2009 8:37 AMi check this tips but its all not working on my linu red hat fedora core 7 thanx Posted by: sahil raza at January 4, 2010 5:45 AMA working configuration example Server ip : 172.27.0.10 Please note default vlan 172.27.0.x in this case Switch and server need to be in default lan for communication / or else we need to trunk in case other vlan connected , we need to configure vconfig on server to communicate
ddns-update-style interim;
option subnet-mask 255.255.255.0;
Chkconfig –list dhcpd on /var/log/messages Check for the ip helper address in layer 3 swtich , which act as dhcp-relay
1) Run the Dhcp service in debug mode dhcpd in the foreground in debug mode with /usr/sbin/dhcpd -d –f Hopefully, a DHCP server like the one we’ll be configuring will respond. Running tcpdump shows a dhcp request looks like: Congratulations you have finally configured In easy steps how to install dhcp in fedora 13. error in this step : sudo touch /var/lib/dhcp/dhcp.leases i got error please help how to solve this problem touch: cannot touch `/var/lib/dhcp/dhcp.leases': No such file or directory thank u.......... I have something to say, now that you mention it, but ...
I do have a comment, now that you mention it!
|
Recommended
Recent Entries
Search
I Need Help!
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and RSS Feeds Building Web Site Traffic Business and Management CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above Facebook Help Google Plus Help HTML and CSS Industry News and Trade Shows iPhone and Cell Phone Help iPod, Sony PSP and MP3 Player Help Mac OS X Help Pay Per Click (PPC) Advertising Search Engine Optimization (SEO) Shell Script Programming Tech Support Video Help The Writing Business Twitter, LinkedIn and Social Network Help Unix and Linux Help Video Game Tips and Help Windows PC Help WordPress Help |