要求能访问所有服务器,用于测试应用环境
root@Client:~# hostname -f-->查看名称
Client.Client.com
root@Client:~# vi /etc/hostname-->更改主机名
Client
root@Client:~# vi /etc/hosts-->更改权限域名
127.0.0.1 localhost 172.16.100.1 Client.Client.com Client-->更改前 172.16.100.1 Client Client-->更改后
root@Client:~# reboot-->重启查看
root@Client:~# hostname -f-->查看名称
root@Client:~# ip addr show | grep inet && ip route-->查看IP地址
inet 127.0.0.1/8 scope host
inet6 ::1/128 scope host
inet 172.16.100.1/24 brd 172.16.100.266 scope global ens33
inet6 fe80::20c:29ff:fe08:ccf9/64 scope link
default via 172.16.100.100 dev ens33 onlink
172.16.100.0/24 dev ens33 proto kernel scope link src 172.16.100.1
root@Client:~# vim /etc/network/interfaces-->编辑network
先对dns文件进行注释
# This file describes the network interfaces available in your system
# and how to activate them.For more information,see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto 10
iface 10 inet loopback
# The primary network interface
allow-hotplug ens33
iface ens33 inet static
address 10.10.100.1/24-->IP地址更改处
address 10.10.100.254-->网关更改处
# dns-* options are implemented by the resolvconf package,if installed
# dns-nameservers 172.16.100.100
# dns-search Client.com
root@Client:~# systemctl restart networking.service-->重启网卡
root@Client:~# ip addr show | grep inet && ip route-->查看IP地址
请为该主机安装支持GNOME桌面环境
root@Client:~# yum groupinstall "GNOME Desktop" "Graphical Administration Tools" -y-->按装GNOME桌面环境
root@Client:~# systemctl set-default graphical.target-->开机启动图形化界面
root@Client:~# reboot-->重启
调整显示分辨率至1280*768
settings-devices-displays-resolution 1280*768
测试DHCP,该主机网卡IPv4地址为自动获取
root@Client:~# yum install -y dhcp-->安装dhcp
root@Client:~# vim /etc/dhcp/dhcpd.conf-->查看可进入选项
root@Client:~# vim /usr/share/doc/dhcp*/dhcpd.conf.example-->进入并修改
:set nu-->显示行数
49 subnet 10.10.100.0 network 255.255.255.0 {
50 range 10.10.100.1 10.10.100.254;
51 option domain-name-servers 10.10.100.1;
52 option domain-name "www.Clent.com";-->记得更改
53 option routers 10.10.100.100;-->网关
}
root@Client:~# systemctl restart dhcpd-->重启dhcp,不报错即成功
root@Client:~# systemctl enable dhcpd-->启动dhcp
root@Client:~# firewall-cmd --permanent --add-service=dhcp-->开启dhcp服务端口
root@Client:~# firewall-cmd --reload
root@Client:~# firewall-cmd --list-all
进行验证检查
root@Client:~# nmtui
编辑连接-编辑-IPv4配置:自动,地址:移除-启用连接-ens先停用后激活
root@Client:~# ifconfig ens33
root@Client:~# ip route
root@Client:~# nslookup
>server
测试dns,安装dnsutils、dig命令行工具
root@Client:~# yum install -y bind-utils bind-->安装dig
root@Client:~# dig www.163.com-->测试dig
一.安装net-tools
su root
yum install -y net-tools
下载之后就可以使用ifconfig了,中间遇到询问就一路Y或者yes之类就可。
二.安装ssh服务
yum install -y openssh-server
三.配置-依次输入。
sudo systemctl start sshd
sudo systemctl status sshd
sudo systemctl enable sshd
看到这个active(running)就基本成功了