In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to solve the problem of modifying the network card named eth0 and starting under CentOS 7 VM. The article is very detailed and has a certain reference value. Interested friends must read it!
Environment
Win7 64bitVM workstation 10CentOS 7NAT mode accesses the network, and all virtual machines are configured in the same network segment, that is, 192.168.0.1192.168.0.254.
two。 View and modify the default configuration
Before that, we need to modify the default configuration file and the network card name as follows: ① ip a # you can see that there are two network cards One lo [up] one ifcfg-eno16777736 [down] ② # modify the network card eno-16777736 to eth0cd / etc/sysconfig/network-scripts/mv ifcfg-eno16777736 ifcfg-eth0# or the above two lines can be replaced by: # mv / etc/sysconfig/network-scripts/ifcfg-eno16777736 / etc/sysconfig/network-scripts/ifcfg#-eth0 ③ vi / etc/sysconfig/network-scripts/ifcfg-eth0# modify or add the following: # BOOTPROTO=static#NAME=eth0#ONBOOT=yes#HWADDR=??:? ?:?? MAC address # DNS1=114.114.114.114 access network needs # DNS2=8.8.8.8 can be left unfilled # IPADDR=192.168.0.5 local ip needs to be configured in the same segment as the virtual machine for interworking access network # PREFIX=24 mask prefix bits # GATEWAY=192.168.0.1 gateway, that is, the virtual network card address generated by VM, the address is the same as the VM8 configuration IP in win7 to ④ vim / etc/sysconfig/grub # and then Add "net.ifnames=0 biosdevname=0" to this file, prohibit automatic prediction of the name, and prevent the network card name from being automatically modified. That is, # GRUB_CMDLINE_LINUX= "rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto net.ifn#ames=0 biosdevname=0 rhgb quiet" ⑤ grub2-mkconfig-o / boot/grub2/grub.cfg # run the command grub2-mkconfig-o / boot/grub2/grub.cfg to regenerate the GRUB configuration and generate a new configuration file ⑥ reboot ip a # you should see the following interface
Description:
BOOTPROTO= [none | static | bootp | dhcp] Boot without protocol | static allocation | BOOTP protocol | dhcp protocol
As you can see, the name of the network card was changed to eth0, but it was not started.
3. Start eth0 and activation failed solution
Service network start
Systemctl status network # check the cause of the error active error
By looking up the documents, we know that the above reasons are caused by the NetworkManager service. Boot up, we modified the relevant configuration, but could not detect it, so we need to deal with the following
Chkconfig NetworkManager off# shuts down and starts this service chkconfig network on#service NetworkManager stop or systemctl stop NetworkManager.service#service network start or systemctl start network.service
Ok
Description:
The Networkmangager service manages the settings such as the configuration of the network card graphically, while the terminal is realized by writing files with commands. So when you use the command terminal to set up the network card, the management of networkmanmager graphics is also called.
The above is all the contents of the article "how to solve the problem of modifying the network card named eth0 and starting under CentOS 7 VM". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.