Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How can i install DHCP client without a network connection?
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
qxn74
n00b
n00b


Joined: 30 Jan 2007
Posts: 10

PostPosted: Tue Jan 30, 2007 4:29 am    Post subject: How can i install DHCP client without a network connection? Reply with quote

I just installed gentoo 2006.1 with networkless option

and tried the following later:

/etc/init.d/net.eth0 start

output says no DHCP client installed. How can i install (or emerge) it with out a network connection? Or maybe there is a way to connect the network without DHCP client.

any suggestion
Thanks.

Sean
Back to top
View user's profile Send private message
Wizumwalt
Guru
Guru


Joined: 20 Aug 2006
Posts: 547

PostPosted: Tue Jan 30, 2007 5:02 am    Post subject: Reply with quote

Not sure I understand you but, follow this guide (your probably concerned with the options towards the end).

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=3

And you can probably just turn your dhcp server off (if it's running).

/etc/init.d/dhcpd stop

You also might want to fix your /etc/conf.d/net file.
Back to top
View user's profile Send private message
DrAgOnTuX
Apprentice
Apprentice


Joined: 22 Aug 2006
Posts: 176
Location: Switzerland

PostPosted: Tue Jan 30, 2007 5:43 am    Post subject: Re: How can i install DHCP client without a network connecti Reply with quote

qxn74 wrote:
I just installed gentoo 2006.1 with networkless option

and tried the following later:

/etc/init.d/net.eth0 start

output says no DHCP client installed. How can i install (or emerge) it with out a network connection? Or maybe there is a way to connect the network without DHCP client.

any suggestion
Thanks.

Sean


Set a fix IP:
GentooDocumentation wrote:

Your IP address 192.168.0.2
Netmask 255.255.255.0
Broadcast 192.168.0.255
Gateway 192.168.0.1
Nameserver(s) 195.130.130.5, 195.130.130.133

Using ifconfig and route

Setting up your network consists of three steps. First we assign ourselves an IP address using ifconfig. Then we set up routing to the gateway using route. Then we finish up by placing the nameserver IPs in /etc/resolv.conf.

To assign an IP address, you will need your IP address, broadcast address and netmask. Then execute the following command, substituting ${IP_ADDR} with your IP address, ${BROADCAST} with your broadcast address and ${NETMASK} with your netmask:

Code Listing 20: Using ifconfig

# ifconfig eth0 ${IP_ADDR} broadcast ${BROADCAST} netmask ${NETMASK} up

Now set up routing using route. Substitute ${GATEWAY} with your gateway IP address:

Code Listing 21: Using route

# route add default gw ${GATEWAY}

Now open /etc/resolv.conf with your favorite editor (in our example, we use nano):

Code Listing 22: Creating /etc/resolv.conf

# nano -w /etc/resolv.conf

Now fill in your nameserver(s) using the following as a template. Make sure you substitute ${NAMESERVER1} and ${NAMESERVER2} with the appropriate nameserver addresses:

Code Listing 23: /etc/resolv.conf template

nameserver ${NAMESERVER1}
nameserver ${NAMESERVER2}

That's it. Now test your network by pinging some Internet server (like Google). If this works, congratulations then.
Code:
emerge -av dhcpcd

restart net.eth0
Back to top
View user's profile Send private message
defenderBG
l33t
l33t


Joined: 20 Jun 2006
Posts: 817

PostPosted: Tue Jan 30, 2007 1:07 pm    Post subject: Reply with quote

that would work if your ip is 192.168.0.2 etc...
if u want to be sure, that it will work, than put the install cd in your computer, mount it (for example to /mnt/cdrom/)

on the disc there schould be a directory distfiles/ probably in /mnt/cdrom/etc/portage/
go there and:
cp dhcpcd* /etc/portage/distfiles/
then u can emerge it with:
emerge --nodeps dhcpcd
Back to top
View user's profile Send private message
StruBoy
n00b
n00b


Joined: 28 Jan 2007
Posts: 7

PostPosted: Wed Jan 31, 2007 5:53 am    Post subject: Reply with quote

Another option is to do:

Code:
emerge --fetchonly --pretend dhcpcd 2> ~/somefile


Then take the output (each file will be listed multiple times, once for each mirror) and fetch the files through some other method and place them in /usr/portage/distfiles.

You can then emerge dhcpcd with out a network connection.
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