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

Re: Configuring multiple IP addresses on VLAN interface using ifupdown



Hi,

just in case someone still reading my boring DHCP client attempts, to
complete the topic here my findings about behavior at shutdown. Even
with simply /etc/network/interfaces configuration:

  allow-hotplug eth3.77
  iface eth3.77 inet dhcp

and manually starting "ifup eth3.77" after boot, on shutdown there are
error messages from dhclient. According to syslog dhclient is not
killed but aborts with:

  dhclient: receive_packet failed on eth3.77: Network is down

and very soon afterwards:

  dhclient: Bind socket to interface: No such device

which leads to error messages to the console as well. I tried to
analyze with strace, but of course output is quite complex.  dhclient
-v -r -pf [...] is called to release a lease, if any. Although pidfile
is specified, dhclient does not write to it. A bit later the pid from
the pid file is killed, this is not synchronized with waiting for the
started dhclient to finish nor for the killed dhclient to terminate.

I think this forms a race condition that on some systems may not lead
to an error.

Am I simply too picky when not wanting error messages on Console?

Interestingly ifdown kills pid from pidfile without further checking,
which IMHO also is wrong. For hotplug-interfaces it could be a very
old PID in the file and the number could have been reused by another
process (isn't it a bit unexpected to find such things in base
services like ifup that are supposed to be rock-solid?).

Steffen

On Fri, Oct 18, 2013 at 2:05 PM, Steffen Dettmer
<steffen.dettmer@gmail.com> wrote:
> Hi,
>
> thanks again for your fast help.
>
> On Fri, Oct 18, 2013 at 1:18 PM, Tom H <tomh0665@gmail.com> wrote:
>> So Bob must be right about your ifupdown version not using iproute
>
> I'm using Wheezy with ifup version 0.7.8, I think this is the
> latest officially released (aka "the best") one?
>
>> and, as he suggested, you're going to have to use the equivalent of:
>>
>> allow-auto eth0.9
>> iface eth0.9 inet static
>> address 192.168.1.119
>> netmask 255.255.255.0
>> gateway 192.168.1.1
>> post-up ip address add 192.168.1.199/24 dev eth0.9
>
> I took this 1:1 resulting in the following /etc/network/interfaces file:
>
> ------------------------------------------------------------------->8=======
> auto lo
> iface lo inet loopback
>
> allow-auto eth0.9
> iface eth0.9 inet static
>   address 192.168.1.119
>   netmask 255.255.255.0
>   gateway 192.168.1.1
>   post-up ip address add 192.168.1.199/24 dev eth0.9
> =======8<-------------------------------------------------------------------
>
> Now I get "ERROR: trying to add VLAN #9 to IF -:eth0-  error: File exists"
> "only" once, but still.
>
> Is the example above correct? Does it work for you? Could your
> machine be boot so quickly that it might not be visible without
> adding --noclear to /etc/inittab for tty1 getty?
>
> Regards,
> Steffen


Reply to: