mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Merge pull request #498 from jtoppins/named-interfaces
interfaces: allow user to specify an interface name
This commit is contained in:
commit
883db81df5
@ -69,6 +69,7 @@ module VagrantPlugins
|
|||||||
@network_name = iface_configuration[:network_name]
|
@network_name = iface_configuration[:network_name]
|
||||||
@mac = iface_configuration.fetch(:mac, false)
|
@mac = iface_configuration.fetch(:mac, false)
|
||||||
@model_type = iface_configuration.fetch(:model_type, @nic_model_type)
|
@model_type = iface_configuration.fetch(:model_type, @nic_model_type)
|
||||||
|
@device_name = iface_configuration.fetch(:iface_name, false)
|
||||||
template_name = 'interface'
|
template_name = 'interface'
|
||||||
# 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
|
||||||
|
@ -3,7 +3,11 @@
|
|||||||
<% if @mac %>
|
<% if @mac %>
|
||||||
<mac address='<%= @mac %>'/>
|
<mac address='<%= @mac %>'/>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if @device_name %>
|
||||||
|
<target dev='<%= @device_name %>'/>
|
||||||
|
<% else %>
|
||||||
<target dev='vnet<%= @iface_number %>'/>
|
<target dev='vnet<%= @iface_number %>'/>
|
||||||
|
<% end %>
|
||||||
<alias name='net<%= @iface_number %>'/>
|
<alias name='net<%= @iface_number %>'/>
|
||||||
<model type='<%=@model_type%>'/>
|
<model type='<%=@model_type%>'/>
|
||||||
</interface>
|
</interface>
|
||||||
|
@ -7,5 +7,11 @@
|
|||||||
<local address='<%=@udp_tunnel_local_ip%>' port='<%=@udp_tunnel_local_port%>' />
|
<local address='<%=@udp_tunnel_local_ip%>' port='<%=@udp_tunnel_local_port%>' />
|
||||||
<% end %>
|
<% end %>
|
||||||
</source>
|
</source>
|
||||||
|
<% if @device_name %>
|
||||||
|
<target dev='<%= @device_name %>'/>
|
||||||
|
<% else %>
|
||||||
|
<target dev='tnet<%= @iface_number %>'/>
|
||||||
|
<% end %>
|
||||||
|
<alias name='net<%= @iface_number %>'/>
|
||||||
<model type='<%=@model_type%>'/>
|
<model type='<%=@model_type%>'/>
|
||||||
</interface>
|
</interface>
|
||||||
|
Loading…
Reference in New Issue
Block a user