Configuring DHCP Server in RHEL7/ Cent OS 7

DHCP – Dynamic host configuration protocol

We are going to configure DHCP Server in RHEL7

It’s a network protocol used to assign IP’s to the client dynamically over the network.

DHCP Workflow:

Required Package installation:

#yum install dhcp

Now we should assign a insterface in DHCPDARGS in /etc/sysconfig/dhcpd

 [root@localhost ~]# vi /etc/sysconfig/dhcpd
 
  DHCPDARGS=enp0s3

After installing package it will create one empty configuration file /etc/dhcp/dhcpd.conf  and we have one sample configuration file under /usr/share/doc/dhcp-4.2.15/dhcpd.conf.exmaple.

So as first, append the content from example file to original file using cat command.

[root@localhost ~]# cat /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example >> /etc/dhcp/dhcpd.conf

Open the configuration file to configure DHCP Server:

First will give basic configuration which will be common for your network.

[root@localhost ~]# vi /etc/dhcp/dhcpd.conf


Make the below entries 

 option domain-name "lbcdomain.com";
 option domain-name-servers server.lbcdomain.com;
 default-lease-time 600;
 max-lease-time 7200;
 authoritative;
 log-facility local7;



Now make subnet details in same configuration file.

subnet 192.168.1.0 netmask 255.255.255.0 {
 option routers 192.168.1.254;
 option subnet-mask 255.255.255.0;
 option domain-search "lbcdomain.com";
 option domain-name-servers 192.168.1.1;
 option time-offset -18000; # Eastern Standard Time
 range 192.168.1.10 192.168.1.100;
}

Optional(To reserve IP for a dhcp client machine) :

If you wan to assign a static IP to a client using DHCP service, use the below command.

host station1 {
 option host-name "node11.lbcdomain.com";
 hardware ethernet 00:12:2A:2B:3C:AB;
 fixed-address 192.168.1.100;
}

Restart the dhcp service now to complete the DHCP server configuration.

[root@localhost ~]# systemctl restart dhcp
To check dhcp we should login in client machine which is in same network physically and edit the interface configuration file to make dhcp ip assigned.
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
 change the entry for BOOTPROTO as dhcp

DEVICE=eth0

BOOTPROTO=dhcp

TYPE=Ethernet

ONBOOT=yes
 
Save and quit.
 
Now restart the network service.
 #service network restart
 
now check for the ip and it should be assigned in between 192. 168.1.50 to 192.168.1.254
  
DHCP Configuration has been done.
Do practice well. All the best.

12 thoughts on “Configuring DHCP Server in RHEL7/ Cent OS 7”

  1. I have been browsing online more than 4 hours today, yet I never found any interesting article like
    yours. It’s pretty worth enough for me. In my view, if all site
    owners and bloggers made good content as you did, the
    net will be much more useful than ever before.|
    I couldn’t resist commenting. Well written!|
    I will immediately snatch your rss feed as I can not
    in finding your email subscription hyperlink or
    newsletter service. Do you’ve any? Please allow
    me realize in order that I may subscribe. Thanks.|
    It’s perfect time to make some plans for the future and it is time to be happy.
    I have read this post and if I could I desire to suggest you some interesting things
    or advice. Perhaps you could write next articles
    referring to this article. I wish to read more things about it!|
    It is appropriate time to make a few plans for the long run and it’s time to be happy.
    I have learn this submit and if I may just I want to recommend you some fascinating issues
    or advice. Perhaps you could write subsequent articles regarding this article.
    I want to learn more issues about it!|
    I have been surfing online greater than three hours lately, but I by no means
    found any interesting article like yours. It’s beautiful
    value sufficient for me. Personally, if all site owners and bloggers made just right content as you did,
    the internet will likely be much more helpful than ever before.|
    Ahaa, its nice dialogue regarding this article here at this blog, I have read all that, so at this
    time me also commenting at this place.|
    I am sure this post has touched all the internet people, its really really good paragraph on building up new webpage.|
    Wow, this article is fastidious, my sister is analyzing
    such things, therefore I am going to inform her.|
    bookmarked!!, I love your site!|
    Way cool! Some extremely valid points! I appreciate
    you penning this write-up and the rest of the website is extremely good.|
    Hi, I do think this is a great website. I stumbledupon it ;
    ) I’m going to come back once again since i have book marked it.
    Money and freedom is the greatest way to change,
    may you be rich and continue to help others.|
    Woah! I’m really enjoying the template/theme of this website.
    It’s simple, yet effective. A lot of times it’s
    difficult to get that “perfect balance” between user friendliness and visual appearance.
    I must say you have done a very good job with this.
    Also, the blog loads extremely fast for me
    on Safari. Outstanding Blog!|
    These are genuinely enormous ideas in about blogging.
    You have touched some nice factors here. Any way keep up wrinting.|
    I love what you guys tend to be up too. This type of clever work and reporting!
    Keep up the great works guys I’ve included you guys to our blogroll.|
    Hi! Someone in my Facebook group shared this website with us so I came to give it a look.
    I’m definitely enjoying the information. I’m bookmarking and will be tweeting this to my followers!
    Terrific blog and superb design and style.|
    I enjoy what you guys are up too. This type of clever work and coverage!
    Keep up the very good works guys I’ve included you guys to my personal blogroll.|
    Hi would you mind stating which blog platform you’re working with?

    I’m looking to start my own blog in the near future but I’m having a hard time selecting between BlogEngine/Wordpress/B2evolution and Drupal.

    The reason I ask is because your design seems different then most blogs and I’m looking for something completely unique.
    P.S My apologies for being off-topic but I had to ask!|
    Hi there would you mind letting me know which hosting company you’re using?
    I’ve loaded your blog in 3 completely different internet browsers and I must say this
    blog loads a lot faster then most. Can you suggest a good
    web hosting provider at a reasonable price? Many thanks, I
    appreciate it!|
    Everyone loves it when people get together and share thoughts.
    Great website, keep it up!|
    Thank you for the auspicious writeup. It
    in fact was a amusement account it. Look advanced to more added agreeable
    from you! By the way, how could we communicate?|
    Hi there just wanted to give you a quick
    heads up. The text in your post seem to be running off the screen in Internet explorer.
    I’m not sure if this is a format issue or something to do with
    web browser compatibility but I figured I’d post to let you know.
    The design look great though! Hope you get the issue fixed soon. Cheers|
    This is a topic that’s near to my heart…
    Many thanks! Exactly where are your contact details though?|
    It’s very easy to find out any topic on web as compared
    to books, as I found this piece of writing at this website.|
    Does your blog have a contact page? I’m having trouble locating it but,
    I’d like to send you an email. I’ve got some ideas for your blog you might be interested in hearing.
    Either way, great site and I look forward to seeing it expand over
    time.|
    Hola! I’ve been reading your web site for a while now and finally got the courage to go ahead and give you a shout out from Huffman Tx!
    Just wanted to say keep up the good work!|
    Greetings from Colorado! I’m bored at work so I decided to browse
    your blog on my iphone during lunch break.
    I enjoy the knowledge you provide here and can’t wait to take a look when I get home.
    I’m shocked at how quick your blog loaded on my cell phone ..

    I’m not even using WIFI, just 3G .. Anyways, wonderful blog!|
    Its like you learn my thoughts! You appear to grasp a lot
    approximately this, like you wrote the guide in it or something.
    I think that you just could do with some p.c. to pressure the message home
    a little bit, but other than that, that is excellent blog.
    An excellent read. I’ll certainly be back.|
    I visited multiple web sites however the audio quality for audio songs current at this website is actually
    superb.|
    Hi, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam remarks?
    If so how do you reduce it, any plugin or anything you can recommend?
    I get so much lately it’s driving me crazy so any
    support is very much appreciated.|
    Greetings! Very helpful advice in this particular article!
    It’s the little changes that produce the most significant changes.
    Thanks a lot for sharing!|
    I truly love your website.. Very nice colors & theme.

    Did you create this web site yourself? Please reply back as I’m hoping to create my own personal blog and would love to find out where you got this
    from or what the theme is named. Thank you!|
    Hi there! This post couldn’t be written any
    better! Looking at this post reminds me of my previous roommate!

    He continually kept talking about this. I most certainly will send this post to him.
    Fairly certain he’s going to have a very good read. Thanks for
    sharing!|
    Amazing! This blog looks just like my old one!
    It’s on a completely different topic but it has pretty much the same page layout and
    design. Superb choice of colors!|
    There’s definately a lot to learn about this subject.

    I really like all of the points you have made.|
    You made some good points there. I checked on the
    internet to find out more about the issue
    and found most individuals will go along with your views
    on this site.|
    Hi, I check your blogs like every week. Your humoristic
    style is awesome, keep doing what you’re doing!|
    I just could not go away your web site prior to suggesting
    that I really loved the standard info an individual provide on your guests?
    Is gonna be back steadily to inspect new posts|
    I need to to thank you for this good read!! I absolutely enjoyed every little
    bit of it. I’ve got you book-marked to look at new things you
    post…|
    Hello, just wanted to mention, I enjoyed this article.

    It was practical. Keep on posting!|
    Hello, I enjoy reading all of your article post. I wanted to
    write a little comment to support you.|
    I always spent my half an hour to read this blog’s posts everyday along with a cup of coffee.|
    I every time emailed this weblog post page to all my associates, for the reason that if
    like to read it next my friends will too.|
    My developer is trying to persuade me to move to .net from PHP.
    I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using Movable-type on several
    websites for about a year and am worried about switching to
    another platform. I have heard very good things about blogengine.net.

    Is there a way I can import all my wordpress content into it?

    Any help would be really appreciated!|
    Hello! I could have sworn I’ve visited your blog before but after going through many of the posts I realized it’s new to me.

    Regardless, I’m certainly delighted I came across it and I’ll be book-marking it and checking back regularly!|
    Wonderful article! This is the kind of information that should be shared around the
    internet. Shame on the seek engines for now not positioning this
    submit higher! Come on over and discuss with my site .
    Thank you =)|
    Heya i’m for the first time here. I found this board and I find It really useful &
    it helped me out a lot. I hope to give something
    back and aid others like you helped me.|
    Greetings, I think your web site could be having internet browser compatibility problems.
    When I look at your web site in Safari, it looks fine but when opening
    in IE, it has some overlapping issues. I just wanted to provide you with a quick heads up!

    Besides that, wonderful site!|
    A person essentially lend a hand to make critically
    articles I would state. This is the first time I frequented your web page and thus far?
    I surprised with the research you made to create this actual submit extraordinary.
    Wonderful process!|
    Heya i am for the first time here. I found this board and I find It truly helpful & it
    helped me out a lot. I’m hoping to present one thing back and help others like you aided me.|
    Hey there! I simply would like to offer you a huge thumbs up for the great information you have got right here on this
    post. I’ll be coming back to your website for more soon.|
    I always used to read piece of writing in news papers but now as I am a user of web thus from
    now I am using net for articles, thanks to web.|
    Your means of explaining all in this post is truly pleasant, every
    one be capable of effortlessly understand it, Thanks a lot.|
    Hello there, I discovered your website by means of Google at the same time as searching for a comparable matter,
    your web site came up, it appears to be like great.
    I’ve bookmarked it in my google bookmarks.
    Hi there, simply was aware of your blog via Google, and
    located that it’s really informative. I’m going to watch out for brussels.
    I will appreciate for those who proceed this in future.

    A lot of folks can be benefited from your writing.

    Cheers!|
    I am curious to find out what blog system you have been using?
    I’m having some small security issues with my latest website and I’d like
    to find something more secure. Do you have any recommendations?|
    I’m extremely impressed with your writing skills and also with the layout
    on your weblog. Is this a paid theme or did you modify it yourself?
    Anyway keep up the nice quality writing, it’s rare to see a
    nice blog like this one these days.|
    I am really inspired along with your writing skills and
    also with the structure on your blog. Is that this a paid subject matter or did you customize
    it yourself? Anyway stay up the excellent high quality
    writing, it’s uncommon to peer a nice weblog like this one these days..|
    Hello, Neat post. There’s an issue with your site in internet explorer, could
    check this? IE nonetheless is the market leader and a huge portion of other people will pass over your wonderful writing because of this problem.|
    I’m not sure where you’re getting your info, but great topic.
    I needs to spend some time learning much more or understanding more.

    Thanks for magnificent info I was looking for this info for my mission.|
    Hi, i think that i saw you visited my blog so i came to “return the favor”.I am attempting to find things to
    enhance my web site!I suppose its ok to use some of \

  2. Right here is the perfect webpage for anybody who really wants to understand this topic.
    You understand a whole lot its almost hard to argue with you (not
    that I personally will need to…HaHa). You certainly put a fresh spin on a subject which has been discussed
    for years. Wonderful stuff, just great!

  3. Hey there! Would you mind if I share your blog with my facebook group?
    There’s a lot of people that I think would really enjoy your
    content. Please let me know. Thanks

  4. Attractive section of content. I just stumbled upon your site and in accession capital to assert that I get in fact enjoyed account your blog
    posts. Anyway I will be subscribing to your augment and even I achievement you access consistently fast.

  5. It is not my first time to pay a visit this web page, i am visiting this web page dailly and take fastidious data from here every day.

  6. I was suggested this web site by my cousin. I am not sure whether this
    post is written by him as nobody else know such detailed about my difficulty.

    You’re wonderful! Thanks!

Leave a Reply to Weldon Cancel reply

Your email address will not be published. Required fields are marked *