LinuxQuestions.org
Help answer threads with 0 replies.
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 08-02-2004, 03:49 AM   #1
virendratp
LQ Newbie
 
Registered: Jul 2004
Posts: 20

Rep: Reputation: 0
dhcpd and dhclient


Is it possible to run dhcpd and dhclient from the same machine? I am trying to run them on Red Hat 9.0 (Shrike) and its giving me some funny results like messing my routing table and others.
Any help wud be appreciated.

Thanks.
 
Old 08-02-2004, 03:56 AM   #2
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
if your computer that you intend on putting dhcpd on is part of an already setup network that has another dhcp server on it you are going to cause massive problems. There is, on the other hand, no reason why you shouldnt be able to have both dhcpd and dhclient on the same linux machine. However, you would really need to have a static ip for the dhcp server.
 
Old 08-02-2004, 04:03 AM   #3
virendratp
LQ Newbie
 
Registered: Jul 2004
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks Frustin. I dont have any other machine on the network . But my machine has three ethernet cards so I was trying to play around. The problem I am facing is, as soon as I run the dhclient from the eth1, eth0 being the dhcpd server, it changes the routing table for eg. the default route is deleted and changes made to some other route.
What should I do to avoid it? I would appreciate any help.
 
Old 08-02-2004, 04:17 AM   #4
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
give me some more details of what you say is changing. paste the files here. i think i know the problem you are having but i am not really one for giving out answers, i'd much rather you did the work and i told you where you were going wrong.
 
Old 08-02-2004, 04:25 AM   #5
virendratp
LQ Newbie
 
Registered: Jul 2004
Posts: 20

Original Poster
Rep: Reputation: 0
This is my initial routing table.
Destination Gateway Genmask Flags MSS Window irtt Iface
x.x.x.0 * 255.255.255.0 U 0 0 0 eth0
x.x.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default x.x.x.x 0.0.0.0 UG 0 0 0 eth0

But after I run dhclient eth1, my table changes its default and everything.
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
x.x.x.0 * 255.255.255.0 U 0 0 0 eth1
x.x.x.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default x.x.x.x 0.0.0.0 UG 0 0 0 eth1

and so if I unconfigure eth1, my table is truncated and I lose connectivity.

and how do i make the ip static for the dhcpd server, cos the ip address of the server is not changing.

Thanks.
 
Old 08-02-2004, 04:27 AM   #6
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
what about your network configuration files? have you told eth0 that it is static (and what ip it should use) and that eth1 is going to be using dhcp?
 
Old 08-02-2004, 04:31 AM   #7
virendratp
LQ Newbie
 
Registered: Jul 2004
Posts: 20

Original Poster
Rep: Reputation: 0
I did configure the eth0 that it is static: my ifcfg-eth0 script:

DEVICE=eth0
BOOTPROTO=static
BROADCAST=x.x.x.255
IPADDR=x.x.x.152
NETMASK=255.255.255.0
NETWORK=x.x.x.0
ONBOOT=yes

but for my ifcfg-eth1 script I wrote this:

DEVICE=eth1
BOOTPROTO=dynamic
BROADCAST=x.x.x.255
NETMASK=255.255.255.0
NETWORK=x.x.x.0
ONBOOT=no
TYPE=Ethernet

where do i specify that it has to use dhcpd server?

Thanks.
 
Old 08-02-2004, 04:34 AM   #8
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
you have a couple of lines in here that you dont need:

DEVICE=eth1
BOOTPROTO=dynamic
BROADCAST=x.x.x.255
NETMASK=255.255.255.0
NETWORK=x.x.x.0
ONBOOT=no
TYPE=Ethernet

to

DEVICE=eth1
BOOTPROTO=dynamic
ONBOOT=no
TYPE=Ethernet
 
Old 08-02-2004, 04:58 AM   #9
virendratp
LQ Newbie
 
Registered: Jul 2004
Posts: 20

Original Poster
Rep: Reputation: 0
Thanx Frustin. I did that.

Its working.. but there is a small problem which I dont think effects my system but one route which I had for some intermediate network is deleted i.e.
Now, the table is:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
x.x.x.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 x.x.x.1 0.0.0.0 UG 0 0 0 eth0

the last one being the router address.
the route that is deleted is
x.x.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0

which is different from the subnet address that I am using. what might be the reason?

Thanks for your help.

Last edited by virendratp; 08-02-2004 at 05:03 AM.
 
Old 08-02-2004, 05:01 AM   #10
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
domain name server = dns, do you have a dns server running as well? whats your /etc/resolv.conf (where the dns server info sits) say about it?
 
Old 08-02-2004, 05:07 AM   #11
virendratp
LQ Newbie
 
Registered: Jul 2004
Posts: 20

Original Poster
Rep: Reputation: 0
Hi Frustin,
I edited my last post. Thanx for your help. I corrected the dns name but one route is eliminated which doesnt affect my connectivity but also no IP address is allotted to eth1 but the ifconfig says its up and running but without ip address.
 
Old 08-02-2004, 05:25 AM   #12
virendratp
LQ Newbie
 
Registered: Jul 2004
Posts: 20

Original Poster
Rep: Reputation: 0
Hi,
I deleted my dhclient.leases file and start afresh. for the first client, it just deletes one of the route, but when i try to run dhclient on the next card, eth2, my default routing tables gets messed up. I dunno whether this is supposed to be the behavior but I am doing sth wrong. My final table is :

x.x.x.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
x.x.x.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
x.x.x.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 x.x.x.1 0.0.0.0 UG 0 0 0 eth1

I understand the first four entries but why is the last default route changes from eth0 to eth1?
Or is this is the way it works?
 
Old 08-02-2004, 06:15 AM   #13
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
is your ifcfg-eth2 script the same as the ifcfg-eth1 script?
 
Old 08-02-2004, 06:50 AM   #14
virendratp
LQ Newbie
 
Registered: Jul 2004
Posts: 20

Original Poster
Rep: Reputation: 0
yes. they r same. I was also going through the leases file and it shows that eth0 is also assigned the IP address
x.x.x.152 although i have declared it static.
 
Old 08-02-2004, 06:59 AM   #15
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
all the adapters should have different ip addresses. whats the result of ifconfig?
 
  


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 subnet declaration problems in dhcpd.conf vcrispo Linux - Networking 6 07-15-2005 10:32 AM
what if no dhclient pump or dhcpd? stabu Linux - Newbie 2 05-30-2005 04:23 PM
DHCPD startup failure, mdk 9.2, dhcpd v3.0.1rc11 fuzzyworm Linux - Networking 1 02-14-2004 03:58 AM
dhcpd.master or dhcpd.conf rickg Linux - Networking 0 04-11-2002 03:34 PM
dhclient helloworld Linux - Networking 2 03-06-2001 07:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:11 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration