mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
add information and correct example for bridge. close #330
This commit is contained in:
parent
7f48fca699
commit
1d15017381
@ -205,7 +205,10 @@ An examples of network interface definitions:
|
|||||||
|
|
||||||
# Public Network
|
# Public Network
|
||||||
config.vm.define :test_vm1 do |test_vm1|
|
config.vm.define :test_vm1 do |test_vm1|
|
||||||
test_vm1.vm.network :public_network, :dev => "eth0", :mode => 'bridge'
|
test_vm1.vm.network :public_network,
|
||||||
|
:dev => "virbr0",
|
||||||
|
:mode => "bridge",
|
||||||
|
:type => "bridge"
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -264,6 +267,7 @@ virtual network.
|
|||||||
* `:mode` - The mode in which the public interface should operate in. Supported
|
* `:mode` - The mode in which the public interface should operate in. Supported
|
||||||
modes are available from the [libvirt documentation](http://www.libvirt.org/formatdomain.html#elementsNICSDirect).
|
modes are available from the [libvirt documentation](http://www.libvirt.org/formatdomain.html#elementsNICSDirect).
|
||||||
Default mode is 'bridge'.
|
Default mode is 'bridge'.
|
||||||
|
* `:type` - is type of interface.(`<interface type="#{@type}">`)
|
||||||
* `:mac` - MAC address for the interface.
|
* `:mac` - MAC address for the interface.
|
||||||
* `:ovs` - Support to connect to an open vSwitch bridge device. Default is 'false'.
|
* `:ovs` - Support to connect to an open vSwitch bridge device. Default is 'false'.
|
||||||
|
|
||||||
|
@ -74,8 +74,8 @@ module VagrantPlugins
|
|||||||
# Configuration for public interfaces which use the macvtap driver
|
# Configuration for public interfaces which use the macvtap driver
|
||||||
if iface_configuration[:iface_type] == :public_network
|
if iface_configuration[:iface_type] == :public_network
|
||||||
@device = iface_configuration.fetch(:dev, 'eth0')
|
@device = iface_configuration.fetch(:dev, 'eth0')
|
||||||
@type = iface_configuration.fetch(:type, 'direct')
|
|
||||||
@mode = iface_configuration.fetch(:mode, 'bridge')
|
@mode = iface_configuration.fetch(:mode, 'bridge')
|
||||||
|
@type = iface_configuration.fetch(:type, 'direct')
|
||||||
@model_type = iface_configuration.fetch(:model_type, @nic_model_type)
|
@model_type = iface_configuration.fetch(:model_type, @nic_model_type)
|
||||||
template_name = 'public_interface'
|
template_name = 'public_interface'
|
||||||
@logger.info("Setting up public interface using device #{@device} in mode #{@mode}")
|
@logger.info("Setting up public interface using device #{@device} in mode #{@mode}")
|
||||||
@ -156,9 +156,7 @@ module VagrantPlugins
|
|||||||
# Get list of all (active and inactive) libvirt networks.
|
# Get list of all (active and inactive) libvirt networks.
|
||||||
available_networks = libvirt_networks(libvirt_client)
|
available_networks = libvirt_networks(libvirt_client)
|
||||||
|
|
||||||
if options[:iface_type] == :public_network
|
return 'public' if options[:iface_type] == :public_network
|
||||||
return 'public'
|
|
||||||
end
|
|
||||||
|
|
||||||
if options[:ip]
|
if options[:ip]
|
||||||
address = network_address(options[:ip], options[:netmask])
|
address = network_address(options[:ip], options[:netmask])
|
||||||
|
Loading…
Reference in New Issue
Block a user