[英]How to configure internet on CentOS installation on VirtualBox
I am a beginner to linux. I have done the fresh installation of CentOS 7 on my Windows VirtualBox.我是 linux 的初学者。我已经在我的 Windows VirtualBox 上完成了 CentOS 7 的全新安装。
Over the tutorials for CentOs 6 they have mentioned to edit /etc/sysconfig.network-scripts/ifcfg-eth0 file for the configurations.在 CentOs 6 的教程中,他们提到要为配置编辑 /etc/sysconfig.network-scripts/ifcfg-eth0 文件。
But in my installation there is no such file.但是在我的安装中没有这个文件。 I have ifcfg-enp0s3 and ifcfg-lo files available.
我有可用的 ifcfg-enp0s3 和 ifcfg-lo 文件。
From the CentOS tutorial, the eth0
portion of /etc/sysconfig/network-scripts/ifcfg-eth0
refers to the network interface.从CentOS的教程时,
eth0
部分/etc/sysconfig/network-scripts/ifcfg-eth0
指网络接口。 eth0
is the most common name for a standard ethernet interface in Linux. eth0
是 Linux 中标准以太网接口最常见的名称。 From your question, your system has two interfaces: enp0s3
and lo
.根据您的问题,您的系统有两个接口:
enp0s3
和lo
。 lo
is the loopback interface, so ignore that one. lo
是环回接口,所以忽略那个。 That leaves enp0s3
.这留下了
enp0s3
。
Go ahead and follow the instructions with /etc/sysconfig/network-scripts/ifcfg-enp0s3
.继续并按照
/etc/sysconfig/network-scripts/ifcfg-enp0s3
。 It should work, assuming that interface doesn't have any weird quirks associated with it.它应该可以工作,假设该界面没有任何与之相关的奇怪怪癖。
Same here!同样在这里! I installed CentOS 7 in Windows7 Virtulabox, there is no
eth0
, but enp0s3
.我在 Windows7 Virtulabox 中安装了 CentOS 7,没有
eth0
,而是enp0s3
。
ip addr
, enp0s3
had no ip address bundled;ip addr
, enp0s3
没有绑定ip地址;/etc/sysconfig/network-scripts/ifcfg-enp0s3
, changed ONBOOT=no
to ONBOOT=yes
, enp0s3
had ip 10.xxx, still useless;/etc/sysconfig/network-scripts/ifcfg-enp0s3
,将ONBOOT=no
改为ONBOOT=yes
, enp0s3
有 ip 10.xxx ,还是没用; Then I updated /etc/sysconfig/network-scripts/ifcfg-enp0s3
according to the accepted answer of centos minimal installation static ip address , it works!然后我根据centos最小安装静态IP地址的公认答案更新了
/etc/sysconfig/network-scripts/ifcfg-enp0s3
,它有效! As my IP address of Ethernet adapter VirtualBox Host-Only Network
is 192.168.56.1, I set 192.168.56.35 to enp0s3
, and my vbox NIC mode is Host-Only
.由于我的
Ethernet adapter VirtualBox Host-Only Network
IP 地址是 192.168.56.1,我将 192.168.56.35 设置为enp0s3
,我的 vbox NIC 模式是Host-Only
。
It worked for me like this on windows 10 -Change Adapter 1 Name to "Remote NDIS based Inte.net Sharing Device"它在 windows 上对我有用 10 - 将适配器 1 名称更改为“基于远程 NDIS 的 Inte.net 共享设备”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.