dhcpcd-discuss

Re: "dhcpcd not running"

Shahid Mahmood

Thu Apr 28 13:30:47 2016

How does the script know "$old_vlan", "$new_vlan"?
Also, 'platform_specific_vlan_init' is done in our application code
(through ioctl).
For now, I'll just stick with what I got working for me.



On Wed, Apr 27, 2016 at 5:50 PM, Roy Marples <roy@xxxxxxxxxxxx> wrote:

> On Wednesday 27 April 2016 11:02:38 Shahid Mahmood wrote:
> > Use case is a multiple vlan environment. At start, the device obtains a
> > lease on a no-vlan (eth0) dhcp server. The lease informs us (using a
> custom
> > option) to switch to another vlan, say 345 (as supplied). We will first
> > need to release the old eth0 lease and then request new lease using the
> > provided vlan id.
> >
> > Basically we cant hard code the vlan id (and consequently adaptor name)
> in
> > the .conf file because it is not known.
> >
> > Can you suggest why my approach would not work? (ie putting desired
> > interface name in .conf file).
> > (I want to avoid having to deal with pidfile).
>
> Everything in dhcpcd is known :D
> If you're more clever with shell you don't even need the -M flag, but I'll
> leave that exercise upto the reader.
>
> Start it up
> dhcpcd -M eth0
>
> In dhcpcd.enter-hook, maybe something like this (untested).
>
> if $if_up && [ "$old_vlanid" != "$new_vlanid"]; then
>         # vlan changed, release current.
>         # This works because of the -M flag.
>         dhcpcd -k
>
>         # Fire up the vlan
>         platform_specific_vlan_init
>
>         # Request DHCP over it, background right away
>         dhcpcd -bM eth0."$new_vlanid"
>
>         # Exit dhcpcd-run-hooks
>         exit 1
> fi
>
> Roy
>

Follow-Ups:
Re: "dhcpcd not running"Roy Marples
References:
"dhcpcd not running"Shahid Mahmood
Re: "dhcpcd not running"Roy Marples
Re: "dhcpcd not running"Shahid Mahmood
Re: "dhcpcd not running"Roy Marples
Archive administrator: postmaster@marples.name