博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Redhat PXE服务器配置-待验证
阅读量:5242 次
发布时间:2019-06-14

本文共 3701 字,大约阅读时间需要 12 分钟。

 

1.配置yum源
vim /etc/yum.repos.d/development.repo
[development]
name=yum server
baseurl=file:///mnt
enabled=1
gpgcheck=0
2.挂载光盘
mount /dev/sr0 /mnt
3.安装相关软件包
yum install dhcp syslinux xinetd tftp-server
4.配置dhcp
vim /etc/dhcp/dhcpd.conf
5.添加内容
subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.91 192.168.1.120;                                                 //ip地址池
  option domain-name-servers 192.168.1.1;                                     //网管地址
  option domain-name "internal.example.org";
  option routers 192.168.1.1;                                                             //网关地址
  option broadcast-address 192.168.1.255;
  next-server 192.168.1.31;                                                              //ftp服务器地址
  filename "pxelinux.0";
  default-lease-time 600;
  max-lease-time 7200;
}
6.启动服务和开机自启动
systemctl start dhcpd.service
systemctl enable dhcpd.service
7.复制启动文件
cd /var/lib/tftpboot/                                                                                               #进入/var/lib/tftpboot/
cp /mnt/isolinux/initrd.img /var/lib/tftpboot                                                           #复制initrd.img到/var/lib/tftpboot目录下
cp /mnt/isolinux/vmlinuz /var/lib/tftpboot/                                                            #复制vmlinuz到/var/lib/tftpboot目录下
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/                                              #复制pxelinux.0到/var/lib/tftpboot目录下
cp /mnt/isolinux/vesamenu.c32 /var/lib/tftpboot/                                                 #复制vesamenu.c32到/var/lib/tftpboot目录下
cp /mnt/isolinux/boot.msg /var/lib/tftpboot/                                                        #复制boot.msg到/var/lib/tftpboot目录下
cd /var/lib/tftpboot/                                                                                             #进入/var/lib/tftpboot目录下
mkdir pxelinux.cfg                                                                                             #在/var/lib/tftpboot目录下创建pxelinux.cfg目录
cd pxelinux.cfg/                                                                                                 #进入pxelinux.cfg目录下
cp /mnt/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default                     #复制isolinux.cfg到pxelinux.cfg目录下并命名为default
vim default                                                                                                       #在/var/lib/tftpboot/pxelinux.cfg目录下修改default文件
label PXE-linux
  menu label ^Install System from PXE-RHEL7.0
  menu default
  kernel vmlinuz
  append initrd=initrd.img ks=ftp://192.168.1.31/ks.cfg ksdevice=eno16777736 ip=dhcp quiet
8.配置tftp-server syslinux
vim /etc/xinetd.d/tftp
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
9.启动服务和开机自启动
systemctl start xinetd.service
systemctl enable xinetd.service
10.安装配置VSFTP
yum -y install vsftpd                       
cp -rf /mnt/* /var/ftp/pub/                    
11.启动服务
systemctl start vsftpd
systemctl enable vsftpd
12.无图形界面配置kickstart一键安装应答文件
vim /var/ftp/ks.cfg
#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'# Reboot after installation
reboot
# Root password
rootpw --iscrypted $1$FyasdJen$q2zUDfVq.ln1FmIlP8O/m0                       //root密码为7788521
# System timezone
timezone Asia/Shanghai
# Use network installation
url --url="ftp://192.168.1.31/pub"
# System language
lang en_US
# Firewall configuration
firewall --disabled
# Network information
network  --bootproto=dhcp --device=eno16777736
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# SELinux configuration
selinux --disabled
 
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part swap --asprimary --fstype="swap" --size=2048
part /boot --asprimary --fstype="xfs" --size=500
part / --asprimary --fstype="xfs" --grow --size=1
 
%packages
@base
 
%end
图形化系统可以安装Kickstart
1.安装Kickstart
yum -y install system-config-kickstart.noarch
2.启动Kickstart软件
system-config-kickstart
13.修改SELinux状态
vim /etc/sysconfig/selinux
SELINUX=disabled
14.开放防火墙服务和端口
firewall-cmd --permanent --add-service=dhcp
firewall-cmd --permanent --add-service=vsftpd
firewall-cmd --permanent --add-port=69/udp
firewall-cmd --permanent --add-port=111/tcp
firewall-cmd --permanent --add-port=111/udp
firewall-cmd --permanent --add-port=20048/tcp
firewall-cmd --permanent --add-port=20048/udp
firewall-cmd --reload
 
 

转载于:https://www.cnblogs.com/brucelan/p/6723222.html

你可能感兴趣的文章
getopt_long
查看>>
TensorFlow MNIST CNN 代码
查看>>
javascript之Style物
查看>>
JSON跨域解决方案收集
查看>>
SSH框架整合总结
查看>>
图的深度优先遍历
查看>>
C# 之 提高WebService性能大数据量网络传输处理
查看>>
md5sum命令详解
查看>>
[bzoj1004] [HNOI2008] Cards
查看>>
原生HttpClient详细使用示例
查看>>
几道面试题
查看>>
Factory Design Pattern
查看>>
python中贪婪与非贪婪
查看>>
guava API整理
查看>>
无锁编程笔记
查看>>
jquery mobile
查看>>
如何在vue单页应用中使用百度地图
查看>>
Springboot使用步骤
查看>>
Spring属性注入
查看>>
Springboot-配置文件
查看>>