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? |
Re: Setting up a DHCP server
Quote:
|
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) |
Thanks guys!
I really appreciate your help! |
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? |
by using the mac address of the hosts... for example:
Code:
host linux { |
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? |
Quote:
|
Quote:
1 - make sure there isn't anything already bound to port 67/UDP: Code:
netstat -a | grep bootps Code:
netstat -an | grep ":67" Code:
win32sux@darkstar:~$ netstat -a | grep bootps Code:
touch /var/state/dhcp/dhcpd.leases Code:
ddns-update-style none; 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... |
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:
|
All times are GMT -5. The time now is 04:04 AM. |