linux 7.0 FTP,RHEL7.0 DHCP+TFTP+SYSLINUX+FTP+KICKSTART自动安装

一、配置DHCP服务器

安装软件包

[root@LiuZhen ~]# rpm -qa dhcp

[root@LiuZhen ~]# yum install dhcp

[root@LiuZhen ~]# cat /etc/dhcp/dhcpd.conf

#

# DHCP Server Configuration file.

# see /usr/share/doc/dhcp*/dhcpd.conf.example

# see dhcpd.conf(5) man page

#

option domain-name "LiuZhen.com"; //hostname

option domain-name-servers 192.168.220.222; //server IP

default-lease-time 600;                                                        //租用时间

max-lease-time 7200;

log-facility local7;

allow booting;                                                                       //pexlinux 使用

allow bootp;                                                                         //pexlinux 使用

subnet 192.168.220.0 netmask 255.255.255.0 {

range 192.168.220.100 192.168.220.200;                                  //动态获得IP范围

option routers 192.168.221.1;                                                     //网关

next-server 192.168.220.222;                                                   //pexlinux 使用

filename "pxelinux.0";                                                                 //pexlinux 使用

}

重启DHCP服务

[root@LiuZhen ~]# service dhcpd restart

Redirecting to /bin/systemctl restart dhcpd.service

设置开机自动启动DHCP服务

[root@LiuZhen ~]# chkconfig dhcpd on

Note: Forwarding request to 'systemctl enable dhcpd.service'.

ln -s '/usr/lib/systemd/system/dhcpd.service' '/etc/systemd/system/multi-user.target.wants/dhcpd.service'

设置防火墙停止限制DHCP服务

[root@LiuZhen ~]# firewall-cmd --permanent --add-service=dhcp

success

重新启动防火墙

[root@LiuZhen ~]# service firewalld restart

Redirecting to /bin/systemctl restart firewalld.service

二、配置TFTP服务

检查tftp包是否存在

[root@LiuZhen ~]# rpm -qa tftp

yum安装tftp

[root@LiuZhen ~]# yum install tftp

安装超级守护进程

[root@LiuZhen xinetd.d]# rpm -qa xinetd

[root@LiuZhen xinetd.d]#

[root@LiuZhen xinetd.d]# yum install xinetd

[root@LiuZhen xinetd.d]# rpm -qa tftp-server

[root@LiuZhen xinetd.d]# yum install tftp-server

[root@LiuZhen xinetd.d]#

查看配置文件

[root@LiuZhen xinetd.d]# cat /etc/xinetd.d/tftp

# default: off

# description: The tftp server serves files using the trivial file transfer \

#        protocol. The tftp protocol is often used to boot diskless \

#        workstations, download configuration files to network-aware printers, \

#        and to start the installation process for some operating systems.

service tftp

{

socket_type                = dgram

protocol                = udp

wait                        = yes

user                        = root

server                        = /usr/sbin/in.tftpd

server_args                = -s /var/lib/tftpboot

disable                        = yes

per_source                = 11

cps                        = 100 2

flags                        = IPv4

}

修改yes 为no

25d318ebe1ef8abf10568e604e9a6832.png

[root@LiuZhen xinetd.d]# service xinetd restart

Redirecting to /bin/systemctl restart xinetd.service

设置防火墙

34d0da240f51368acdaea507f869dbe7.png

三、配置syslinux

检查包是否安装

0252e7d659c737daa99204d1fdc53bd0.png

安装包

c9d7250b68996d635e2a14a9ae8f1c1a.png

拷贝以下文件到目录下

03c8a7dc619ebb87ed699dfa51e4dfa1.png

048f9f6a53ae6bb1b32ce25240f930d4.png

5ac04a7ac23af9b21fff60506f141f3a.png

c0c3b0cebed286b87d7138270ee3428b.png

修改配置文件

/var/lib/tftpboot/pxelinux.cfg/default

将所有 =hd:LABEL=RHEL-7.0 都改成=ftp://192.168.220.222

可使用命令替换

sed -i "/inst.stage2/s/=hd:LABEL=RHEL-7.0\\\x20Server.x86_64/=ftp:\/\/192.168.220.222/" /var/lib/tftpboot/pxelinux.cfg/default

四、配置VSFTP服务

安装软件包

566f303a3ab6210b55307a7472219a26.png

配置服务和防火墙

54fb98d241149def27eb68b5d380c8eb.png

将操作系统介质拷贝到FTP目录下

[root@LiuZhen tftpboot]# cp -r /mnt/* /var/ftp

配置完成,可以测试是否可以进入安装

新建空虚拟机,使用hostonly网段,启动测试

测试可以出现引导安装界面,继续配置kickstart,实现无人值守安装

07e5b78f35d1e8536159e4efe15372cd.png

五、配置KICKSTART

拷贝系统默认配置文件,并给与权限

7a61e995aed8eb1f109c481f6bf162af.png

安装软件包

[root@LiuZhen vsftpd]# rpm -q system-config-kickstart

package system-config-kickstart is not installed

[root@LiuZhen vsftpd]#

[root@LiuZhen vsftpd]# yum -y install system-config-kickstart

修改配置文件/var/ftp/pub/ks.cfg

none改成all

3b31b6144f06cfe128458b81d54d5bcb.png

修改配置文件/var/lib/tftpboot/pxelinux.cfg/default

将quiet改为

dca125113f10b6a0035e2c5d68be970e.png

f8f77c20e00e1ebb0116b39074d66d87.png

配置完成,测试效果,启动两个虚拟机一起自动安装测试

8ad335e204aa199c6c7414c1d075caea.png

安装过程有点慢,配置完成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值