setting up a v4tunnel interface after a dhcp interface?

Caleb enlightened.despot at
Tue Nov 17 18:12:23 UTC 2015

I haven't tested this, so your mileage may vary, but I believe you can
handle this by removing the "auto he0" line so that the he0 interface
isn't brought up automatically, then adding an 'up' command to the
eth0 interface definition:

auto eth0
iface eth0 inet dhcp
    up ifup he0

One potential snag: if I remember correctly, an interface being "up"
is separate and distinct from an interface having obtained a
dynamically assigned IP address, so /etc/network/if-up.d/he might
still be executed while the DHCP request is still in process, and
_before_ eth0 has obtained an IP address. This potential race
condition could be resolved by a static address assignment.

Alternatively, I believe--but have not verified--that Upstart's
'net-device-up' isn't triggered until the interface has a valid IP
address. If so, an Upstart script like the following should work
(adapted from

console none

start on (local-filesystems and net-device-up IFACE!=lo)
stop on [!12345]

ifup he0
end script

This script needs to be in /etc/init and have a .conf extension.
/etc/init/he.conf would be a good name for it.

Even if the Upstart approach works, you'll eventually have to change
it because of the move from Upstart to systemd


On Tue, Nov 17, 2015 at 12:55 AM, Ben Coleman <oloryn at> wrote:
> I've got a couple of Ubuntu 14.04 VPSs where the eth0 interface gets its
> ipv4 address via dhcp.  This is set up as
> auto eth0
> iface eth0 inet dhcp
> in a file in /etc/network/interface.d.  They always get the same ip
> address, but this is how the VPS vendor has set them up.
> I've also set up Hurricane Electric tunnels for them for ipv6, set up as
> the typical
> auto he0
> iface he0 inet6 v4tunnel
>         address <my ipv6 address>
>         netmask 64
>         endpoint <endpoint ipv4 address - which is the same as the eth0
> ip address>
>         local <local ipv4 address>
>         ttl 255
>         gateway <gateway ipv6 address>
> What I'm finding is that on boot-up, while the he0 interface is created,
> it does not have the global scope ipv6 address attached (same address as
> specified in <my ipv6 address> above).  I can do a
> sudo ifdown he0; sudo ifup he0
> and it will be correct, but it does not come up correctly on boot-up.
> I believe this is because during boot-up, he0 is being set up while the
> dhcp process is still going on, and eth0 does not yet have an ip
> address.  The ipv6 connection does not get set up because the eth0 ip
> address does not yet match the endpoint address of eth0.
> So, is there a way to specify that the he0 interface should not be set
> up until after eth0 has completed dhcp?
> Ben
> --
> ubuntu-users mailing list
> ubuntu-users at
> Modify settings or unsubscribe at:

More information about the ubuntu-users mailing list