Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant uses incorrect name of network interface for bridged interface #7988

Closed
aston-r opened this issue Nov 10, 2016 · 2 comments · Fixed by #7989
Closed

vagrant uses incorrect name of network interface for bridged interface #7988

aston-r opened this issue Nov 10, 2016 · 2 comments · Fixed by #7989

Comments

@aston-r
Copy link

aston-r commented Nov 10, 2016

Dear Developers,

This is continuation of bug that I reported in #7858 . I have updated to vagrant 1.8.7 and still had the same issue:

INFO global: Vagrant version: 1.8.7
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
...
DEBUG guest: Searching for cap: network_interfaces
DEBUG guest: Checking in: redhat
DEBUG guest: Checking in: linux
DEBUG guest: Found cap: network_interfaces in linux
 INFO guest: Execute capability: network_interfaces [#<Vagrant::Machine: RHEL-7.2 (VagrantPlugins::ProviderVirtualBox::Provider)>] (redhat)
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://' (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG network_interfaces: Unsorted list: ["eth0", "eth1", "eth0.1@eth0"]
DEBUG network_interfaces: Sorted list: ["eth0", "eth0.1@eth0", "eth1"]
DEBUG network_interfaces: Ethernet preferred sorted list: ["eth0", "eth0.1@eth0", "eth1"]
DEBUG ssh: Uploading: /tmp/vagrant-redhat-configure-networks20161110-29035-19ldhw3 to /tmp/vagrant-network-entry-eth0.1@eth0-1478782550-0
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: # 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 'eth0.1@eth0'
# Move new config into place
mv -f '/tmp/vagrant-network-entry-eth0.1@eth0-1478782550-0' '/etc/sysconfig/network-scripts/ifcfg-eth0.1@eth0'
# attempt to force network manager to reload configurations
nmcli c reload || true

....
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.

ERROR vagrant: /opt/vagrant/embedded/gems/gems/vagrant-1.8.7/plugins/communicators/ssh/communicator.rb:240:in `execute'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.7/plugins/communicators/ssh/communicator.rb:250:in `sudo'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.7/plugins/guests/redhat/cap/configure_networks.rb:56:in `configure_networks'

As you can see vagrant uses vlan(eth0.1), while it should use eth1.

> ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}'
eth0:
eth1:
eth0.1@eth0:

> ls -l /etc/sysconfig/network-scripts/ifcfg-eth0.1*
-rw-r--r-- 1 root      root  119 Nov 10 01:53 /etc/sysconfig/network-scripts/ifcfg-eth0.1
-rw------- 1 vinod-990 devels 149 Nov 10 12:55 /etc/sysconfig/network-scripts/ifcfg-eth0.1@eth0

> cat /etc/sysconfig/network-scripts/ifcfg-eth0.1@eth0 
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
BOOTPROTO=dhcp
ONBOOT=yes
DEVICE=eth0.1@eth0
#VAGRANT-END

Let me know if you need more info.

@aston-r
Copy link
Author

aston-r commented Nov 11, 2016

Hi @chrisroberts

patched helped. thanks.

INFO ssh: Execute: /sbin/ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://' (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG network_interfaces: Unsorted list: ["eth0", "eth1", "eth0.1@eth0"]
DEBUG network_interfaces: Sorted list: ["eth0", "eth0.1@eth0", "eth1"]
DEBUG network_interfaces: Ethernet preferred sorted list: ["eth0", "eth1", "eth0.1@eth0"]
DEBUG ssh: Uploading: /tmp/vagrant-redhat-configure-networks20161111-16449-fv6bl4 to /tmp/vagrant-network-entry-eth1-1478848731-0
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: # 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 'eth1'

@ghost
Copy link

ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants