rhelcentos7安装设置ip地址,dns,主机名,防火墙,端口,selinux(实测 笔记) 下载本文

内容发布更新时间 : 2024/9/19 22:32:03星期一 下面是文章的全部内容请认真阅读。

RHELCentos 7 安装 设置 IP地址,DNS,主机名,防火墙,端

口,SELinux (实测+笔记)

环境:系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡)系统版本:

CentOS-7.0-1406-x86_64-DVD.iso 安装步骤:1.虚拟系统安装1.1 使用VMware 虚拟机,读入ISO进行安装。启动后进行安装界面1.2 选择 Install CentOS7,进行语言选择1.3 选择简体中文,进入信息摘要 1.4 点击\安装位置\,选择系统需要安装到的硬盘,点击“完成”。1.5 点击\网络和主机名\,进行网络设置,设为“开启”,然后点击“完成”。1.6 在“安装信息摘要”界面,点击“开始安装”。1.7 \包安装完成后\,进行设置ROOT密码1.8 设定好Root密码后,在“配置”界面,等待安装包完成安装(共297个),完成后点击“结束配置”。1.9 提示完成后,点击“重启”,重新启动计算机 2.系统环境2.1 更新系统[root@centos ~]# yum update -y重启[root@centos ~]# shutdown -r now 2.2 查看环境[root@centos ~]# cat /etc/redhat-releaseCentOS Linux release 7.0.1406 (Core)[root@centos ~]# uname -aLinux localhost.localdomain 3.10.0-123.4.2.el7.x86_64 #1 SMP Mon Jun 30 16:09:14 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux 2.3 安装常用的包[root@centos ~]# yum -y

install vim wget lsof gcc gcc-c++ net-tools bind-utils bzip2 3.系统设置3.1 时间设置当前时间查看[root@centos ~]# date 时间设置[root@centos ~]# date -s \主机名设置当前主机名查看[root@centos ~]# hostname主机名设置[root@centos ~]# vim /etc/sysconfig/network在打开的文件中增加以下内容hostname tCentos7:wq 保存退出 [root@centos ~]# service network restart[root@centos ~]# hostnametCentos7 3.3 IP设置当前IP查看 (ifconfig默认没有安装,需要安装net-tools包)[root@centos ~]# ifconfig显示的以下内容表示,当前有“ens192”及“ens224”两张网卡ens192:

flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.30 netmask 255.255.255.0 broadcast 192.168.1.255 inet6

fe80::250:56ff:fe94:631b prefixlen 64 scopeid

0x20<link> ether 00:50:56:94:63:1b txqueuelen 1000 (Ethernet) RX packets 158 bytes 15474 (15.1 KiB) RX errors 0 dropped 7 overruns 0 frame 0 TX packets 104 bytes 14836 (14.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0ens224:

flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether 00:50:56:94:74:3f txqueuelen 1000

(Ethernet) RX packets 86 bytes 7309 (7.1 KiB) RX errors 0 dropped 6 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo:

flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0[root@centos ~]# vim

/etc/sysconfig/network-scripts/ifcfg-ens192 检查HWADDR是否对就MAC地址,修改以下内容 BOOTPROTO,增加IPADDR,NETMASK,

GATEWAYHWADDR=\et\es\6INIT=\yes\V6_FAILURE_FATAL=\acb-4277-4846-ad83-c6d2a9b27e35\DDR=\