centos7.2模板机制作

centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作centos7.2模板机制作

#关闭防火墙和selinux
systemctl disable firewalld
systemctl stop firewalld
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/sysconfig/selinux
#修改主机名为模板机
sed -i 's#localhost.localdomain#mobanji#g' /etc/hostname
logout
配置网卡1:
vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=eno16777736
UUID=090f01e1-6bcc-4434-b85b-4c0eed7a29be
DEVICE=eno16777736
ONBOOT=yes
IPADDR=10.0.0.100
NETMASK=255.255.255.0
GATEWAY=10.0.0.2
DNS1=10.0.0.2
NDS2=223.5.5.5

[root@mobanji ~]# ip a|grep eno
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
inet 10.0.0.100/24 brd 10.0.0.255 scope global eno16777736
3: eno33554984: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
新增一个网卡,照猫画虎,配置网卡2:
[root@mobanji ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno33554984
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=eno33554984
DEVICE=eno33554984
ONBOOT=yes
IPADDR=172.16.1.100
#安装常用工具包
yum install vim net-tools wget -y

CentOS
1、备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、之后运行yum makecache生成缓存

epel
##epel 配置方法
###1、备份(如有配置其他epel源,默认是没有的)
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
2、下载新repo 到/etc/yum.repos.d/
epel(RHEL 7)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

转载于:https://blog.51cto.com/sandshell/2097195

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值