1 |
On Fri, 06 Jan 2006 08:53:53 +0100, Sergio Polini wrote: |
2 |
|
3 |
> I can't understand how to ask dhcp for a static address. I've read |
4 |
> /etc/conf.d/net.example, but using |
5 |
> |
6 |
> config_eth0=( <IPaddress> netmask <netmask> brd <broadcast>) |
7 |
> |
8 |
> in /etc/conf.d/net configures my network interface _instead of_ asking |
9 |
> dhcp (the files in /var/lib/dhcpc are not updated). |
10 |
> |
11 |
> If I use |
12 |
> |
13 |
> dhcpcd_eth0="-s <IPaddress>" |
14 |
> |
15 |
> dhcpcd hangs. |
16 |
> |
17 |
> Any hints? |
18 |
> |
19 |
> Thanks |
20 |
> Sergio |
21 |
|
22 |
Your command above is weird. If you want a static IP you have to change |
23 |
your /etc/conf.d/net file and edit. Then, you could take dhcp out of the |
24 |
run levels since with a static IP you won't need it. |
25 |
|
26 |
Then, if you have a router, change it from providing dhcp to NO. |
27 |
|
28 |
Here's my net file fwiw. Info comment lines stripped. I leave in the old |
29 |
dhcp commands |
30 |
|
31 |
iface_eth0="192.168.2.100 broadcast 192.168.0.255 netmask 255.255.255.0" |
32 |
|
33 |
#iface_eth0="dhcp" |
34 |
#dhcpcd_eth0="-N" |
35 |
|
36 |
# For setting the default gateway |
37 |
# |
38 |
gateway="eth0/192.168.2.1" |
39 |
|
40 |
This last part is important. Your PC has to find the gateway. My router is |
41 |
at the above address. You might also have to add the gateway address to |
42 |
/etc/resolv.conf as the nameserver otherwise you might lose internet and |
43 |
network connections. |
44 |
|
45 |
Be sure to copy the resolv.conf file first to make sure you don't lose |
46 |
other important settings. |
47 |
|
48 |
Good luck. Works fine for me :) |
49 |
|
50 |
-- |
51 |
gentoo-user@g.o mailing list |