vagrant creates two interfaces when I ask for a bridged adapter

818 views
Skip to first unread message

Michal Koziel

unread,
Jun 7, 2015, 6:49:35 AM6/7/15
to vagra...@googlegroups.com
Host: Windows8, Guest: CentOS6.6, Vagrant  1.7.2, VirtualBox 4.3.28
vagrant creates two interfaces when I ask for a bridged adapter in the Vagrantfile like this:

config.vm.network "public_network", bridge: "Realtek PCIe GBE Family Controller", ip: "192.168.1.4", netmask: "255.255.255.0", :use_dhcp_assigned_default_route => false

The two interfaces (eth1 and eth2) gets the same settings, except of the MAC address.
I have deleted /etc/sysconfig/network-scripts/ifcfg-eth1 and /etc/sysconfig/network-scripts/ifcfg-eth2
I have also removed /etc/udev/rules.d/70-persistent-net.rules
And added
ln -sf /dev/null /lib/udev/rules.d/75-persistent-net-generator.rules

Then reloaded VM, but th interfaces are again added. 

Is there anything I'm doing wrong? How do I fix this so only one bridged interface is added?

Vagrant up
Bringing machine 'default' up with 'virtualbox' provid
==> default: Clearing any previously set forwarded port
==> default: Clearing any previously set network inter
==> default: Specific bridge 'Realtek PCIe GBE Family
 may be asked to specify
==> default: which network to bridge to.
==> default: Specific bridge 'Realtek PCIe GBE Family
 may be asked to specify
==> default: which network to bridge to.
==> default: Preparing network interfaces based on con
    default: Adapter 1: nat
    default: Adapter 2: bridged
    default: Adapter 3: bridged
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...




eth0      Link encap:Ethernet  HWaddr 08:00:27:A5:A7:59  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fea5:a759/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:710 errors:0 dropped:0 overruns:0 frame:0
          TX packets:435 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:83494 (81.5 KiB)  TX bytes:60138 (58.7 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:17:E8:D6  
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe17:e8d6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:256 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18512 (18.0 KiB)  TX bytes:552 (552.0 b)

eth2      Link encap:Ethernet  HWaddr 08:00:27:00:04:52  
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe00:452/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:256 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18512 (18.0 KiB)  TX bytes:552 (552.0 b)

Alvaro Miranda Aguilera

unread,
Jun 7, 2015, 10:20:36 PM6/7/15
to vagra...@googlegroups.com
hello

can you share a vagranfile ?
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Michal Koziel

unread,
Jun 8, 2015, 2:14:21 AM6/8/15
to vagra...@googlegroups.com
Sure:

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "Empty"
  config.vm.provider "virtualbox" do |vb|
    vb.gui = true
    vb.customize ["modifyvm", :id, "--vram", "128"]
    vb.customize ["modifyvm", :id, "--hwvirtex", "on"] 
    vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
    vb.customize ["modifyvm", :id, "--usb", "on", "--usbehci", "on"]
    #to get usb device info, connect usb device and run on host: $ vboxmanage list usbhost
    vb.customize ['usbfilter', 'add', '0', '--target', :id, '--name', 'Altera', '--action', 'hold', '--active', 'yes', '--vendorid', '0x09fb']
    vb.customize ["modifyvm", :id, "--memory", 4096]
    vb.customize ["modifyvm", :id, "--cpus", 4]
    config.vm.network "public_network", bridge: "en1:Realtek PCIe GBE Family Controller", ip: "192.168.1.4", netmask: "255.255.255.0", :use_dhcp_assigned_default_route => false
    config.vm.synced_folder "e://Dropbox//Linux", "//media//sf_linux"
  end
end

Alvaro Miranda Aguilera

unread,
Jun 8, 2015, 4:02:58 AM6/8/15
to vagra...@googlegroups.com
Ok

the problem is where the config.vm is

it's insise the virtualbox block

Take it out, since vagrant read the file multiple times ..



VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "Empty"
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.customize ["modifyvm", :id, "--vram", "128"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
vb.customize ["modifyvm", :id, "--usb", "on", "--usbehci", "on"]
#to get usb device info, connect usb device and run on host: $
vboxmanage list usbhost
vb.customize ['usbfilter', 'add', '0', '--target', :id, '--name',
'Altera', '--action', 'hold', '--active', 'yes', '--vendorid',
'0x09fb']
vb.customize ["modifyvm", :id, "--memory", 4096]
vb.customize ["modifyvm", :id, "--cpus", 4]
end
config.vm.network "public_network", bridge: "en1:Realtek PCIe GBE
Family Controller", ip: "192.168.1.4", netmask: "255.255.255.0",
:use_dhcp_assigned_default_route => false
config.vm.synced_folder "e://Dropbox//Linux", "//media//sf_linux"
end

Reply all
Reply to author
Forward
0 new messages