View previous topic :: View next topic |
Author |
Message |
qxn74 n00b
Joined: 30 Jan 2007 Posts: 10
|
Posted: Tue Jan 30, 2007 4:29 am Post subject: How can i install DHCP client without a network connection? |
|
|
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 |
|
|
Wizumwalt Guru
Joined: 20 Aug 2006 Posts: 547
|
Posted: Tue Jan 30, 2007 5:02 am Post subject: |
|
|
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 |
|
|
DrAgOnTuX Apprentice
Joined: 22 Aug 2006 Posts: 176 Location: Switzerland
|
Posted: Tue Jan 30, 2007 5:43 am Post subject: Re: How can i install DHCP client without a network connecti |
|
|
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.
|
restart net.eth0 |
|
Back to top |
|
|
defenderBG l33t
Joined: 20 Jun 2006 Posts: 817
|
Posted: Tue Jan 30, 2007 1:07 pm Post subject: |
|
|
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 |
|
|
StruBoy n00b
Joined: 28 Jan 2007 Posts: 7
|
Posted: Wed Jan 31, 2007 5:53 am Post subject: |
|
|
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 |
|
|
|