mitchellh/vagrant — Issue #663: Vagrant is fighting with puppet over control of eth1
Author: ferrylandzaat
Created: 2012-01-20 09:55:01+00:00
State: open

Today I restarted one of our VM's with bridged networking and it came up with this error:

```
[default] Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifup eth1
```

So I ssh into the machine and try to bring up eth1 manually to see what's happening and this is what I get:

```
/etc/network/interfaces:21: interface eth1 declared allow-auto twice
ifup: couldn't read interfaces file "/etc/network/interfaces"
```

And yes, debian is right, the /etc/network/interfaces file is a bit messed up:

```
allow-hotplug eth1
iface eth1 inet static
address 192.168.11.197
netmask 255.255.255.0
broadcast 192.168.11.255
gateway 192.168.11.254
auto eth1
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto eth1
iface eth1 inet dhcp
post-up route del default dev $IFACE
#VAGRANT-END
```

This is because we use puppet to provision our machines, and inside puppet the IP addresses are defined with the augeas module.
I tried to remove the puppet block (everything above #VAGRANT-BEGIN) and run puppet again and it comes up with this configuration:

```
allow-hotplug eth1
auto eth1
iface eth1 inet static
post-up route del default dev $IFACE
#VAGRANT-END
address 192.168.11.197
netmask 255.255.255.0
broadcast 192.168.11.255
gateway 192.168.11.254
```

The network is then working, but after a vagrant halt and vagrant up it is failing again:

```
allow-hotplug eth1
auto eth1
iface eth1 inet static
post-up route del default dev $IFACE
#VAGRANT-END
address 192.168.11.197
netmask 255.255.255.0
broadcast 192.168.11.255
gateway 192.168.11.254
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto eth1
iface eth1 inet dhcp
post-up route del default dev $IFACE
#VAGRANT-END
```

So, can you please make it possible to stop vagrant from modifying the network configuration?