pxe啓動再生龍

1.配置DHCP服務器

 

yum -y install dhcp

vi /etc/sysconfig/network-script/ifcfg-eth0

 

需要將BOOTPROTO由DHCP自動分配地址,改爲none或者static。
IPADDR填寫DHCP服務器的地址。
填寫默認網關和子網掩碼,如下圖:

wKioL1X5IiyD1Q0gAACoJw-kSyA457.jpg

 

 

vi /etc/dhcp/dhcpd.conf

 
#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#   see 'man 5 dhcpd.conf'
#
option domain-name-servers  192.168.100.101;
filename  "pxelinux.0";
next-server 10.20.100.32;
default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 10.20.8.0 netmask 255.255.255.0{
       range dynamic-bootp 10.20.8.10 10.20.8.200;
       option broadcast-address 10.20.8.255;
       option routers 10.20.8.1;
}
subnet 10.20.11.0 netmask 255.255.255.0{
       range dynamic-bootp 10.20.11.10 10.20.11.200;
       option broadcast-address 10.20.11.255;
       option routers 10.20.11.1;
}

 

關閉防火牆,設置/etc/selinux/config下SELINUX=disabled

/etc/init.d/network restart

setvice dhcpd restart

 

2.再生龍配置

步驟一:安裝服務

yum –y install syslinux xinetd

yum –y tftp*

mkdir /var/lib/tftpboot/pxelinux.cfg

cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

 

步驟二:啓動TFTP

vi /etc/xinetd.d/tftp

 修改disable =no

server_args是tftp路徑

 wKioL1X5JO3zyhxCAAH6JeMUEFE257.jpg

 

 

vi /etc/dhcp/dhcpd.conf

添加:

filename  "pxelinux.0";

next-server 10.20.100.32

 

/etc/rc.d/init.d/dhcpd restart

service xinetd start

chkconfig xinetd on

 

 

步驟三:

修改pxe的啓動文件

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

 

default menu.c32

prompt 1

timeout 100

 

label 1

menu label ^1) Clonezilla Live (Ramdisk)

KERNEL clonezilla/vmlinuz

APPEND initrd=clonezilla/initrd.img boot=live config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=788 nosplash noprompt fetch=http://10.20.100.32/clonezilla/filesystem.squashfs

 

 

label 2

menu label ^3) Centos 6.6 Install

KERNEL centos_x86_64/vmlinuz

APPEND initrd=centos_x86_64/initrd.img method=http://10.20.100.33/centos_x86_64 devfs=nomount

 

步驟四:

將再生龍需要的三個文件menu.c32,initrd.img和vmlinuz傳到tftpboot路徑下(這個可以從再生龍官網上下載)

 

步驟五:

傳輸http://10.20.100.32/下的文件

 

下載httpd服務 yum –y install httpd

修改/etc/httpd/conf/httpd.conf

添加如下:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/
#    ServerName dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

 

註釋掉/etc/httpd/conf.d/welcome.conf中的所有內容

 

將文件filesystem.squashfs 放在Documentroot下

   

 

步驟五:samba服務(個人需要,不是裝clonezilla必要)

安裝samba服務,yum –y install samba

配置samba服務,vi /etc/samba/smb.conf

在末尾加入

[p_w_picpaths]
comment = Public Stuff
path = /work/p_w_picpaths
valid users = administrator
guest ok = no
create mode = 0770
directory mode = 0770
share modes = yes
writable = yes
printable = no
[p_w_picpaths0]
comment = Public Stuff
path = /work/p_w_picpaths0
valid users = administrator
guest ok = no
create mode = 0770
directory mode = 0770
share modes = yes
writable = yes
printable = no

給valid用戶創建密碼

Useradd administrator

Passwd   administrator

smbpasswd -a administrator

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章