安装centos 7.9 64bit系统,并写过程文档,
要求使用https://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso
要求配置IP地址
要求配置DNS
要求配置yum源
要求能够ping www.baidu.com
要求关闭selinux
要求开启防火墙
# 1、配置静态IP跟DNS
# 查看本机端口
[root@localhost ~]# ip a l
# 更改网卡配置
36 vi /etc/sysconfig/network-scripts/ifcfg-ens33# 启动网络服务,并查看运行状态
22 systemctl start network
25 systemctl status network
# 测试ping通 内网 主机及百度
34 ping 192.168.176.179
ping www.baidu.com
# 查看路由表
41 ip route show
# 添加路由
44 ip route add default via 192.168.176.2
# 2、配置yum源
# 备份原有base源
51 cd /etc/yum.repos.d/
53 mv CentOS-Base.repo CentOS-Base.repo.bak
# 安装及下载
57 yum install -y wget
58 wget http://mirrors.163.com/.help/CentOS7-Base-163.repo# 清空及重新建立yum仓库
63 yum clean all
64 yum makecache#安装epel源
66 yum install -y epel-release
# 3、防火墙及seliunx
# 获取当前selinux状态
[root@localhost ~]# getenforce
# 修改并重启
[root@localhost ~]# vi /etc/selinux/config
[root@localhost ~]# reboot
[root@localhost ~]# getenforce
Disabled# 禁用防火墙
[root@localhost ~]# systemctl status firewalld
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld# 启用iptables 并只允许ssh端口,保存
138 iptables -F 150 iptalbes -vnL 149 iptables -A INPUT -d 192.168.176.190 -p tcp --dport 22 -m state --state NEW -j ACCEPT 152 iptables -I INPUT -d 192.168.176.190 -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT 153 iptables -I OUTPUT -s 192.168.176.190 -p tcp -m state --state ESTABLISHED -j ACCEPT 154 iptables -A INPUT -d 192.168.176.190 -j REJECT 155 iptables -A OUTPUT -s 192.168.176.190 -j REJECT 158 iptables-save > ./iptables_rules