VW模板機準備

2022-08-22 04:24:12 字數 3242 閱讀 6516

系統 centos7

記憶體 建議2g

網絡卡 eth0: nat模式 模擬外網 10.0.0.x

eth1: lan區段 模擬內網 172.16.1.x

硬碟 不小於20g或40g

net.ifnames=0 biosdevname=0
[root@m01 ~]# cat  /etc/sysconfig/network-scripts/ifcfg-eth0

type=ethernet

bootproto=none

name=eth0

device=eth0

onboot=yes

ipaddr=10.0.0.201

prefix=24

gateway=10.0.0.254

dns1=10.0.0.254

[root@m01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1

type=ethernet

bootproto=static

ipaddr=172.16.1.201

prefix=24

name=eth1

device=eth1

onboot=yes

[root@m01 ~]# systemctl restart network

如果不刪除,重新轉殖虛擬機會導致上不了網

刪除網絡卡裡面包含uuid 的行(centos7),刪除uuid和hwaddr(centos5和6)

清空/etc/udev/rules.d/70-persistent-net.rules(centos 5 和6)

#關閉firewalld 和networkmanager

[root@m01 ~]# systemctl stop firewalld networkmanager

[root@m01 ~]# systemctl disable firewalld networkmanager

#檢查是否正在執行

systemctl is-active firewalld networkmanager

#檢查是否開機自啟動

systemctl is-enabled firewalld networkmanager

[root@m01 ~]# systemctl is-active firewalld networkmanager crond

unknown

inactive

active

[root@oldboyedu ~]# systemctl is-enabled firewalld networkmanager crond

disabled

disabled

enabled

#關閉selinux

[root@m01 ~]# grep =disable /etc/selinux/config

selinux=disabled

[root@m01 ~]# setenforce 0

[root@m01 ~]# getenforce

permissive

[root@m01 ~]# egrep -n '^(gssapia|usedns)' /etc/ssh/sshd_config 

79:gssapiauthentication no

115:usedns no

[root@m01 ~]# systemctl restart sshd.service

export ps1="[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\h\[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$ "
檢視yum源

yum repolist
centos 7系統預設的源更新

curl -o /etc/yum.repos.d/centos-base.repo
增加epel源

curl -o /etc/yum.repos.d/epel.repo
yum install -y tree vim wget bash-completion   bash-completion-extras  lrzsz net-tools sysstat iotop iftop htop unzip  telnet  ntpdate
[root@m01 ~]# grep michaelni  /etc/sudoers

michaelni all=(all) nopasswd: all

10.0.1.5 172.16.1.5 lb01

10.0.1.6 172.16.1.6 lb02

10.0.1.7 172.16.1.7 web01

10.0.1.8 172.16.1.8 web02

10.0.1.9 172.16.1.9 web03

10.0.1.31 172.16.1.31 nfs

10.0.1.41 172.16.1.41 backup

10.0.1.51 172.16.1.51 db01

10.0.1.61 172.16.1.61 m01

10.0.1.71 172.16.1.71 zabbix

# yum安裝ntpdate

[root@m01 ~]# yum install -y ntpdate

# 設定系統時區為上海

[root@m01 ~]# timedatectl set-timezone asia/shanghai

# 每5分中同步一次時間

[root@m01 ~]# crontab -e

*/5 * * * * /usr/sbin/ntpdata ntp1.aliyun.com

網絡卡**

模板機優化

優化網絡卡1 vi etc sysconfig network scripts ifcfg eth0 type ethernet bootproto none defroute yes name eth0 device eth0 onboot yes ipaddr 10.0.0.200 prefix...

c 模板機制

一 函式的模板 函式模板其實就是乙個模子,用這個模子可以澆注出許多功能相同 引數型別和返回型別不同函式,從而實現 的重用。一般的模板是template,當然新標準c 又增加了乙個關鍵字typename,可以替換class,如 template 為了向下相容,不建議用typename。廢話少說,上程式...

模板機安裝初始

目錄具體的安裝過程略過,要注意幾個點即可 最小化安裝,不要忘記安裝開發工具 更改核心,讓網絡卡名字成為了eth開頭的 net.ifnames 0 biosdevname 0 分割槽時採用三分區 boot swap 根,虛擬機器就不要用lvm了 在安裝的過程當中設定網路位址,點選自動連線 ifconf...