Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
DHCP does not send hostname
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
saki
n00b
n00b


Joined: 24 Aug 2002
Posts: 6

PostPosted: Sun Aug 25, 2002 4:23 pm    Post subject: DHCP does not send hostname Reply with quote

I am really sorry to ask two questions in two days - but I have searched the docs and archives and can't find an answer to this.

I have a home network using a DSL modem/router for DHCP and DNS. My main box is currently SuSE and when I tell it to use DHCP it gets an IP address from the router and communicates the hostname to the router. I can therefore ping that box from itself and from other boxes on the network. SuSE uses dhclient, which does not appear to be available under Gentoo - I don't know if this is relevant though.

My test installation of Gentoo is on a spare machine. I have /etc/hostname "foo" and /etc/conf.d/net has iface_eth0="dhcp" and gateway="10.0.0.138" (ie my router). DHCP works to the extent that an IP address is allocated, but the hostname is never communicated to the router. I can't ping "foo" and nor can other boxes on the network see it, - I just get "unknown host".

As it happens, the box in question in dual-boot Win 98. If I fire up Win 98 it sends the "foo" name to the modem/router and this persists if I then re-boot Gentoo.

So ... it seems that SuSE and Win98 communicate the hostname to the modem/router, but Gentoo does not. Am I missing something?

Sorry for the lengthy post .. maybe it should be in a different forum, but I am such a newbie at Gentoo that I thought I should start here.

Thanks,

Saki
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Sun Aug 25, 2002 5:07 pm    Post subject: Re: DHCP does not send hostname Reply with quote

edit your /etc/conf.d/net file and look for the line similar to:

Code:
#dhcpcd_eth0="..."

uncomment that line and change it to read:
Code:
dhcpcd_eth0="-h <yourhostname>"


and that will pass the correct hostname to your router. man dhcpcd for more info.

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
saki
n00b
n00b


Joined: 24 Aug 2002
Posts: 6

PostPosted: Sun Aug 25, 2002 6:28 pm    Post subject: Reply with quote

Thank-you Kurt.

I had, in fact, already read man dhcpcd and tried the -h <hostname> option, but it had not worked. However, when I tried it before I also used dhcpd -k to stop the daemon then restarted. After reading your post I decided to try again, and to reboot after editing /etc/conf.d/net. It seems that the reboot was necessary because it is working now. I suppose that there is some lower-level network restart command which I could have given to avoid the reboot - but I can work that out later.

Thanks again,

Saki
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Sun Aug 25, 2002 6:34 pm    Post subject: Reply with quote

saki wrote:
I suppose that there is some lower-level network restart command which I could have given to avoid the reboot - but I can work that out later.


You can use:

Code:
/etc/init.d/net.eth0 restart


--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
saki
n00b
n00b


Joined: 24 Aug 2002
Posts: 6

PostPosted: Sun Aug 25, 2002 6:55 pm    Post subject: Reply with quote

Thanks ... two days into Gentoo and my education is proceeding nicely. Next task is to see if I can (1) install my old VMware 2.0.4 stuff and (2) set up a faxgetty and run Hylafax / SuSEfax. Watch this space ....... :D

Regards,

Saki
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20589

PostPosted: Sun Aug 25, 2002 7:19 pm    Post subject: Reply with quote

saki wrote:
Next task is to see if I can (1) install my old VMware 2.0.4 stuff and (2) set up a faxgetty and run Hylafax / SuSEfax. Watch this space ....... :D
Actually, if you have problems not related to this thread topic, please give each problem a seperate thread in an appropriate forum. After you search for the answer first :D
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
saki
n00b
n00b


Joined: 24 Aug 2002
Posts: 6

PostPosted: Sun Aug 25, 2002 7:31 pm    Post subject: Reply with quote

Understood .. I will, of course, observe the protocol. With a little luck I won't need to ask in any case.

Regards,

Saki
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum