Centos 6 minimal初始化配置

1.关闭防火墙

停止防火墙
service iptables stop
永久关闭防火墙
chkconfig iptables off

[root@6web1 ~]# iptables -F
[root@6web1 ~]# iptables -X
[root@6web1 ~]# /etc/init.d/iptables save

查看防火墙状态
service iptables status

2.关闭selinux

vi /etc/selinux/config
(改disabled)

3.设置网卡

[root@NODE001 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE=eth0			#注意网卡名,文件名,还有ip a 对应的网卡名是否一致
HWADDR=00:0C:29:BA:C0:B6   # 删除mac地址
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no	<---改
BOOTPROTO=static
IPADDR=172.16.14.6
NETMASK=255.255.0.0
GATEWAY=172.16.0.254
DNS1=8.8.8.8

配置好,重启网络服务
# service network restart

虚拟机:
	删掉MAC地址和UUID,克隆
服务器:
	不要删掉MAC地址和UUID

4.安装常用软件

yum install -y vim-enhanced net-tools ftp lftp wget ntpdate setuptool authconfig ntsysv acpid gpm

5.同步时间

# ntpdate ntp1.aliyun.com

# tail /etc/rc.d/rc.local 
ntpdate ntp1.aliyun.com
# chmod +x /etc/rc.d/rc.local

写计划任务,每隔1小时,同步一次时间
	crontab -e
	0 * * * * /usr/sbin/ntpdate ntp1.aliyun.com

6.设置setup

[root@6web1 ~]# setup
	system service 
	关闭 udev-post

7.解决网卡地址自动改变的问题

cd /etc/udev/rules.d/
rm -f 70-persistent-net.rules

使用“cat 70-persistent-net.rules”命令,查看网卡设备名称和mac地址的对应关系。
如果在“70-persistent-net.rules”文件中发现了,某个设备名称和mac地址不对应的现象,可以将此文件直接删除,然后重启系统,就可以了。

8.主机名

[root@6web1 ~]# vi /etc/sysconfig/network
HOSTNAME=6web1
改 = 后边

reboot

故障参考

重启网卡配置时,提示如下信息
Device eth0 does not seem to be present, delaying initialization
检查网卡配置文件名称是否对应,ip是否是没设置过的

发布了57 篇原创文章 · 获赞 3 · 访问量 1015

猜你喜欢

转载自blog.csdn.net/weixin_42502744/article/details/103279929
今日推荐