LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-23-2005, 03:16 PM   #1
MasterCephus
LQ Newbie
 
Registered: Jul 2004
Posts: 28

Rep: Reputation: 15
Setting up a DHCP server


Hey guys, I am running Fedora Core 3

I have a simple home network, with a Tivo box (wireless), XP Pro box, laptop running XP Pro (wireless), and a linux server.

I am wanting to turn off DHCP on my router and use my linux box.

What I was wondering if there was a visual tool to configure it with? I would like to have all my machines have static IP addresses, and only allow them on the network.

Anyone know of a tool that I could use, or should I just modify the conf file?
 
Old 06-23-2005, 03:23 PM   #2
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Re: Setting up a DHCP server

Quote:
Originally posted by MasterCephus
I was wondering if there was a visual tool to configure it with?
there's webmin, but configuring a DHCP is super easy... you just need to edit the /etc/dhcpd.conf file...
 
Old 06-23-2005, 03:51 PM   #3
chatsubo42
LQ Newbie
 
Registered: Feb 2005
Posts: 12

Rep: Reputation: 0
this sort of answers your question...

hehe...

It's not that hard to setup without a gui..

install your packages.

#file /etc/dhcpd.conf

option domain-name "your_domain.local"; //replace your_domain with your local domain name if you want..
option domain-name-servers 192.168.xxx.1;//replace the xx with your network.. 1 or 10 or 156 or what ever)
option routers 192.168.xxx.1; //the ip of your internet gateway. (prolly your router that you stopped dhcp on)
ddns-update-style interim; //if you dynamic dns or some other dns system
ignore client-updates; //forgot what tis is for LOL
default-lease-time 14400; //this is a value in seconds: when you want your leases to expire?
subnet 192.168.xxx.0 netmask 255.255.255.0 { //again xxx is last octet of your subnet
option routers 192.168.xxx.1; //this could be a router defined for each subnet...
//you don't need it if you have a default one above
option subnet-mask 255.255.255.0; //subnet mask for you new network
option domain-name-servers 192.168.xxx.1; //what ever your name servers are..
//get them from resolve.conf on a working machine.
option ip-forwarding off; //hehe forgot what this was for too.. LOL
range 192.168.xxx.100 192.168.xxx.150; //this defines your ip scope. (in this case 100 to 150)
//from what ip to what ip will your machine give out?
default-lease-time 21600; //again lease data specific to this subnet
max-lease-time 43200;
}

if you have 2 interfaces you want to specify starting this only on the interface you want it to run on.. (You don't want to broadcase dhcp services to the internet. So figure out which interface is you LAN and which is WAN)
You can start dhcpd by just calling it with the command "dhcpd eth0" (to start the daemon listening on eth0) or with the "/etc/rc.d/init.d/dhcpd start" if you installed it with the redhat packages. (course could just start it and firewall the WAN port but thats a hole nother thread LOL)

*** but if you are into the GUI thing I don't think redhat is your d-stro ( most of their tools are pretty weak compared to Suse [Just My Opinion Don't flame me ... ;P] )

Suse 9.2 or .3 has a fantastic GUI for DHCP (and apache, dns, and everything else under the sun. 9.3 is better IMHO)
 
Old 06-23-2005, 05:26 PM   #4
MasterCephus
LQ Newbie
 
Registered: Jul 2004
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks guys!

I really appreciate your help!
 
Old 06-25-2005, 10:27 AM   #5
MasterCephus
LQ Newbie
 
Registered: Jul 2004
Posts: 28

Original Poster
Rep: Reputation: 15
one more question...

what if I have a couple of machines that I want to have certain IPs.

Say I want:

linux box to be 192.168.1.100
Desktop XP Pro to be 192.168.1.101
Tivo machine to be: 192.168.1.102

etc.


How would I express that in the .conf file?
 
Old 06-25-2005, 10:41 AM   #6
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
by using the mac address of the hosts... for example:

Code:
host linux {
  hardware ethernet xx:xx:xx:xx:xx:xx;
  fixed-address 192.168.1.100;
}

host windoze {
  hardware ethernet xx:xx:xx:xx:xx:xx;
  fixed-address 192.168.1.101;
}

host tivo {
  hardware ethernet xx:xx:xx:xx:xx:xx;
  fixed-address 192.168.1.102;
}

Last edited by win32sux; 06-25-2005 at 10:43 AM.
 
Old 06-25-2005, 10:58 PM   #7
MasterCephus
LQ Newbie
 
Registered: Jul 2004
Posts: 28

Original Poster
Rep: Reputation: 15
I keep getting this error:
------
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
Listening on LPF/eth0/00:b0:d0:76:99:19/192.168.1/24
Sending on LPF/eth0/00:b0:d0:76:99:19/192.168.1/24
Can't bind to dhcp address: Permission denied
Please make sure there is no other dhcp server
running and that there's no entry for dhcp or
bootp in /etc/inetd.conf. Also make sure you
are not running HP JetAdmin software, which
includes a bootp server.
-------------

I have turned off DHCP on my router (using a linksys WRT54G)...

My dhcpd.conf looks like:
---------
#file /etc/dhcpd.conf
option domain-name "elliott.local";
option domain-name-servers 192.168.1.1;
option routers 192.168.1.1;
ddns-update-style interim;
ignore client-updates;
default-lease-time 14400;
subnet 192.168.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.1;
option ip-forwarding off;
range 192.168.1.100 192.168.1.115;
default-lease-time 21600;
max-lease-time 43200;
}
host desktop {
hardware ethernet xx:xx:x:x:x:x;
fixed-address 192.168.1.102;
}
host thor {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address 192.168.1.101;
}
----------

any ideas on why the error?
 
Old 06-25-2005, 11:04 PM   #8
Harlin
Member
 
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316

Rep: Reputation: 30
Quote:
Originally posted by MasterCephus
one more question...

what if I have a couple of machines that I want to have certain IPs.

Say I want:

linux box to be 192.168.1.100
Desktop XP Pro to be 192.168.1.101
Tivo machine to be: 192.168.1.102

etc.


How would I express that in the .conf file?
Sounds like you really just need to set these separate boxes up with static IP addressing instead of dhcp.
 
Old 06-26-2005, 07:30 AM   #9
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally posted by MasterCephus
Can't bind to dhcp address: Permission denied
okay, time to start troubleshooting... here's a few steps you can run through:

1 - make sure there isn't anything already bound to port 67/UDP:
Code:
netstat -a | grep bootps
or maybe:
Code:
netstat -an | grep ":67"
if you DID have something it would look like this:
Code:
win32sux@darkstar:~$ netstat -a | grep bootps
udp        0      0 *:bootps                *:*                                 
win32sux@darkstar:~$ netstat -an | grep ":67"
udp        0      0 0.0.0.0:67              0.0.0.0:*
2 - make sure you have a leases file created... usually you need to create an empty lease file on your own before you start dhcpd for the first time AFAIK... on slackware the file to create is /var/state/dhcp/dhcpd.leases but i'm not sure which it is on fedora... to create the file you'd do something like:
Code:
touch /var/state/dhcp/dhcpd.leases
3 - try using a simpler (known-good) dhcpd.conf just as a test to determine if their might be an issue with your current conf file:
Code:
ddns-update-style none;
subnet 192.168.1.1 netmask 255.255.255.0 {
        option routers 192.168.1.1;
        option subnet-mask 255.255.255.0;
        option domain-name "elliott.lan";
        option domain-name-servers 192.168.1.1;
        option broadcast-address 192.168.1.255;
        range 192.168.1.100 192.168.3.115;
        default-lease-time 43200;
        max-lease-time 86400;
        }
4 - consider if this might be an "selinux" issue... i've never used selinux but i know fedora includes selinux so maybe it's security features are preventing you from binding properly and must be configured accordingly... this is just a wild guess, take it with a a huge grain of salt (i don't even know if selinux does this kinda thing)...

BTW, you probably aren't missing your leases file (as you would have gotten a leases error instead AFAIK) but i left that step in there cuz it's a common thing and it might help someone else who runs into this thread...


Last edited by win32sux; 06-26-2005 at 07:34 AM.
 
Old 06-26-2005, 07:41 AM   #10
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
i just found some info that confirmed to me that selinux does in fact do this kinda thing, so if you are using selinux make sure you configure it to allow the dhcp daemon:
Quote:
SELinux has controls for port binding, meaning it is able to allow or deny port binding requests based on security labels.
http://www.redhat.com/docs/manuals/e...tion-0021.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up a DHCP server blazted Linux - Newbie 6 01-28-2005 03:10 AM
setting up dhcp server? help please!!!! lumbrjackedpcj Linux - Networking 7 10-06-2004 11:01 PM
Setting up a DHCP server w/ the server on a wireless network Ionexchange Linux - Wireless Networking 0 05-08-2004 10:56 AM
Setting up a dhcp server PlatinumRik Linux - Networking 4 05-22-2003 01:50 AM
Setting up a DHCP Server bselzler Linux - Networking 2 08-07-2001 04:28 AM


All times are GMT -5. The time now is 12:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration