vagrant-libvirt icon indicating copy to clipboard operation
vagrant-libvirt copied to clipboard

libvirt plugin does not follow vagrant default networking syntax

Open rudineirk opened this issue 9 years ago • 3 comments

The plugin uses a different syntax than default vagrant (with virtualbox, vmware, ...)

for example, creating a bridged interface in default vagrant:

config.vm.network 'public_network', bridge: 'wlp3s0'

and with the libvirt plugin:

config.vm.network 'public_network', dev: 'wlp3s0', mode: 'bridge'

is that difference really necessary?

rudineirk avatar Mar 06 '15 00:03 rudineirk

:+1:

dguerri avatar Mar 15 '15 18:03 dguerri

FWIW, you don't need to specify mode: 'bridge'. We default to a type of direct and mode of bridge which should do what most people want.

I've realized that when #175 was merged the documentation wasn't updated to reflect the addition of the type configuration.

To your main point, I don't know why the vagrant syntax wasn't used when #53 was done. Is all we need to do rename dev to bridge in the configuration? Perhaps for a transitional period we could look for either dev or bridge, and warn people using dev that it is deprecated and they should update their Vagrantfile.

sciurus avatar Mar 18 '15 02:03 sciurus

Yes, that would be a good solution. But options specific to libvirt should be prefixed, like the internal network in virtualbox. ex:

config.vm.network "private_network", ip: "192.168.50.4", virtualbox__intnet: true

ref: https://docs.vagrantup.com/v2/virtualbox/networking.html

and taking in account #175, it could be changed to something like this:

config.vm.network 'public_network',
  bridge: 'wlp3s0',
  libvirt__nettype: 'direct',
  libvirt__netmodel: 'e1000'

rudineirk avatar Mar 18 '15 04:03 rudineirk