Added defaults for :dev and :mode. Updated documentation to explain these options.

This commit is contained in:
Nick Downs 2013-09-10 22:45:40 -07:00
parent 8933842517
commit 151f212d50
2 changed files with 9 additions and 2 deletions

View File

@ -216,6 +216,12 @@ starts with 'libvirt__' string. Here is a list of those options:
be forwarded (NATed or routed). Used only when creating new network. By
default, all physical interfaces are used.
### Public Network Options
* `:dev` - Physical device that the public interface should use. Default is 'eth0'
* `: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).
Default mode is 'bridge'.
## Obtaining Domain IP Address
Libvirt doesn't provide standard way how to find out an IP address of running

View File

@ -70,8 +70,9 @@ module VagrantPlugins
# Configuration for public interfaces which use the macvtap driver
if iface_configuration[:iface_type] == :public_network
template_name = 'public_interface'
@device = iface_configuration[:dev]
@mode = iface_configuration[:mode]
@device = iface_configuration.fetch(:dev, 'eth0')
@mode = iface_configuration.fetch(:mode, 'bridge')
@logger.info("Setting up public interface using device #{@device} in mode #{@mode}")
end
message = "Creating network interface eth#{@iface_number}"