一、实现虚拟机的“全自动安装”
步骤 ----> yum install systemctl-config-kickstart -y
修改配置文件 vim ks.cfg
用 ksvalidator ks.cfg命令查看有没有语法错误
写脚本!!! --extra-args "ks=http://172.25.12.250/ks.cfg"
测试--〉在浏览器输入 172.25.12.250/ks.cfg
二、dhcp
1.安装
yum install dhcp -y
systemctl start dhcpd
2.生成配置文件
cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf
3.修改配置文件完成配置
vim /etc/dhcp/dhcpd.conf
1 # dhcpd.conf
2 #
3 # Sample configuration file for ISC dhcpd
4 #
5
6 # option definitions common to all supported networks...
7 option domain-name "westos.com"; ##指定域名
8 option domain-name-servers 192.168.43.1; ##指定客户主机获得到的dns
9
10 default-lease-time 600; ##最短租约期
11 max-lease-time 7200; ##最长租约期
27 #subnet 10.152.187.0 netmask 255.255.255.0 { #
28 #}
29
30 # This is a very basic subnet declaration.
31
32 subnet 172.25.254.0 netmask 255.255.255.0 {
33 range 172.25.254.109 172.25.254.200;
34 option routers 172.25.254.9;
35 }
36 行以后的全部删除
4.重启服务
systemctl restart dhcpd
5.测试
拔掉网线测试
测试成功!!!
转载于:https://blog.51cto.com/13362895/1978188