public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Asking dhcp for a static address
@ 2006-01-06  7:53 Sergio Polini
  2006-01-06  8:27 ` Steven Susbauer
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sergio Polini @ 2006-01-06  7:53 UTC (permalink / raw
  To: gentoo-user

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
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Asking dhcp for a static address
  2006-01-06  7:53 [gentoo-user] Asking dhcp for a static address Sergio Polini
@ 2006-01-06  8:27 ` Steven Susbauer
  2006-01-06  8:59 ` Peter Volkov (pva)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Steven Susbauer @ 2006-01-06  8:27 UTC (permalink / raw
  To: gentoo-user

A static IP address is something you have to configure on the DHCP 
server, on the computer it just asks the server "What IP address am I 
supposed to have?". If you're set up with a static IP, it compares your 
mac address to a list and gives you the one you've assigned to it. The 
client side doesn't do anything out of the ordinary.

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
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Asking dhcp for a static address
  2006-01-06  7:53 [gentoo-user] Asking dhcp for a static address Sergio Polini
  2006-01-06  8:27 ` Steven Susbauer
@ 2006-01-06  8:59 ` Peter Volkov (pva)
  2006-01-06 10:48 ` [gentoo-user] " Peter
  2006-01-09  1:38 ` [gentoo-user] " Matthew Cline
  3 siblings, 0 replies; 9+ messages in thread
From: Peter Volkov (pva) @ 2006-01-06  8:59 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]

On Птн, 2006-01-06 at 08: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).

Right. This is static configuration. No dhcp.

> If I use
> 
> dhcpcd_eth0="-s <IPaddress>"
> 
> dhcpcd hangs.

> Any hints? 

Hm. Information from net.example, expressed in other words:

First select what dhcp client you are going to use by adding one of
# dhclient: emerge net-misc/dhcp
# dhcpcd:   emerge net-misc/dhcpcd
# pump:     emerge net-misc/pump
# udhcpc:   emerge net-misc/udhcp
in modules. Fex
1.  modules=( "dhcpcd" )
Now. Tell that you are going to use dhcp on eth0
2.  config_eth0=( "dhcp" )
And then add custom configuration options
module_eth0="custom_options"
Fex
3.  dhcpcd_eth0="-s 123.123.123.123"

BTW. What version of baselayout do you have?

Peter.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-user]  Re: Asking dhcp for a static address
  2006-01-06  7:53 [gentoo-user] Asking dhcp for a static address Sergio Polini
  2006-01-06  8:27 ` Steven Susbauer
  2006-01-06  8:59 ` Peter Volkov (pva)
@ 2006-01-06 10:48 ` Peter
  2006-01-06 13:34   ` Sergio Polini
  2006-01-09  1:38 ` [gentoo-user] " Matthew Cline
  3 siblings, 1 reply; 9+ messages in thread
From: Peter @ 2006-01-06 10:48 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user]  Re: Asking dhcp for a static address
  2006-01-06 10:48 ` [gentoo-user] " Peter
@ 2006-01-06 13:34   ` Sergio Polini
  2006-01-06 17:33     ` [gentoo-user] " Peter
  0 siblings, 1 reply; 9+ messages in thread
From: Sergio Polini @ 2006-01-06 13:34 UTC (permalink / raw
  To: gentoo-user

Peter:
> iface_eth0="192.168.2.100 broadcast 192.168.0.255 netmask 
255.255.255.0"
> #iface_eth0="dhcp"
> #dhcpcd_eth0="-N"
> gateway="eth0/192.168.2.1"
>
> This last part is important. Your PC has to find the gateway.

Done. But it doesn't work :-(

> You might also have to add the
> gateway address to /etc/resolv.conf as the nameserver otherwise you
> might lose internet and network connections.

Yes, I can't get names resolved.
Do you mean that I should  add

nameserver 192.168.2.1

(i.e., my gateway address, which is different ;-) to /etc/resolv.conf?
My resolv.conf after a dhcp connession is:

domain fastwebnet.it
nameserver 213.156.54.80
nameserver 213.156.54.81

(Fastweb is my provider).

What should my resolv.conf look like?
Thanks.
Sergio
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-user]  Re: Re: Asking dhcp for a static address
  2006-01-06 13:34   ` Sergio Polini
@ 2006-01-06 17:33     ` Peter
  2006-01-06 18:56       ` Martins Steinbergs
  2006-01-06 20:15       ` Stroller
  0 siblings, 2 replies; 9+ messages in thread
From: Peter @ 2006-01-06 17:33 UTC (permalink / raw
  To: gentoo-user

On Fri, 06 Jan 2006 14:34:07 +0100, Sergio Polini wrote:

> 
> (i.e., my gateway address, which is different ;-) to /etc/resolv.conf? My
> resolv.conf after a dhcp connession is:
> 
> domain fastwebnet.it
> nameserver 213.156.54.80
> nameserver 213.156.54.81
> 
> (Fastweb is my provider).
> 
> What should my resolv.conf look like? Thanks.
> Sergio

So, you do NOT have a router? Then keep dhcp. If your ISP has assigned you
a static IP, then you should ask them for specifics. Most do not assign
static IP though. Sorry I could not help more. I use a router and each PC
is assigned a specific IP within the local net. However, the ROUTER gets
the Dynamic IP from our ISP.

Sorry I could not help more. dhcp is really great!


-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user]  Re: Re: Asking dhcp for a static address
  2006-01-06 17:33     ` [gentoo-user] " Peter
@ 2006-01-06 18:56       ` Martins Steinbergs
  2006-01-06 20:15       ` Stroller
  1 sibling, 0 replies; 9+ messages in thread
From: Martins Steinbergs @ 2006-01-06 18:56 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

On Friday 06 January 2006 19:33, Peter wrote:
> On Fri, 06 Jan 2006 14:34:07 +0100, Sergio Polini wrote:
> > (i.e., my gateway address, which is different ;-) to /etc/resolv.conf? My
> > resolv.conf after a dhcp connession is:
> >
> > domain fastwebnet.it
> > nameserver 213.156.54.80
> > nameserver 213.156.54.81
> >
> > (Fastweb is my provider).
> >
> > What should my resolv.conf look like? Thanks.
> > Sergio
>
> So, you do NOT have a router? Then keep dhcp. If your ISP has assigned you
> a static IP, then you should ask them for specifics. Most do not assign
> static IP though. Sorry I could not help more. I use a router and each PC
> is assigned a specific IP within the local net. However, the ROUTER gets
> the Dynamic IP from our ISP.
>
> Sorry I could not help more. dhcp is really great!

for static generaly there is needed only 2 sections in /etc/conf.d/net
config_eth0 with static ip, netmask and brodcast
routes_eth0 with gateway ip

no need for dhcp, see net.example


m
-- 
Linux 2.6.14-gentoo-r6 AMD Athlon(tm) 64 Processor 3200+
 20:49:23 up 1 day, 0 min,  4 users,  load average: 0.00, 0.10, 0.79

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user]  Re: Re: Asking dhcp for a static address
  2006-01-06 17:33     ` [gentoo-user] " Peter
  2006-01-06 18:56       ` Martins Steinbergs
@ 2006-01-06 20:15       ` Stroller
  1 sibling, 0 replies; 9+ messages in thread
From: Stroller @ 2006-01-06 20:15 UTC (permalink / raw
  To: gentoo-user


On 6 Jan 2006, at 17:33, Peter wrote:
> On Fri, 06 Jan 2006 14:34:07 +0100, Sergio Polini wrote:
>>
>> (i.e., my gateway address, which is different ;-) to /etc/ 
>> resolv.conf? My
>> resolv.conf after a dhcp connession is:
>>
>> domain fastwebnet.it
>> nameserver 213.156.54.80
>> nameserver 213.156.54.81
>>
>> (Fastweb is my provider).
>>
>> What should my resolv.conf look like? Thanks.
>> Sergio
>
> So, you do NOT have a router? Then keep dhcp. If your ISP has  
> assigned you
> a static IP, then you should ask them for specifics. Most do not  
> assign
> static IP though.

If it's the ISP issuing a static IP then he won't need to (use the -s  
flag) to ask for it. They'll issue it to him if he uses a standard  
DHCP request to ask for just any old IP. DHCP servers can be  
configured to always issue the same IP to a given MAC address and  
ADSL ISPs in the UK issue static IPs via DHCP according to PPP  
authentication info. There's surely no need for him to specify it.

Stroller.
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Asking dhcp for a static address
  2006-01-06  7:53 [gentoo-user] Asking dhcp for a static address Sergio Polini
                   ` (2 preceding siblings ...)
  2006-01-06 10:48 ` [gentoo-user] " Peter
@ 2006-01-09  1:38 ` Matthew Cline
  3 siblings, 0 replies; 9+ messages in thread
From: Matthew Cline @ 2006-01-09  1:38 UTC (permalink / raw
  To: gentoo-user

On 1/6/06, Sergio Polini <sp_rm_it@yahoo.it> wrote:
> I can't understand how to ask dhcp for a static address.
> I've read /etc/conf.d/net.example, but using
> Any hints?
>

I know that you can do this with udhcpc using the "-r" option:

" -r ADDRESS, --request=ADDRESS
              Request IP address ADDRESS."


HTH,

Matt

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-01-09  1:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-06  7:53 [gentoo-user] Asking dhcp for a static address Sergio Polini
2006-01-06  8:27 ` Steven Susbauer
2006-01-06  8:59 ` Peter Volkov (pva)
2006-01-06 10:48 ` [gentoo-user] " Peter
2006-01-06 13:34   ` Sergio Polini
2006-01-06 17:33     ` [gentoo-user] " Peter
2006-01-06 18:56       ` Martins Steinbergs
2006-01-06 20:15       ` Stroller
2006-01-09  1:38 ` [gentoo-user] " Matthew Cline

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox