Re: dhcpcd and secondary interface
Kobi Cohen-Arazi
Fri Feb 08 18:02:03 2013
Hi Roy,
Thanks for your quick reply.
On Fri, Feb 8, 2013 at 1:46 AM, Roy Marples <roy@xxxxxxxxxxxx> wrote:
> Hi Kobi
>
>
> On 08/02/2013 6:06, Kobi Cohen-Arazi wrote:
>
>> I have a question related to dhcpcd with the following scenario:
>>
>> Client is connected to one network say with IP subnet 192.168.1.0/24 [1].
>>
>> Gets an IP e.g. 192.168.1.40.
>>
>> Then it is switching to a different network without "if down" of the
>> interface. (for this e.g. wlan0 interface).
>> dhcpcd is restarted and DHCP request is sent to the DHCP server on
>> the seconds network. Second network has the same IP subnet
>> configuration as the previous one (192.168.1.0/24 [1]) and a different
>>
>> DHCP server.
>> dhcpcd receive a new IP, e.g. 192.168.1.50 but here is what I see when
>> running:
>> $ _ip_ addr _show dev wlan0_
>>
>>
>> there are 2 interfaces for wlan0 one is with the original address
>> (192.168.1.40) and one with the new address 192.168.1.50 with
>> "SECONDARY" flag.
>>
>>
>> I already saw that dhcpcd is making sure that promote_secondary is == 1.
>>
>> My question is why dhcpcd is not removing the primary/original
>> address so the secondary can be promoted.
>>
>> The above scenario with DIFFERENT IP subnet configuration on the 2
>>
>> different networks works fine. So the new incoming address from the
>> seconds DHCP server takes over the old address and there are no
>> issues.
>>
>> Any pointers on how should I debug it in dhcpcd code?
>> I'm using the following commit:
>> http://gitorious.org/rowboat/**external-dhcpcd/commits/**rowboat-jb<http://gitorious.org/rowboat/external-dhcpcd/commits/rowboat-jb>[2]
>>
>> ver 5.5.6.
>>
>
> dhcpcd should remove the old ip address fine and should do this when the
> interface is down, however there are some scenarios where this won't occur.
>
Wait a sec - so I do need to ifdown + ifup the device in order for the
secondary to be promoted and old IP address to be removed? That might be my
issue. I'm not doing it.
> Basically dhcpcd will not do this if persistent address is enabled or
> carrier detection is disabled.
> Can you tell me how dhcpcd is started and what your configuration file is?
>
I should have mention this in my previous email. I'm using dhcpcd on
Android JellyBean device. Android is using dhcpcd as DHCP client.
dhcpcd is started with:
dhcpcd -ABKLG -h <hostname>
There is no dhcpcd.conf file on the OS filesystem.
Here is what I see in if-options.c:
case 'A':
ifo->options &= ~DHCPCD_ARP;
/* IPv4LL requires ARP */
ifo->options &= ~DHCPCD_IPV4LL;
break;
case 'B':
ifo->options &= ~DHCPCD_DAEMONISE;
break;
case 'K':
ifo->options &= ~DHCPCD_LINK;
break;
case 'L':
ifo->options &= ~DHCPCD_IPV4LL;
break;
case 'G':
ifo->options &= ~DHCPCD_GATEWAY;
break;
Thanks,
Kobi
> Thanks
>
> Roy
>
>
Archive administrator: postmaster@marples.name