Closed isharacomix closed 7 years ago
Found the culprit. It's this line: https://github.com/boxcutter/centos/blob/master/script/cleanup.sh#L43
gwdev=\
nmcli dev | grep ethernet | egrep -v 'unmanaged' | head -n 1 | awk '{print \$1}'`
nmcli dev lists the devices in alphabetical order. These are my adapters and their names:
enp0s10 comes before enp0s3 alphabetically, and the script assumes that the correct interface will be listed first. In our scripts, we usually use the output of ip link show
and assume that the interface numbered 2:
is the correct interface to use for dhcp (interface 1 is the loopback).
ip link show | grep '2: ' | awk '{print substr($2, 1, length($2)-1)}'
Would that be appropriate?
Should be sorted in the new boxes.
This may be a configuration problem on my end, but whenever I try to vagrant up a boxcutter/centos72 box with more than one interface, I get this output:
My vagrant config is as below:
When I go in through the console to investigate what's going on, it looks like DHCP is configured by default on the LAST interface Adapter 4 instead of the first Adapter 1 (the default Vagrant NAT interface). The only script in
/etc/sysconfig/network-scripts
is the device of Adapter 4, even though you can see it's explicitly set as auto-config=False. If I manually activate DHCP on Adapter 1 through the console, everything (such as Vagrant ssh) starts working as would expect.Does anyone here have any insight?