Centos6.5网络等信息配置

Centos6.5网络、Host等信息配置

上一篇Centos已经安装成功,但是我们通过ifconfig命令发现网络ip地址为127.0.0.1,ping www.baidu.com也无法访问,说明我们的Centos无法访问外网的,我们的物理机也是无法连接Centos虚拟机的,所以要进行配置

1、网络配置

vi /etc/sysconfig/network-scripts/ifcfg-eth0

 

修改网卡的最终配置信息如下:

DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=dhcp

重启网卡

service network restart

每次重启机器发现ip地址变了,所有我们要配置为固定的ip地址,按照物理机分配的ip地址模式配

BOOTPROTO=static
IPADDR=192.168.1.x
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
service network restart

配置hosts
vi /etc/hosts
配置本机的hostname到ip地址的映射
192.168.1.188 eshop-cache01

2、通过SecureCRT连接Centos


4、关闭防火墙

service iptables stop
service ip6tables stop
chkconfig iptables off
chkconfig ip6tables off

vi /etc/selinux/config
SELINUX=disabled

4、配置yum

yum clean all
yum makecache
yum install wget

 

posted @ 2017-11-17 15:08  sunny1009  阅读(116)  评论(0)    收藏  举报