Merge pull request #868 from justinlynn/add_dhcp_default_route_option

Issue #862: Allow bridged networking without removing the interface's DHCP assigned default route
This commit is contained in:
Mitchell Hashimoto 2012-05-06 14:46:58 -07:00
commit 73c8299ecd
2 changed files with 7 additions and 3 deletions

View File

@ -315,7 +315,8 @@ module Vagrant
:adapter => nil, :adapter => nil,
:mac => nil, :mac => nil,
:bridge => nil, :bridge => nil,
:auto_config => true :auto_config => true,
:use_dhcp_assigned_default_route => false
}.merge(options) }.merge(options)
end end
@ -388,13 +389,14 @@ module Vagrant
:type => :bridged, :type => :bridged,
:bridge => chosen_bridge, :bridge => chosen_bridge,
:mac_address => config[:mac], :mac_address => config[:mac],
:nic_type => config[:nic_type], :nic_type => config[:nic_type]
} }
end end
def bridged_network_config(config) def bridged_network_config(config)
return { return {
:type => :dhcp :type => :dhcp,
:use_dhcp_assigned_default_route => config[:use_dhcp_assigned_default_route]
} }
end end
end end

View File

@ -2,5 +2,7 @@
# The contents below are automatically generated by Vagrant. Do not modify. # The contents below are automatically generated by Vagrant. Do not modify.
auto eth<%= options[:interface] %> auto eth<%= options[:interface] %>
iface eth<%= options[:interface] %> inet dhcp iface eth<%= options[:interface] %> inet dhcp
<% unless options[:use_dhcp_assigned_default_route] %>
post-up route del default dev $IFACE post-up route del default dev $IFACE
<% end %>
#VAGRANT-END #VAGRANT-END