[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DHCP request IP address



On 2/25/14, digiphoenix <digiphoenix@gmx.net> wrote:
> Am Montag, 24. Februar 2014, 14:07:22 schrieb Ric Moore:
>> Which file do you edit to request an IP address from a DHCP server? It's
>> been awhile! Ric
>
> Try execute "dhclient xxx0 IP-of-Server" as root. For example
> dhclient eth0 192.168.1.1
> or
> dhclient wlan0 192.168.1.1

When are doing a one-shot (ie/or just testing), then I always add the
"-d" option to stop dhclient from backgrounding as a daemon - this way
it runs in the foreground, and I can kill it with a CTRL-C at any
stage - having to ps aux|grep dh then kill the appropriate IP has been
a source of frustration in the past.

> You can request each interface as needed.
>
> If you want it automatically at boot, edit /etc/network/interfaces.
>
> The syntax i.e. for eth0 is
>
> auto io eth0

I think you mean "auto lo eth0". I separate the lines, so leave the
"auto lo" line as it is and add a new line (if wanted):
auto eth0

> iiface eth0 dhcp

Looks like you have a bit of a thing for this 'i' char :)

> If you do so, each command "/etc/network/interfaces restart" let you request
>
> an IP from the dhcp-server. All interfaces named in the "auto"-line are
> initialized new then.

Or in multiple "auto" lines, to belabour the point.

Good luck,
Zenaan


Reply to: