VMWare安装CentOS问题-网络配置问题(完结)

安装了CentOS发现网络一直连接不了,期间有很多问题,篇尾有自己最后的配置信息

配置过程问题:

问题一:Bringing up interface eth0:  Error: Unknown connection: a4158699-b687-428c-8bce-45dcde9286d3.

解决办法:

三个命令解决:

[root@localhost network-scripts]# chkconfig NetworkManager off
[root@localhost network-scripts]# chkconfig network on
[root@localhost network-scripts]# service NetworkManager stop

如下:

[root@localhost network-scripts]# chkconfig NetworkManager off
[root@localhost network-scripts]# chkconfig network on
[root@localhost network-scripts]# service NetworkManager stop
Stopping NetworkManager daemon:                            [  OK  ]
[root@localhost network-scripts]# service network start
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Determining if ip address 192.168.8.100 is already in use for device eth0...
                                                           [  OK  ]
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists

 


问题二: ping: unknown host www.baidu.com

解决办法:

修改文件: /etc/resolv.conf

nameserver 114.114.114.114
nameserver 8.8.8.8

总结:

配置的过程很复杂,可能是源于自己对linux的陌生,总是想快点百度解决就ok,没有想过探究具体原理,才发现欲速则不达。

本机与虚拟机互通且连通网络的配置整理如下:

本人物理网络是172.168.18.* 

虚拟机暂定ip为172.168.18.44 (需与物理机同段,事先确定这个ip没有其他机子使用)

第一步:设置虚拟机的网络配置为桥接:直接连接物理网络

第二步:

设置linux的ip配置文件

CentOS文件路径:vi /etc/sysconfig/network-scripts/ifcfg-eth0
内容如下:

DEVICE=eth0
HWADDR=00:0C:29:68:C4:19                  /*和分配的一致*/
TYPE=Ethernet
UUID=a4158699-b687-428c-8bce-45dcde9286d3 /*和分配的一致*/
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none                            /*开机协议,最常见的三个参数如下:
                                          static(静态IP)
                                          none(不指定,设置固定ip的情况,这个也行,但是如果要设定多网口绑定bond的时候,必须设成none)
                                          dhcp(动态获得IP相关信息)
                                           
                                          */

IPADDR=172.168.18.44
NETMASK=255.255.255.0
GATEWAY=172.168.18.1

第三步:

设置linux的dns配置

CentOS文件路径:vi /etc/resolv.conf  (没有则自动新建)
内容如下:

meserver 114.114.114.114
nameserver 8.8.8.8

结果:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值