On Fri, 06 Jan 2006 08:53:53 +0100, Sergio Polini wrote:

> I can't understand how to ask dhcp for a static address. I've read
> /etc/conf.d/net.example, but using
> 
> config_eth0=( <IPaddress> netmask <netmask> brd <broadcast>)
> 
> in /etc/conf.d/net configures my network interface _instead of_ asking
> dhcp (the files in /var/lib/dhcpc are not updated).
> 
> If I use
> 
> dhcpcd_eth0="-s <IPaddress>"
> 
> dhcpcd hangs.
> 
> Any hints?
> 
> Thanks
> Sergio

Your command above is weird. If you want a static IP you have to change
your /etc/conf.d/net file and edit. Then, you could take dhcp out of the
run levels since with a static IP you won't need it.

Then, if you have a router, change it from providing dhcp to NO.

Here's my net file fwiw. Info comment lines stripped. I leave in the old
dhcp commands

iface_eth0="192.168.2.100 broadcast 192.168.0.255 netmask 255.255.255.0"

#iface_eth0="dhcp"
#dhcpcd_eth0="-N"

# For setting the default gateway
#
gateway="eth0/192.168.2.1"

This last part is important. Your PC has to find the gateway. My router is
at the above address. You might also have to add the gateway address to
/etc/resolv.conf as the nameserver otherwise you might lose internet and
network connections.

Be sure to copy the resolv.conf file first to make sure you don't lose
other important settings.

Good luck. Works fine for me :)

-- 
gentoo-user@gentoo.org mailing list

Reply via email to