1.常用软件安装
yum install vim iotop bc gcc gcc-c++ glibc glibc-devel pcre \
pcre-devel openssl openssl-devel zip unzip zlib-devel net-tools \
lrzsz tree ntpdate telnet lsof tcpdump wget libevent libevent-devel \
bc systemd-devel bash-completion traceroute firewalld bridge-utils -y
2.CentOS Linux release 7.2.1511 (Core) 修改网卡名
原网卡名为:ifcfg-eno16777736
#1.
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# mv eno16777736 ifcfg-eth0
[root@localhost network-scripts]# vi ifcfg-eth0
NAME=eth0 #修改
DEVICE=eth0 #修改
#2.
[root@localhost ~]# vim /etc/sysconfig/grub
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
#3.
[root@localhost ~]# cd /etc/udev/rules.d
[root@localhost ~]# vi 70-persistent-net.rules
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:44:17:2b",ATTR{type}=="1" ,KERNEL=="eth*",NAME="eth0"
00:0c:29:44:17:2b #为Mac地址
#4.
[root@localhost ~]# reboot
3.内核版本查看
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
4.关闭防火墙/NetworkManager/selinux
#1.
systemctl stop firewalld && systemctl disable firewalld
#2.
systemctl stop NetworkManager && systemctl disable NetworkManager
#3.
sed -i -r 's@(^SELINUX=).*$@\1disabled@' /etc/selinux/config
5.常用yum源
#CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
#CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
#CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo