如果你用ifconfig命令找不到网卡,那就用ifconfig -a查看所有的网络信息
If you can't find a net card with an ifconfig command, then use an ifconfig-a to look at all the network information.
你现在的问题有可能是没有以网卡的方式启动,在/etc/sysconfig/network-scripts这里可以用ls命令查看有哪些文件,找到网卡配置文件ifcfg-eXXX,进入编辑,把ONBOOT=no这一项改为yes,保存并退出,重启网络服务或重启虚拟机。
The problem now is that you may not start with a web card, where you can view the files with an /etc/sysconfig/network-scripts command, find the Internet card configuration file ifcfg-eXXX, enter the editor, change the entry to yes, save and exit, restart network services or restart virtual machines.
lo是环回接口(loopback)。virbr是虚拟网桥(Virtual Bridge),virbr0是虚拟网桥网卡。一般centos6.5版本前普遍默认的网卡是eth0,centos7版本后普遍默认的网卡是ensxx(xx为数字)。当然也有已经修改过的网卡名称。
lo is the loopback interface. virbr is the virtual bridge, and virbr0 is the virtual bridge card. The popular default net card before version 6.5 is eth0, the popular default net card after version 7 of centos is ensxx (x x number). Of course, the name of the card has been modified.
例如我的是centos7版本 默认网卡名称就是ens33,以前在学校用的是centos6.5版本,默认网卡名称为eth0。
For example, I'm a "centos7" default card named ens33, used in school as a "centos 6.5" card named eth0.
在虚拟机中,有些网卡名称是eth1或eth2,说明这个虚拟影像是被复制的,由于在物理机中的网卡eth0自动识别了物理机的MAC地址,在虚拟机中运行网卡名称就会自动变成eth1,如果复制这个虚拟影像在另一台电脑上运行,则网卡名称会变成eth2。但也可以修改ifcfg-eth0配置文件,绑定MAC地址,删除/etc/udev/rules.d/70-persistent-net.rules配置文件,重启生效。
In the virtual machine, some of the card names are eth1 or eth2, indicating that the virtual image is copied, and because the MAC address of the physics machine is automatically identified in the physics machine, the name of the net card running in the virtual machine automatically becomes eth1, and if the virtual image is copied and running on another computer, the card name becomes eth2. But it can also modify the iffg-eth0 configuration file, bind the MAC address, delete/etc/udev/rules.d/70-persistent-net.rules configuration file, and restart.
在你的截图里面, 只有lo: 本地环回端口。 virbr: 桥接虚拟网卡和端口。
希望我的回答对你会有一点点的帮助,谢谢
那两个virbr0的是因为你装了虚拟服务器,系统建的虚拟网卡。
另外Linux7版本网卡配置文件改名为incfg-ens了,eth是Linux6的叫法。
在Linux7里面改网卡配置,直接使用nmtui命令即可,用不着vi配置文件了。
virbr0:虚拟机网关端口(192.168.122.1)
virbr0-nic:网桥内部接口
CentOS 7网卡配置可通过/etc/sysconfig/network-scripts/目录中的ifcfg-enp0s3文件进行编辑,设置IP等
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论