赞
踩
装完虚拟机之后发现,网络是no network connection状态
单击右上角电脑图标,出现如下下拉框
那么找到 /etc/sysconfig/network-scripts/ifcfg-eth0文件
修改里面的ONBOOT值为yes然后再service network restart
然后继续在Terminal里面输入ifconfig查看网络状态。
在Terminal里面输入ifconfig查看网络状态
可以看出,本机的IP地址是192.168.112.131
[root@node2 ~]# cd /etc/sysconfig/network-scripts/
[root@node2 network-scripts]# vi ifcfg-eth0
修改之前是这个样子的
将ONBOOT属性改为yes
将BOOTPROTO改为none
再在末尾加入IPADDR等配置,完成后如下
重启网络服务,发现IP地址没有改变,配置成功
[root@node2 network-scripts]# service network restart
Shutting down interface eth0: Device state: 3 (disconnected)
[ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2
[ OK ]
[root@node2 network-scripts]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:65:A1:0F
inet addr:192.168.112.131 Bcast:192.168.112.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe65:a10f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1445 errors:0 dropped:0 overruns:0 frame:0
TX packets:372 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:106405 (103.9 KiB) TX bytes:47999 (46.8 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:52 errors:0 dropped:0 overruns:0 frame:0
TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3652 (3.5 KiB) TX bytes:3652 (3.5 KiB)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。