一、配置静态网络IP
vi /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTPROTO=static
ONBOOT = yes
IPADDR=192.168.72.101
NETMASK=255.255.255.0
GATEWAY=192.168.72.2
DNS=192.168.72.2
service network restart
二、修改DNS(确定能联网)
vi /etc/resolv.conf
nameserver 8.8.8.8 #google dns服务器, 根据实际情况更换
nameserver 8.8.4.4 #google dns服务器, 根据实际情况更换
三、更新yum
yum update
四、安装ifconfig
yum install -y net-tools
yum provides ifconfig
vim/wget/curl/
五、关闭防火墙并禁止开机自启
systemctl stop firewalld
systemctl disable firewalld.service
六、安装iptables防火墙并添加允许的端口
yum install -y iptables-services
vi /etc/sysconfig/iptables
-A INPUT -m state –state NEW -m tcp -p tcp –dport 8000 -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 8080 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 8082 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 8079 -j ACCEPT
systemctl restart iptables.service
systemctl enable iptables.service
七、安装wget
yum install -y wget
八、更换阿里yum源
cd /etc/yum.repo.d
mv CentOS-Base.repo CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
九、安装vim工具
yum install -y vim-enhanced
十、修改主机名
vim /etc/hostname
十一、关闭SeLinux
vim /etc/sysconfig/selinux
SELINUX=disabled
reboot
附加:
一、时间同步
yum install ntpdate
ntpdate time.nist.gov
26 Nov 13:12:46 ntpdate[8108]: adjust time server 132.163.97.2 offset -0.033624 sec