1.默认账号及默认密码
Username: root
Password: ChinaSkill22!
Username: skills
Password: ChinaSkill22!
注:若非特别指定,所有账号的密码均为 ChinaSkill22!
2.操作系统配置
所处区域:CST + 8
系统环境语言:English US (UTF-8)
键盘:English US
注意:当任务是配置TLS,请把根证书或者自签名证书添加到受信任区。
控制台登陆后不管是网络登录还是本地登录 ,都按下方欢迎信息内容显示
*********************************
ChinaSkills 2022–CSK
Module C Linux
>>hostname<<
>>OS Version<<
>> TIME <<
*********************************
你作为一个Linux的技术工程师,被指派去构建一个公司的内部网络,要为员工提供便捷、安全稳定内外网络服务。你必须在规定的时间内完成要求的任务,并进行充分的测试,确保设备和应用正常运行。任务所有规划都基于Linux操作系统,请根据网络拓扑、基本配置信息和服务需求完成网络服务安装与测试,网络拓扑图和基本配置信息如下:
1.拓扑图
2.网络地址规划
服务器和客户端基本配置如下表,各虚拟机已预装系统。
ISPSRV(UOS)
-
-
-
- 完全限定域名:ispsrv
- 普通用户/登录密码:skills/ChinaSkill22
- 超级管理员/登录密码:root/ChinaSkill22
- 网络地址/掩码/网关:81.6.63.100/24/无
-
-
AppSrv(Centos)
-
-
-
- 完全限定域名:appsrv.chinaskills.cn
- 普通用户/登录密码:skills/ChinaSkill22
- 超级管理员/登录密码:root/ChinaSkill22
- 网络地址/掩码/网关:192.168.100.100/24/192.168.100.254
-
-
STORAGESRV(Centos)
-
-
-
- 完全限定域名:storagesrv.chinaskills.cn
- 普通用户/登录密码:skills/ChinaSkill22
- 超级管理员/登录密码:root/ChinaSkill22
- 网络地址/掩码/网关:192.168.100.200/24/192.168.100.254
-
-
ROUTERSRV(Centos)
-
-
-
- 完全限定域名:routersrv.chinaskills.cn
- 普通用户/登录密码:skills/ChinaSkill22
- 超级管理员/登录密码:root/ChinaSkill22
- 网络地址/掩码/网关: 192.168.100.254/24/无、192.168.0.254/24/无、81.6.63.254/24/无
-
-
INSIDECLI(Centos)
-
-
-
- 完全限定域名:insidecli.chinaskills.cn
- 普通用户/登录密码:skills/ChinaSkill22
- 超级管理员/登录密码:root/ChinaSkill22
- 网络地址/掩码/网关:DHCP From AppSrv
-
-
OUTSIDECLI(UOS)
-
-
-
- 完全限定域名:outsidecli.chinaskills.cn
- 普通用户/登录密码:skills/ChinaSkill22
- 超级管理员/登录密码:root/ChinaSkill22
- 网络地址/掩码/网关:DHCP From IspSrv
-
-
- 项目任务清单
服务器IspSrv工作任务
- DHCP
-
-
- 为OutsideCli客户端网络分配地址,地址池范围:81.6.63.110-81.6.63.190/24;
- 域名解析服务器:按照实际需求配置DNS服务器地址选项;
- 网关:按照实际需求配置网关地址选项;
-
-
apt install -y isc-dhcp-server 安装服务
Vim /etc/default/isc-dhcp-server 设置 dhcp 服务网卡(一定要先修改)
vim /etc/dhcp/dhcpd.conf 配置 dhcp 服务
systemctl restart isc-dhcpserver 重启 dhcp 服务
客户端通过DHCP模式获取
vim /etc/dhcp/dhcpd.conf 配置 dhcp 信息
- DNS
-
-
- 安装BIND9;
- 配置为DNS根域服务器;
- 其他未知域名解析,统一解析为该本机IP;
- 创建正向区域“chinaskills.cn”;
- 类型为Slave;
- 主服务器为“AppSrv”;
-
-
一、IspSrv
1、安装dns服务
apt -y install bind9 dnsutils
2、默认文件解析
cd /etc/bind/
db.127 #反向区域数据库,用于将ip解析为对应的域名
db.local #正向区域数据库,用于将域名解析为对应的IP地址
named.conf.default-zones #默认区域
named.conf.local #用于定义解析域,也可以直接在named.conf中直接划定解析域
named.conf.options #配置文件,全局选项配置
named.conf #Bind的主配置文件,不包含DNS数据
3、定义解析域
先去vim named.conf.default-zones
复制最后一个zone
将复制的粘贴到最后
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
vim named.conf.loacl
修改为
zone "chinaskills.cn" {
type slave;
file "/etc/bind/db.chinaskills.cn";
masters {81.6.63.254;};
};
zone "test.internet.com" {
type master;
file "/etc/bind/db.test.internet.com";
};
vim named.conf.default-zones
zone "." {
type master;
file "/etc/bind/db.root";
};
ispsrv下的db文件
cp -a db.local db.chinaskills.cn
cp -a db.local db.test.chinaskills.cn
vim db.chinaskills.cn
$TTL 604800
@ IN SOA chinaskills.cn. root.chinaskills.cn. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS appsrv.chinaskills.cn.
appsrv IN A 81.6.63.100
@ IN MX 10 mail
www IN A 81.6.63.100
vim db.test.internet.com
$TTL 604800
@ IN SOA test.internet.com. root.test.internet.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ispsrv.test.internet.com.
ispsrv IN A 81.6.63.100
@ IN MX 10 mail
dns IN A 81.6.63.100
www IN A 81.6.63.100
download IN CNAME appsrv
mail IN A 81.6.63.100
vim db.root
$TTL 604800
@ IN SOA @ none. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS @
@ IN A 81.6.63.100
* IN A 81.6.63.100
4、配置为DNS根域服务器
启用chroot功能,限制bind9在/var/named下运行
#修改在/var/named下运行
vim /etc/default/bind9
OPTIONS="-u bind -t /var/named"
- WEB服务
-
-
- 安装nginx软件包;
- 配置文件名为ispweb.conf,放置在/etc/nginx/conf.d/目录下;
- 网站根目录为/mut/crypt(目录不存在需创建);
- 启用FastCGI功能,让nginx能够解析php请求;
- index.php内容使用Welcome to 2022 Computer Network Application contest!
-
-
安装软件包
apt install nginx php-fpm –y
touch /etc/nginx/conf.d/ispweb.conf
mkdir /mnt/crypt
vim /mnt/crypt/index.php
Welcome to 2022 Computer Network Application contest!
Vi /etc/nginx/conf.d/ispweb.conf
[root@server01 ~]# Vi /etc/nginx/conf.d/ispweb.conf
server {
listen 172.16.100.201:80;
server_name www.chinaskills.cn;
root "/mnt/crypt/";
index index.php;
location ~ .php$ {
root /mnt/crypt/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /mnt/crypt/$fastcgi_sc ript_name;
include fastcgi_params;
}
}
server {
listen 172.16.100.201:443 ssl;
server_name www.chinaskills.cn;
root "/mnt/crypt/";
index index.php;
ssl_certificate "/etc/nginx/ssl/nginx.crt";
ssl_certificate_key "/etc/nginx/ssl/nginx.key";
location ~ .php$ {
root /mnt/crypt/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /mnt/crypt/$fastcgi_sc ript_name;
include fastcgi_params;
}
Systemctl restart nginx
服务器RouterSrv上的工作任务
- DHCP RELAY
-
-
- 安装DHCP中继;
- 允许客户端通过中继服务获取网络地址;
-
-
[root@routeserver ~]# vi /usr/lib/systemd/system/dhcrelay.service