centos6.6虚拟机设置

1、vi /boot/grub/grub.conf 

2、chkconfig ip6tables off

3、vi /etc/selinux/config 

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


DEVICE=eth0

TYPE=Ethernet

UUID=c2528ed8-261d-4bad-9d80-ff4cfc53c089

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

#ifconfig -a HWADDR需要对应起来不然不能上网

HWADDR=08:00:27:23:1B:AA

IPADDR=192.168.1.110

NETMASK=255.255.255.0

BROADCAST=192.168.1.255

PREFIX=24

GATEWAY=192.168.1.1

DEFROUTE=yes

ARPCHECK=no

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME="System eth0"


5、vi /etc/resolv.conf 

nameserver 8.8.8.8

nameserver 8.8.4.4

6、

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

上传 http://mirrors.163.com/.help/CentOS6-Base-163.repo   /etc/yum.repos.d/

7

uname -r

2.6.32-504.el6.x86_64


yum clean all

yum makecache

yum update -y

8、 yum install wget gcc gcc-c++ make

9、

#关闭防火墙

service iptables stop

vi /etc/sysconfig/iptables

#添加

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

#重启防火墙

service iptables restart


你可能感兴趣的:(centos6.6虚拟机设置)