模板机安装初始

模板机安装

安装初始

具体的安装过程略过,要注意几个点即可:

最小化安装,不要忘记安装开发工具

更改内核,让网卡名字成为了eth开头的:net.ifnames=0 biosdevname=0

分区时采用三分区:boot、swap、根,虚拟机就不要用lvm了

在安装的过程当中设置网络地址,点击自动连接

网络相关

ifconfig eth0 192.168.80.7/24   #centos6
route add default gw 192.168.80.254
echo "nameserver 223.6.6.6" >> /etc/resolv.conf
或者
ip addr add 192.168.80.8/24 dev eth0  #centos7
ip addr del 192.168.80.8/24 dev eth0
ip route add default via 192.168.80.1  #add可替换成del

永久更改IP(完整重启网络服务)

[root@A ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
IPADDR=192.168.80.6
PREFIX=24
GATEWAY=192.168.80.254
DNS1=223.6.6.6
DNS2=8.8.8.8
ONBOOT=yes
BOOTPROTO=static
USERCTL=no

必备工具

yum -y install  tree  wget  vim  lrzsz  lsof  sysstat curl  man dos2unix  telnet  nmap htop
yum -y groupinstall "Development tools"

必做事务

阿里云和epel

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache

关闭selinux

[root@A ~]# getenforce   #查看selinux的状态
[root@A ~]# setenforce 0
[root@A ~]# vim /etc/selinux/config
SELINUX=disabled
[root@A ~]# reboot

关闭防火墙

systemctl stop firewalld
systemctl diable firewalld
posted @ 2019-12-17 13:48  张贺贺呀  阅读(260)  评论(0编辑  收藏  举报