Eu estou tentando atualizar nossa caixa local dev devrant para o CentOS 7.2 (de 6.8), mas tive um problema com os novos "nomes de interface de rede previsíveis". Minha configuração de boneco está esperando eth0 e eth1, mas está ficando enp0s3 e enp0s8.
Consegui desabilitar nomes de interface de rede previsíveis no arquivo de kickstart adicionando:
bootloader --location=mbr --append="net.ifnames=0"
e removendo o pacote biosdevname
Agora, quando minha caixa vagrant é inicializada, tem eth0 e eth1 (mostradas quando faço um ip -a), mas não tenho os scripts de rede em / etc / sysconfig / network-scripts / (apenas ifcfg-enp0s3 e ifcfg-lo).
Quando o vagrant inicializa esta VM, mostra este erro:
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
# Update sysconfig
sed -i 's/\(HOSTNAME=\).*/vm.example.com/' /etc/sysconfig/network
# Update DNS
sed -i 's/\(DHCP_HOSTNAME=\).*/"vm"/' /etc/sysconfig/network-scripts/ifcfg-*
# Set the hostname - use hostnamectl if available
echo 'vm.example.com' > /etc/hostname
if command -v hostnamectl; then
hostnamectl set-hostname --static 'vm.example.com'
hostnamectl set-hostname --transient 'vm.example.com'
else
hostname -F /etc/hostname
fi
# Remove comments and blank lines from /etc/hosts
sed -i'' -e 's/#.*$//' -e '/^$/d' /etc/hosts
# Prepend ourselves to /etc/hosts
grep -w 'vm.example.com' /etc/hosts || {
sed -i'' '1i 127.0.0.1\tvm.example.com\tvm' /etc/hosts
}
# Restart network
service network restart
Stdout from the command:
/bin/hostnamectl
Restarting network (via systemctl): [FAILED]
Stderr from the command:
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
journalctl -xe mostra:
-- Unit network.service has begun starting up.
Oct 11 04:28:59 vm.example.com network[3130]: Bringing up loopback interface: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Oct 11 04:28:59 vm.example.com network[3130]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Oct 11 04:28:59 vm.example.com network[3130]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Oct 11 04:28:59 vm.example.com network[3130]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'
Oct 11 04:28:59 vm.example.com network[3130]: [ OK ]
Oct 11 04:28:59 vm.example.com network[3130]: Bringing up interface enp0s3: Error: Connection activation failed: No suitable device found for this connection.
Oct 11 04:28:59 vm.example.com network[3130]: [FAILED]
Oct 11 04:28:59 vm.example.com network[3130]: RTNETLINK answers: File exists
Oct 11 04:28:59 vm.example.com network[3130]: RTNETLINK answers: File exists
Oct 11 04:28:59 vm.example.com network[3130]: RTNETLINK answers: File exists
Oct 11 04:28:59 vm.example.com network[3130]: RTNETLINK answers: File exists
Oct 11 04:28:59 vm.example.com network[3130]: RTNETLINK answers: File exists
Oct 11 04:28:59 vm.example.com network[3130]: RTNETLINK answers: File exists
Oct 11 04:28:59 vm.example.com network[3130]: RTNETLINK answers: File exists
Oct 11 04:28:59 vm.example.com network[3130]: RTNETLINK answers: File exists
Oct 11 04:28:59 vm.example.com network[3130]: RTNETLINK answers: File exists
Oct 11 04:28:59 vm.example.com systemd[1]: network.service: control process exited, code=exited status=1
Oct 11 04:28:59 vm.example.com systemd[1]: Failed to start LSB: Bring up/down networking.
Como posso manter eth0 e eth1, mas fazer isso funcionar corretamente?
Obrigado