[olug] ¿ iproute2 does not do any DHCP ?

Rob Townley rob.townley at gmail.com
Wed Sep 1 00:31:26 UTC 2010


On Tue, Aug 31, 2010 at 5:41 PM, Luke-Jr <luke at dashjr.org> wrote:
> On Tuesday, August 31, 2010 05:11:35 pm Rob Townley wrote:
>> Then i wanted to use ip to assign a dynamic ip or at least use it to
>> set its configuration to be dynamic.  But it appears to me iproute2
>> does not support setting the configuration of an IPv4 address to be
>> dynamic let alone actually using it to obtain a dynamic ip address.  i
>> am just looking for confirmation that i am reading the docs correctly
>> and my attempts at using ip would correct.  Would somebody confirm
>> this?  (Hoping Matthew Marsh delurks again)   Am i missing something?
>> There is a "dynamic" parameter but that appears to be for IPv6 only.
>
> IPv4 doesn't support dynamic addresses. There's another protocol called DHCP
> often used for that, which requires a DHCP client to broadcast a request and
> parse the reply. The DHCP client can then assign the server-delegated address
> to your interface, or pass the info to you for further decision-making. Linux
> itself *does* have a built-in DHCP client, but it's not usually used and
> almost always disabled at compile-time to save space.
>

Very good point.  I was working on the layer2 portion of iproute2 but
  "ip link set eth1 up dynamic on"
throws an error:
  'either "dev" is duplicate or "dynamic" is garbage.'

The error is thrown on a debian / ubuntu LiveCD (BusyBox v1.15.3).
On Fedora13, "ip link set eth1 up dynamic on"  does not throw an error
and indeed eth1 is tagged for dynamic:
3: eth1: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc mq
state UP qlen 1000
    link/ether 00:14:c2:c1:50:88 brd ff:ff:ff:ff:ff:ff

Once the link is flagged as dynamic, dhclient eth1 seems to return
much much more quickly.  So if i could figure out how to tell BusyBox
to use iproute2 to flag the link as dynamic, maybe the udhcpc would
not timeout.



More information about the OLUG mailing list