生成ks.cfg 文件需要system-config-kickstart 工具,而此工具依赖于X Windows,所以我们需要安装X Windows 和Desktop 并重启系统,操作如下:
[root@young ~]# yum groupinstall "X window System" [root@young ~]# yum groupinstall Desktop [root@young ~]# reboot 四、安装并配置DHCP [root@young ~]# yum -y install dhcp [root@young ~]# cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf [root@young ~]# vim /etc/dhcp/dhcpd.conf .... option domain-name "young.com"; option domain-name-servers 8.8.8.8; default-lease-time 43200; max-lease-time 86400; log-facility local7; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.230 192.168.1.240; filename "pxelinux.0"; next-server 192.168.1.2; option routers 192.168.1.1; option broadcast-address 192.168.1.255; } ... [root@young ~]# systemctl start dhcpd.service [root@young ~]# ss -unl ... UNCONN 0 0 *:67 *:* ...dhcp程序环境说明:
dhcp server:
dhcp主程序: /usr/sbin/dhcpd IPV4网络: /etc/dhcp/dhcpd.conf /usr/lib/systemd/system/dhcpd.service IPV6网络: /etc/dhcp/dhcpd6.conf /usr/lib/systemd/system/dhcpd6.service dhcrelay: /usr/sbin/dhcrelay /usr/lib/systemd/system/dhcrelay.service 监听的地址和端口: Server: 67/udp Client: 68/udp 配置文件:/etc/dhcp/dhcpd.conf 配置指令: option选项:配置给客户端的相信息 指令:定义dhcp server的工作特性 配置有级别之分: 全局配置 子网配置 主机配置 常用的配置: default-lease-time 600; max-lease-time 7200; option domain-name "search_domain.tld"; option domain-name-servers DNS_SERVER1, DNS_SERVER2, DNS_SERVER3; option routers GW1, GW2, ...; option broadcast-address BROADCAST_ADDRESS; subnet NETWORK netmask MASK { range START_IP END_IP; } 定义网络作用域,即一个子网,主要用于指明地址池; host passacaglia { hardware ethernet 0:0:c0:5d:bd:95; fixed-address IP_ADDR; } 其它指令: filename:指明引导文件名称; next-server:指明引导文件所在的服务器的主机IP; filename “pxelinux.0"; next-server 192.168.1.2; #tftp server 五、安装并配置FTP [root@young ~]# yum -y install vsftpd #安装服务 [root@young ~]# mkdir -pv /var/ftp/pub/centos/7/x86_64/ #创建目录 [root@young ~]# mount -r /dev/sr0 /mnt #挂在系统光盘 [root@young ~]# cp -r /mnt/* /var/ftp/pub/centos/7/x86_64/ #复制光盘仓库,要全部复制会用到其他文件 [root@young ~]# systemctl start vsftpd.service [root@young ~]# ss -tnl ... LISTEN 0 32 :::21 :::* ... [root@young ~]# lftp 192.168.1.2 #查看ftp工作状态是否正常 lftp 192.168.1.2:~> exit [root@young ~]# lftp 192.168.1.2/pub cd ok, cwd=/pub lftp 192.168.1.2:/pub> cd centos/7/x86_64/ lftp 192.168.1.2:/pub/centos/7/x86_64> ls drwxr-xr-x 2 0 0 200704 Dec 24 11:02 Packages dr-xr-xr-x 2 0 0 4096 Dec 24 10:58 repodata