日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

Kickstart+NFS+DHCP+TFTP+PXElinux实现CentOS的网络自动安装

發(fā)布時間:2023/12/20 linux 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Kickstart+NFS+DHCP+TFTP+PXElinux实现CentOS的网络自动安装 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

作者:diege

時間:2012-05-02

第三次整理

一:準(zhǔn)備工作

1:安裝centos系統(tǒng),配置好網(wǎng)絡(luò)

二:安裝各軟件

1:配置yum

2:安裝kickstart

# yum -y install system-config-kickstart.noarch

3:安裝配置nfs

#yum -y install nfs-utils

# vim /etc/exports

/misc/cd 192.168.1.0/24(rw,no_root_squash)

/kickstart 192.168.1.0/24(rw,no_root_squash)

# exportfs -av

4:安裝配置dhcp

# yum –y install dhcp

#cp /usr/share/doc/dhcp*/dhcpd.conf.sample? /etc/dhcpd.conf

#vim ?/etc/dhcpd.conf

ddns-update-style interim;

ignore client-updates;

allow booting;

allow bootp;


subnet 192.168.1.0 netmask 255.255.255.0 {

??????? option routers????????????????? 192.168.1.1;

??????? option subnet-mask????????????? 255.255.255.0;

??????? option domain-name????????????? "domain.org";

??????? option domain-name-servers????? 192.168.1.1;

??????? option time-offset????????????? -18000; # Eastern Standard Time

??????? range dynamic-bootp 192.168.1.150 192.168.1.199;

??????? default-lease-time 21600;

??????? max-lease-time 43200;

??????? next-server 192.168.1.100; #TFTPServerIP

??????? filename "/pxelinux.0"; ?#pxelinux loader文件位置

}

#chkconfig dhcpd on

#etc/init.d/dhcpd start

?

5:安裝TFTP

# yum ?-y install tftp-server.i386

啟動tftp服務(wù)

# chkconfig xinetd on

#/etc/init.d/xinetd start

#chkconfig? tftp on

# chkconfig --list|grep tftp

??????? tftp:?????????? on??????????????????????????????????????

三:配置

1:生存kickstart配置文件

x-downs

# system-config-kickstart

配置

# mkdir /kickstart

# mv ks.cfg /kickstart/ks.cfg

# vim /kickstart/ks.cfg

install

# Installation logging level

logging --level=info

# Use NFS installation media

nfs --server=192.168.1.100 --dir=/misc/cd

lang en_US.UTF-8

keyboard us

#xconfig? --defaultdesktop=GNOME --depth=8 --resolution=640x480

xconfig --startxonboot

#network --device eth0 --bootproto dhcp --hostname centosa.localdomain

network --device eth1 --bootproto static --ip 192.168.1.140 --netmask 255.255.255.0 --hostname centosc.localdomain

#network --bootproto=dhcp --device=eth1 --onboot=on

rootpw --iscrypted $1$SVp5Dkda$/OPOyjn4hYyKk68IW08Y1.

firewall --enabled --port=22:tcp

authconfig --enableshadow --enablemd5

selinux --enforcing

timezone --utc Asia/Shanghai

bootloader --location=mbr

# The following is the partition information you requested

# Note that any partitions you deleted are not expressed

# here so unless you clear all partitions first, this is

# not guaranteed to work

clearpart --none

part /boot --fstype ext3 --size=100 --ondisk=sda

part pv.2 --size=0 --grow --ondisk=sda

volgroup VolGroup00 --pesize=32768 pv.2

logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow

logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=512 --grow --maxsize=1024

%packages

@admin-tools

@base

@core

@development-libs

@development-tools

@dialup

@editors

@gnome-desktop

@games

@graphical-internet

@graphics

@office

@printing

@sound-and-video

@system-tools

@text-internet

@base-x

keyutils

kexec-tools

iscsi-initiator-utils

trousers

fipscheck

device-mapper-multipath

python-imaging

imake

java-1.6.0-openjdk

libsane-hpaio

festival

audit

xorg-x11-server-Xnest

xorg-x11-server-Xvfb

%post

#setup yumn repository

YUM_REPOS_FILE=/etc/yum.repos.d/centos.repo

for d in Cluster ClusterStorage Server VT ;do

cat<<EOF>>${YUM_REPOS_FILE}

[diege-$ozvdkddzhkzd]

Name=diege $ozvdkddzhkzd

baseurl=http://192.168.1.100/download/networkyum/

enabled=1

gpgcheck=0

EOF

Done

2:配置啟動介質(zhì)

# cp /misc/cd/p_w_picpaths/pxeboot/vmlinuz /tftpboot/

# cp /misc/cd/p_w_picpaths/pxeboot/initrd.img /tftpboot/

find / -name pxelinux.0

/usr/lib/syslinux/pxelinux.0

# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/

# mkdir /tftpboot/pxelinux.cfg

# cp /misc/cd/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default

#vim /tftpboot/pxelinux.cfg/default

default autoinstall

prompt 1

timeout 10

display boot.msg

F1 boot.msg

F2 options.msg

F3 general.msg

F4 param.msg

F5 rescue.msg

label linux

? kernel vmlinuz

? append initrd=initrd.img

label text

? kernel vmlinuz

? append initrd=initrd.img text

label ks

? kernel vmlinuz

? append ks initrd=initrd.img

label local

? localboot 1

label memtest86

? kernel memtest

? append –

label autoinstall

? kernel vmlinuz

? append ks=nfs:192.168.1.100:/kickstart/ks.cfg initrd=initrd.img devfs=nomount ramdisk_size=9216 nofb

四、Client安裝CentOS

Client從網(wǎng)卡啟動,默認30秒未做選擇 自動安裝

轉(zhuǎn)載于:https://blog.51cto.com/ipseek/851051

總結(jié)

以上是生活随笔為你收集整理的Kickstart+NFS+DHCP+TFTP+PXElinux实现CentOS的网络自动安装的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。