PXE網絡啓動安裝Linux系統

PXE網絡啓動安裝Linux系統node

(red hat linux enterprises  5.3測試,成功安裝系統) linux


安裝須要DHCPTFTPxinet服務,至於系統的安裝包,能夠使用NFSWEBFTP服務提供,我使用的是NFS。文中紫色的字表明實際操做命令。

首先配置DHCP/etc/dhcpd.conf),這裏我用模板做爲例子來進行配置:

vim /etc/dhcpd.conf

ddns-update-style interim;
ignore client-updates;

subnet 192.168.0.0 netmask 255.255.255.0 {
子網聲明,請根據本身狀況修改

# --- default gateway
option routers 192.168.0.1;
默認網關,請根據本身狀況修改
option subnet-mask 255.255.255.0;
子網掩碼,請根據本身狀況修改

# option nis-domain "domain.org";
NIS域,我沒使用
# option domain-name "domain.org";
DNS域,我沒使用
# option domain-name-servers 192.168.1.1;
DNS服務器地址,我沒使用

option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- 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.0.128 192.168.0.254;
地址池,請根據本身狀況修改
default-lease-time 21600;
默認地址租期,請根據本身狀況修改
max-lease-time 43200;
最長地址租期,請根據本身狀況修改

next-server 192.168.0.1;
我沒使用DNS,因此直接寫IP地址,請根據本身狀況自行修改,PXE文件所在服務器
filename "pxelinux.0";
新添加的

# we want the nameserver to appear at a fixed address
# host ns {
主機聲明,這裏沒有使用,畢竟網絡安裝就是爲了多臺主機同時使用
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# }
}

配置 TFTP(/etc/xinetd.d/tftp)

vim /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
改成no
per_source = 11
cps = 100 2
flags = IPv4
}

以上配置完後重啓服務:
service dhcpd restart 重啓DHCP服務
service xinetd restart 重啓xinet服務

設置開機時自動啓動:
chkconfig --level 35 dhcpd on init級別35的時候啓動DHCP
chkconfig tftp on 自動啓動TFTP
chkconfig --level 35 xinetd on init級別35的時候啓動xinet

配置PXE

複製 /usr/lib/syslinux/pxelinux.0 /tftpboot 目錄中。

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

關於 /tftpboot 目錄,我安裝TFTP時系統自動創建好了,沒有自動創建的,請手工創建此目錄。

mkdir /tftpboot


/tftpboot 目錄中建立 pxelinux.cfg 目錄用來存放配置文件。

mkdir /tftpboot/pxelinux.cfg


複製第一張安裝光盤下 /p_w_picpath/pxeboot/initrd.img vmlinux 複製到 /tftpboot 目錄中。並把 /isolinux/*.msg 也複製到 /tftpboot 目錄中。最後將 /isolinux/isolinux.cfg 複製到 /tftpboot/pxelinux.cfg 目錄中,並更名爲 default

至此,你的PXE服務就配置完成了,固然了,這只是最基本的配置方法,這裏就不說安裝源的配置方法了。
ios

相關文章
相關標籤/搜索