LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-20-2002, 07:40 AM   #1
hath
LQ Newbie
 
Registered: Jan 2002
Location: Kiruna, Sweden
Distribution: Redhat 7.2
Posts: 6

Rep: Reputation: 0
Unhappy dhcpd server leases wont work :(


My dhcpd.conf file

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.5 192.168.0.20;
default-lease-time 86000;
max-lease-time 86000;
option routers 192.168.0.1;
# option ip-forwarding off;
option broadcast-address 192.168.0.255;
option domain-name-servers 195.54.122.194, 195.54.122.193, 192.168.0.1;
option domain-name "ju-jutsuka.net";
}
------------------------------------------------------------------------
the DNS is also what I will get from my ISPs dhcp-server
________________

My rc.local file
--<blah blah stuff before this>----
echo "startar DHCP servern"
dhcpd eth1
/sbin/route add -host 255.255.255.255 netmask 0.0.0.0 dev eth1
/etc/rc.d/init.d/dhcpd start
--<kick up my firewall...which allows ALL lan out>--
______________________________________________


Here is my problem now.
I can see with "ps ax" that dhcpd eth1 is up but it juuuust cant seem to lend out IPs
I have a dhcpd.leases in /etc

On my linux server I use eth0 with dhcp to my ISP, working fine. And ofcourse then I use eth1 to my Lan. eth1 got a static 192.168.0.1. Damned dhcpd... I want my other machines to be able to lend Ip's. Just for fun...if nothing else.

My default gw on my linux is my ISPs gw-addie. Have swedish bredbandsbolaget.

Internet -- (eth0/dhcp)rh7.2(eth1/192.168.0.1)--HUB--WinXP and so on
dhcp server on my eth1 ofcourse

I am so tired of this. Have got it to work twice before but since my reinstallment it just wont work.
Cant even get to see nothing in my logfile that anything try to lend an ip...sooo tired and frustrated. But I wont give up, refuse.

I know I must have missed any vital information to help you out lads but...I cant think of anything right now. Just give me a smack on the head if you lack any vital info!!!

Last edited by hath; 02-20-2002 at 07:48 AM.
 
Old 02-20-2002, 02:02 PM   #2
finegan
Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 57
Brilliant post. Great description of the problem.

In your /etc/rc.d/rc.local, you actually start the dhcpd server twice.

dhcpd eth1

and

/etc/rc.d/init.d/dhcpd start

do the same thing... actually, depending on how your .conf file works, the second line may try to start a broadcast on eth0 also.

This is probably best to just start from the bottom. First comment everything out of rc.local, or just copy the file elsewhere. Then reboot the machine and try everything one bit at a time, paying attention to the output of each call.

dhcpcd eth0 (to get the IP from the ISP)
ifconfig eth1 192.168.0.1 up (as defined in the router section)
dhcpd eth1
<---- Firewall stuff goes here ----->

That should work... is there something weird I don't know about as to why you're manually adding the route?

-Cheers,

Finegan
 
Old 02-21-2002, 01:51 AM   #3
hath
LQ Newbie
 
Registered: Jan 2002
Location: Kiruna, Sweden
Distribution: Redhat 7.2
Posts: 6

Original Poster
Rep: Reputation: 0
uhmm, got no explanation.

Since I am pretty new to Linux I just read howto's and faq about dhcpd. So without any further real understanding I just followed their steps, so to say.

So since my eth0 use dhcp to get ip from my ISP I will do a "dhcpd eth1" to make sure the dhcpd-server is for eth1 (lan), right?
Got more problems to, which makes me think I should reinstall. execvp (sshd) wont start in bootup (but that I can start in rc.local) plus that even if I use static IPs on my Lan-comps they just wont come out to the internet. Their gw is set to the servers eth1 - IP (lan), their DNS should point to my ISPs dns, right?
Anyway - using Linux and NOT knowing stuff is hell.
But worse than this, actually...is that Sweden lost against Belarus!!!!!
*siiiiigh*
 
Old 02-21-2002, 05:17 AM   #4
bbenz3
Member
 
Registered: Feb 2002
Location: Orlando
Distribution: Whatever I feel like at the time I install.
Posts: 284

Rep: Reputation: 30
I know how it feels to be a "newbie" to this stuff. I just started. Here is what I did to make mine work. I am using DHCPD server vs 2.0 I felt that 3.0 just had more stuff than I needed.

First question is after reinstall did you remember to reinstall the dhcp server?

#dhcpd.conf

subnet 192.168.168.0 netmask 255.255.255.0 {
range 192.168.168.10 192.168.168.200;
option routers 192.168.168.1; <-- this should be your ip of eth1
option subnet-mask 255.255.255.0;
option domain-name-servers xxx.xxx.xxx.xxx, yyy.yyy.yyy.yyy;
option domain-name "isp.com";
default-lease-time 600;
max-lease-time 7200;
}

I chose to put my startup at the bottom of the start section in my firewall script. I did this so that I would be sure that my NICs were loaded. I call my firewall script from the end of the start section in /etc/init.d/network (Redhat 7.x). I did this so that I made sure that everything was loaded for my network.

The way I start mine is by just calling:
dhcpd ethx
where ethx is your int NIC card.

As for setting up the sshd part I am assuming you are running the text based install. At the command line type "setup" and go under "System Services" and enable SSHD there.

As for getting to the Internet that can be a little more tricky but try this.
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
that will allow everything coming from the int lan to go out. You may need more than that as well though
here is the firewall script that I borrowed:
Look at raz's example

If you need any further help drop me a line or something.
I started with redhat 7.1 and then upgraded the kernel and upgraded iptables to 1.2.4 b/c of some security issues I heard about with some of the older vs.
goodluck
 
Old 02-21-2002, 05:21 PM   #5
finegan
Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 57
Quote:
Originally posted by hath
uhmm, got no explanation.

Since I am pretty new to Linux I just read howto's and faq about dhcpd. So without any further real understanding I just followed their steps, so to say.

So since my eth0 use dhcp to get ip from my ISP I will do a "dhcpd eth1" to make sure the dhcpd-server is for eth1 (lan), right?
Right. dhcpd is the server (listens on port 54(?) to hand out IP addresses) dhcpcd is the client (that request's them from whichever dhcp server, either the ISP or the one you are running).

Quote:
Originally posted by hath

Got more problems to, which makes me think I should reinstall. execvp (sshd) wont start in bootup
very weird. Bbenz3's information will probably knock that out. I don't fiddle with RedHat that much anymore.


Quote:
Originally posted by hath
(but that I can start in rc.local) plus that even if I use static IPs on my Lan-comps they just wont come out to the internet. Their gw is set to the servers eth1 - IP (lan), their DNS should point to my ISPs dns, right?
Correct, both times... What is your firewall rules-set? You may want to put in the "forward everything" line that Bbenz3 posted just to see if the problem is with the firewall, or has something to do with the lan. If they have IPs on your subnet: 192.168.0.0, and if they have the IPs of name-servers and the IP of your machine as the gateway: 192.168.0.1, then its somewhere in the cabling.

In your first post, unless you did it somewhere other than rc.local, there is no IP address assigned to eth1. In order for dhcpd to start correctly, eth1 will have to be on the same subnet as is listed in the dhcpd.conf file. To do this:

ifconfig eth1 192.168.0.1 up

Quote:
Originally posted by hath
Anyway - using Linux and NOT knowing stuff is hell. But worse than this, actually...is that Sweden lost against Belarus!!!!!
*siiiiigh*
Yeah, but its soooo much fun because unlike other *cough* *cough* operating systems, you can actually FIX it!

Cheers,

Finegan
 
  


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
DHCPD no free leases HiOctane21 Linux - Networking 6 10-02-2013 11:21 PM
DHCPD Has No free leases? FishGills Linux - Networking 7 01-24-2009 06:49 PM
find out all free leases from dhcpd saavik Linux - Networking 2 07-27-2005 02:03 AM
DHCPD problem - no free leases ms_lyon Linux - Networking 3 02-26-2003 10:52 AM
dhcpd server not letting go of leases Jase Linux - Networking 10 01-17-2002 05:57 PM


All times are GMT -5. The time now is 11:18 PM.

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