Networking Forums

Networking Forums > Computer Networking > Linux Networking > dhclient and dhcpd on same machine

Reply
Thread Tools Display Modes

dhclient and dhcpd on same machine

 
 
Captain Dondo
Guest
Posts: n/a

 
      07-22-2003, 12:47 AM
I can't seem to be able to figure this out.

I have a machine that both acts as a dhcp server for my internal network
on eth0, and has a cable modem that gets its IP via dhcp.

If I leave dhcpd running, I can't any IP address from my ISP on the cable
modem if (eth1).

If I kill dhcpd, I can get an IP address from the cable modem without
any problems.

So, I'm guessing that there is some conflict between dhclient and dhcpd.
I've read the man pages and the docs, but nothing jumps out at me -
something like "listen on" as bind uses. What I really want is for dhcpd
to only listen on eth0, and not eth1. I'm not really sure how this
interferes - I see DHCP DISCOVER going out eth1 and nothing coming back,
but as soon as I kill dhcpd DHCP DISCOVER works fine....

Also, I really don't want dhclient to mess with the /etc/resolv.conf file.
Actually, what I want is for all DNS queries to go to my DNS server, and
then, if my DNS server is down, to my ISP's DNS servers.

Any docs on how to do this?

-Dondo
 
Reply With Quote
 
 
 
 
Whoever
Guest
Posts: n/a

 
      07-22-2003, 02:08 AM
On Tue, 22 Jul 2003 (E-Mail Removed) wrote:

> |So, I'm guessing that there is some conflict between dhclient and dhcpd.
> |I've read the man pages and the docs, but nothing jumps out at me -
> |something like "listen on" as bind uses. What I really want is for dhcpd
> |to only listen on eth0, and not eth1. I'm not really sure how this
> |interferes - I see DHCP DISCOVER going out eth1 and nothing coming back,
> |but as soon as I kill dhcpd DHCP DISCOVER works fine....
>
> Just specify the interface on the command line: dhcpd eth0
> Same for dhclient by the way.
>
> |Also, I really don't want dhclient to mess with the /etc/resolv.conf file.
> | Actually, what I want is for all DNS queries to go to my DNS server, and
> |then, if my DNS server is down, to my ISP's DNS servers.
>
> dhclient runs a shell script called dhclient-script (location depends on
> your distro) when it gets a lease or renewal. In there there are some
> lines to update resolv.conf. What you want to do is study those lines
> and figure out how to disable the update. There may even be a variable
> you set in your system config to say don't update resolv.conf, again
> depends on your distro.


While this can be made to work, if the OP had cared to RTFM, he would find
that dhclient has a config file in which one can override the values
received from the DHCP server. A much easier way to achieve his objective!

>


 
Reply With Quote
 
tcvcbb@vqgjyo.com.ps
Guest
Posts: n/a

 
      07-22-2003, 04:08 AM
|> dhclient runs a shell script called dhclient-script (location depends on
|> your distro) when it gets a lease or renewal. In there there are some
|> lines to update resolv.conf. What you want to do is study those lines
|> and figure out how to disable the update. There may even be a variable
|> you set in your system config to say don't update resolv.conf, again
|> depends on your distro.
|
|While this can be made to work, if the OP had cared to RTFM, he would find
|that dhclient has a config file in which one can override the values
|received from the DHCP server. A much easier way to achieve his objective!

What is easier is distro dependent. For example my distro has these
lines in /sbin/dhclient-script:

make_resolv_conf() {
# first, look if we are allowed to modify resolv.conf:
eval `grep "^MODIFY_RESOLV_CONF_DYNAMICALLY=" /etc/sysconfig/network/config`
eval `grep "^DHCLIENT_MODIFY_RESOLV_CONF=" /etc/sysconfig/network/dhcp`
....

So it's just a matter of setting the variable in
/etc/sysconfig/network/dhcp. In fact all the dhclient tweaks can be done
from this file in this distro. You want to do it there because it's
hooked to the GUI config system and if you edit /etc/dhclient.conf
unnecessarily, it gets out of sync and may cause confusion later. That's
why it's worthwhile to investigate how dhclient is controlled in your
(the OP's) own situation.
--

 
Reply With Quote
 
Captain Dondo
Guest
Posts: n/a

 
      07-22-2003, 10:25 AM
On Tue, 22 Jul 2003 02:08:50 +0000, Whoever wrote:


> While this can be made to work, if the OP had cared to RTFM, he would
> find that dhclient has a config file in which one can override the
> values received from the DHCP server. A much easier way to achieve his
> objective!
>
>

Well, I did RTFM - but nothing came out and jumped out at me. As it turns
out, on my distro - RH8 - there is no default dhclient.conf, and what I
need to do could probably not be set from it anyway, as I don't want to
*override* the options - I want my own DNS server to be first, followed by
the DHCP-assigned DNS servers.

I ended up editing dhclient-script to add the required stuff, and also to
run my firewall script every time the IP changes.

pre-edit /etc/resolv.conf:

[yan@hydra yan]$ cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search hargray.net
nameserver 64.53.6.211
nameserver 204.116.57.2

post-edit /etc/resolv.conf:

[root@hydra yan]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
order hosts, bind
search seiner.lan
nameserver 192.168.128.1
nameserver 64.53.6.211
nameserver 204.116.57.2

I did miss the command-line interface for dhcpd, which had to be set in
/etc/sysconfig/dhcpd.

Thanks,

-Dondo

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
firewall for dhclient hakim Linux Networking 2 07-26-2005 09:57 PM
dhclient seems very broken, don't know why. inquirydog Linux Networking 0 07-29-2004 11:10 PM
dhclient blues Zenon Panoussis Linux Networking 9 07-23-2004 04:09 AM
dhclient question tom mccarthy Linux Networking 5 12-18-2003 05:52 PM
dhcpd: Assigning address to dual boot machine Todd Aiken Linux Networking 0 08-10-2003 05:31 AM



1 2 3 4 5 6 7 8 9 10 11