Networking Forums

Networking Forums > Computer Networking > Linux Networking > Linux DHCP Client will not collect IP but can see other hosts :-(

Reply
Thread Tools Display Modes

Linux DHCP Client will not collect IP but can see other hosts :-(

 
 
Lee Farrant
Guest
Posts: n/a

 
      11-18-2003, 10:44 PM
I have been trying to configure RedHat 7.2 as a DHCP client to collect
an IP address from a Windows DHCP server at work. I must be nearly
done because my linux box can see other services on the network and
the primary and secondary ip addresses got populated automatically. I
can also get on the Internet.

The only thing I cannot do is make my Linux client collect an IP
address. My firewall is now switched off to rule that out.

In my hosts file I have

order bind, hosts

so it tries to collect the IP address then use the hosts file.

Thanks

Lee
 
Reply With Quote
 
 
 
 
David Efflandt
Guest
Posts: n/a

 
      11-19-2003, 12:37 AM
On 18 Nov 2003 15:44:51 -0800, Lee Farrant <(E-Mail Removed)> wrote:
> I have been trying to configure RedHat 7.2 as a DHCP client to collect
> an IP address from a Windows DHCP server at work. I must be nearly
> done because my linux box can see other services on the network and
> the primary and secondary ip addresses got populated automatically. I
> can also get on the Internet.


What do you mean collect? Are you using dhcpcd or pump? If you get
nameservers automatically and can communicate on the network, what does
'ifconfig' show for your IP (and 'route -n' for routing)?

> The only thing I cannot do is make my Linux client collect an IP
> address. My firewall is now switched off to rule that out.
>
> In my hosts file I have


Wrong file (see: man hosts).

> order bind, hosts
>
> so it tries to collect the IP address then use the hosts file.


Not sure why you would want to do that. The usual "order hosts, bind"
(which I always use for static or dynamic IP) in /etc/host.conf allows me
to override DNS with /etc/hosts entries.

If bind was first it would screw me up because my box has a public
hostname which points to a public IP, and that IP is sometimes not
connected, or not on my box (if behind NAT). So I use hosts first for
/etc/hosts to point my hostname to an IP on my box so my box can find
itself (the public can still find me through DNS).

--
David Efflandt - All spam ignored http://www.de-srv.com/
 
Reply With Quote
 
Ivor Cave
Guest
Posts: n/a

 
      11-19-2003, 05:43 AM
Lee Farrant wrote:
> I have been trying to configure RedHat 7.2 as a DHCP client to collect
> an IP address from a Windows DHCP server at work. I must be nearly
> done because my linux box can see other services on the network and
> the primary and secondary ip addresses got populated automatically. I
> can also get on the Internet.


If you get internet and can see sevices from other machines
on the network you must have an ip from somewhere.
Try ifconfig eth0 as root.

Ivor Cave

 
Reply With Quote
 
Lee Farrant
Guest
Posts: n/a

 
      11-19-2003, 09:34 AM
What do you mean collect?
Lee> Receive a IP address from the DHCP windows server from work.

Are you using dhcpcd or pump?
Lee> DHCP

If you get nameservers automatically and can communicate on the
network, what does 'ifconfig' show for your IP (and 'route -n' for
routing)?
Lee> ifconfig shows good IPs addresses for the primary and second DNS
servers ok. i will do the route -n when I get home tonight.

Wrong file (see: man hosts).
Lee> OK sorry, am a newbie.


Not sure why you would want to do that. The usual "order hosts, bind"
(which I always use for static or dynamic IP) in /etc/host.conf allows
me
to override DNS with /etc/hosts entries.

Lee> The reason I did this was because the only way I could get my box
on the network was to put my hostname in hosts. But I read somewhere
that the hosts file will overide DHCP so I thought that might be my
problem but I was wrong.


If bind was first it would screw me up because my box has a public
hostname which points to a public IP, and that IP is sometimes not
connected, or not on my box (if behind NAT). So I use hosts first for
/etc/hosts to point my hostname to an IP on my box so my box can find
itself (the public can still find me through DNS).

Lee>My situation is that I want to connect my Linux server (DHCP
client) to my work network. My work network has windows DHCP servers.
My IT department said just set the Linux box up to use DHCP. So
everything works apart from it getting a dynamic IP address from work
because I can get on the network, see other boxes and go on the
Internet. I have my host name in the hosts file against the 127 ip
address because if I remove my hostname from the hosts file it won't
go on the network at all.


Lee
 
Reply With Quote
 
Lee Farrant
Guest
Posts: n/a

 
      11-19-2003, 02:52 PM
Thanks for your reply Ivor.

My IP address is what ever I assign in the hosts file. at the moment
its 127.0.0.1 when I ping myself.

Lee



Ivor Cave <(E-Mail Removed)> wrote in message news:<7ofr81-(E-Mail Removed)>...
> Lee Farrant wrote:
> > I have been trying to configure RedHat 7.2 as a DHCP client to collect
> > an IP address from a Windows DHCP server at work. I must be nearly
> > done because my linux box can see other services on the network and
> > the primary and secondary ip addresses got populated automatically. I
> > can also get on the Internet.

>
> If you get internet and can see sevices from other machines
> on the network you must have an ip from somewhere.
> Try ifconfig eth0 as root.
>
> Ivor Cave

 
Reply With Quote
 
Ivor Cave
Guest
Posts: n/a

 
      11-19-2003, 05:32 PM
Lee Farrant wrote:
> Thanks for your reply Ivor.
>
> My IP address is what ever I assign in the hosts file. at the moment
> its 127.0.0.1 when I ping myself.
>
> Lee
>


You must have another IP address as you wouldn't get internet or
see anything from the network if you only had the loopback address.
Does ifconfig eth0 show 127.0.0.1?
ping will show the loopback address as its in the hosts file.
everyones IP will show loopback when pinging themselves unless
they have a static ip and have it listed in hosts.
In most cases you only need the loopback address in hosts for yourself.
And add names and IP addresses for other machines on network if needed.

Ivor Cave

 
Reply With Quote
 
David Efflandt
Guest
Posts: n/a

 
      11-19-2003, 06:36 PM
On 19 Nov 2003 07:52:14 -0800, Lee Farrant <(E-Mail Removed)> wrote:
> Thanks for your reply Ivor.
>
> My IP address is what ever I assign in the hosts file. at the moment
> its 127.0.0.1 when I ping myself.


It is generally a bad idea to tamper with the 127.0.0.1 line in
/etc/hosts, because that should always be localhost (literally, not
figuratively). If you need an IP for your hostname, and have no static
interface for it, assign your hostname to 127.0.0.2.

I do not think you have said yet what ifconfig shows for your eth0.

> Ivor Cave <(E-Mail Removed)> wrote in message news:<7ofr81-(E-Mail Removed)>...
>> Lee Farrant wrote:
>> > I have been trying to configure RedHat 7.2 as a DHCP client to collect
>> > an IP address from a Windows DHCP server at work. I must be nearly
>> > done because my linux box can see other services on the network and
>> > the primary and secondary ip addresses got populated automatically. I
>> > can also get on the Internet.

>>
>> If you get internet and can see sevices from other machines
>> on the network you must have an ip from somewhere.
>> Try ifconfig eth0 as root.
>>
>> Ivor Cave



--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
 
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
How to setup /etc/hosts to lookup DHCP client in the same subnet Wonder Linux Networking 4 09-12-2006 09:22 PM
dhcp client not work how expected on my Suse linux 8.1 dundo@libero.it Linux Networking 1 11-16-2005 03:25 PM
DHCP connection from win98SE client to Suse linux server weverhuis Linux Networking 1 11-15-2005 08:44 PM
Linux DHCP Client ztapori@yahoo.com Linux Networking 5 07-26-2005 04:33 PM
newbie dhcp problems - linux server windows client michael melling Linux Networking 1 08-05-2004 02:25 PM



1 2 3 4 5 6 7 8 9 10 11