diff --git a/plugins/guests/redhat/cap/configure_networks.rb b/plugins/guests/redhat/cap/configure_networks.rb index 04b49ab92..6749f1bdc 100644 --- a/plugins/guests/redhat/cap/configure_networks.rb +++ b/plugins/guests/redhat/cap/configure_networks.rb @@ -40,13 +40,11 @@ module VagrantPlugins # Down the interface before munging the config file. This might # fail if the interface is not actually set up yet so ignore # errors. - /sbin/ifdown '#{network[:device]}' || true - + /sbin/ifdown '#{network[:device]}' # Move new config into place mv -f '#{remote_path}' '#{final_path}' - - # Bring the interface up - ARPCHECK=no /sbin/ifup '#{network[:device]}' + # attempt to force network manager to reload configurations + nmcli c reload || true EOH end diff --git a/test/unit/plugins/guests/redhat/cap/configure_networks_test.rb b/test/unit/plugins/guests/redhat/cap/configure_networks_test.rb index 1da032e88..926713298 100644 --- a/test/unit/plugins/guests/redhat/cap/configure_networks_test.rb +++ b/test/unit/plugins/guests/redhat/cap/configure_networks_test.rb @@ -56,9 +56,10 @@ describe "VagrantPlugins::GuestRedHat::Cap::ConfigureNetworks" do cap.configure_networks(machine, [network_1, network_2]) expect(comm.received_commands[0]).to match(/\/sbin\/ifdown 'eth1'/) - expect(comm.received_commands[0]).to match(/\/sbin\/ifup 'eth1'/) + expect(comm.received_commands[0]).to match(/ifcfg-eth1/) expect(comm.received_commands[0]).to match(/\/sbin\/ifdown 'eth2'/) - expect(comm.received_commands[0]).to match(/\/sbin\/ifup 'eth2'/) + expect(comm.received_commands[0]).to match(/ifcfg-eth2/) + expect(comm.received_commands[0]).to match(/nmcli c reload/) end end end