Linux centos PXE无人值守安装 DHCP+TFTP+FTP+Kickstart
2016-02-28 17:28
429 查看
网络模式:NAT模式(共享主机的IP地址)DHCP / TFTP IP:192.168.220.137HTTP / FTP / NFS IP:192.168.220.137环境搭建:yum install -y tftp-server dhcp system-config-kickstart vsftp xinetd syslinux1.挂载ISO文件然后把光盘中的文件拷贝至/var/ftp/pub中mount /dev/cdrom /media/CentOS/cp -Rf /media/CentOS/* /var/ftp/pub/2. a.将initrd.img pxelinux.0 vmlinuz 拷贝至 /tftpboot目录中mkdir /tftpbootchmod 777 -Rf /tfrpboot/cp /media/CentOS/isolinux/initrd.img /tftpbootcp /media/CentOS/isolinux/vmlinuz /tftpbootcp /usr/share/syslinux/pxelinux.0 /tftpboot ##找到pxelinux.0 文件 (find / -name pxelinux.0)b.将default文件放在/tftpboot/pxelinux.cfg/下mkdir /tftpboot/pxelinux.cfg/cp /var/ftp/pub/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
配置文件参数:1.vi /etc/dhcp/dhcpd.confddns-update-style interim;ignore client-updates;
subnet 192.168.220.0 netmask 255.255.255.0 {
allow booting;
allow bootp;
allow unknown-clients;
option routers 192.168.222.137;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.220.2;
option time-offset -18000; # Eastern Standard Time
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.220.140 192.168.220.150;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.220.137;
filename "pxelinux.0";
}
2.vi /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 /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
3.vi /etc/vsftp/vsftpd.conf
无需改动
4.vi /tftpboot/pxelinux.cfg/default default linuxprompt 1
timeout 30
label linux
kernel vmlinuz
append initrd=initrd.img ks=ftp://192.168.220.137/ks.cfg
5.在桌面环境下配置Kickstart启动X Windows 环境startx配置Kickstartvim /var/ftp/ks.cfg
#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="ftp://192.168.220.137/pub"
# Root password
rootpw --iscrypted $1$CpoBgXT7$AzEBGDew56m/vIUoIH7SU.
# System authorization information
auth --useshadow --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Chongqing
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=100
part swap --fstype="swap" --size=512
part / --fstype="ext4" --grow --size=1
%packages
@debugging
@legacy-unix
@network-file-system-client
@web-server
%end
测试:servcei iptables stopsetenforce 0service dhcpd startservice xinetd startservice vsftpd start以上可完成PXE无人值守安装操作系统错误:如果出现error downloading Kickstart file 解决:/var/ftp/ks.cfg 权限问题 或者 路径问题
配置文件参数:1.vi /etc/dhcp/dhcpd.confddns-update-style interim;ignore client-updates;
subnet 192.168.220.0 netmask 255.255.255.0 {
allow booting;
allow bootp;
allow unknown-clients;
option routers 192.168.222.137;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.220.2;
option time-offset -18000; # Eastern Standard Time
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.220.140 192.168.220.150;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.220.137;
filename "pxelinux.0";
}
2.vi /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 /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
3.vi /etc/vsftp/vsftpd.conf
无需改动
4.vi /tftpboot/pxelinux.cfg/default default linuxprompt 1
timeout 30
label linux
kernel vmlinuz
append initrd=initrd.img ks=ftp://192.168.220.137/ks.cfg
5.在桌面环境下配置Kickstart启动X Windows 环境startx配置Kickstartvim /var/ftp/ks.cfg
#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="ftp://192.168.220.137/pub"
# Root password
rootpw --iscrypted $1$CpoBgXT7$AzEBGDew56m/vIUoIH7SU.
# System authorization information
auth --useshadow --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Chongqing
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=100
part swap --fstype="swap" --size=512
part / --fstype="ext4" --grow --size=1
%packages
@debugging
@legacy-unix
@network-file-system-client
@web-server
%end
测试:servcei iptables stopsetenforce 0service dhcpd startservice xinetd startservice vsftpd start以上可完成PXE无人值守安装操作系统错误:如果出现error downloading Kickstart file 解决:/var/ftp/ks.cfg 权限问题 或者 路径问题
相关文章推荐
- PXE网络装机(有人值守与无人值守安装)
- 搭建PXE服务器,实现无人值守自动安装系统
- 用vsftp快速搭建ftp服务器
- 实现FTP整站上传的批处理代码
- 批处理向FTP上传具有指定属性的文件(增量备份)
- 使用 iisftpdr.vbs 创建 FTP 虚拟目录的方法
- Delphi解析FTP地址的方法
- IIS里FTP多用户设置方法,终于不用Serv-U了
- FTP 服务器关于权限的问题
- IIS FTP PASV模式下更改端口范围的方法
- FTP 常用命令 使用说明
- 通过批处理修改FTP账号和密码
- FTP下载服务器 TYPSoft FTP Server V1.11 简体中文版 下载
- FTP 分类账户设置经验谈
- php实现curl模拟ftp上传的方法
- 批处理bat下载FTP服务器上某个目录下的文件
- php建立Ftp连接的方法
- FTP服务器端软件Serv-U FTP Server 6.4.0.5&0.4 Final 汉化版 下载
- ftp突然直接连接不上了的解决方法
- ftp自动上传脚本分享