PXE引导安装Linux

安装TFTP
[root@localhost /]#rpm �Civh tftp-server-*.rpm
[root@localhost /]# rpm -qa|grep tftp
tftp-server-0.39-2
tftp-0.39-2
安装DHCP
[root@localhost /]#rpm �Civh dhcp-3.0.1-10_EL3.i386.rpm
[root@localhost /]# rpm -qa|grep dhcp
dhcpv6_client-0.10-17_EL4
dhcp-3.0.1-59.EL4
配置TFTP
[root@localhost /]# vi /etc/xinetd.d/tftp
disable = no
server_args             = -u nobody -s /tftpboot   // 访问共享目录
配置DHCP
[root@localhost /]# cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf
vi /etc/dhcpd.conf
option domain-name "system.com";        // 加入以下参数
default-lease-time 6000;
max-lease-time 11400;
authourtative;
ddns-update-style ad-hoc;
log-facility local7;
subnet 172.16.0.0 netmask 255.255.0.0{            // 自动分配网段
range 172.16.0.200 172.16.0.250;
option domain-name-servers 172.160.0.69;
option domain-name "system.com";
option netbios-name-servers 172.16.0.13;
option routers 172.16.0.1;
option broadcast-address 172.16.0.255;
default-lease-time 6000;
max-lease-time 11400;
filename "/pxelinux.0";
}
配置PXE网络访问
[root@localhost /]# mkdir tftpboot
[root@localhost /]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/    / / 复制 PXE 引导文件
[root@localhost /]# mount /dev/cdrom /mnt/iso    //挂载CD-ROM
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@localhost /]# cd /mnt/iso/isolinux/    / 复制 linux 光盘的引导文件
[root@localhost isolinux]# ls
boot.cat     initrd.img    memtest      rescue.msg  TRANS.TBL
boot.msg     isolinux.bin  options.msg  snake.msg   vmlinuz
general.msg  isolinux.cfg  param.msg    splash.lss
[root@localhost isolinux]# cp * /tftpboot/
[root@localhost /]# mkdir /tftpboot/pxelinux.cfg
[root@localhost /]# cp /tftpboot/isolinux.cfg /tftpboot/pxelinux.cfg/
[root@localhost /]# mv /tftpboot/pxelinux.cfg/ isolinux.cfg default
配置NFS服务
[root@localhost /]# vi /etc/exports
/mnt/iso 172.16.0.0/24(ro,sync)           // 共享目录 只读 存储到内存
[root@localhost /]# exportfs �Ca      //  激活NFS
[root@localhost /]# service nfs restart
关闭 NFS mountd   [ 失败 ]
关闭 NFS 守护进程: [ 失败 ]
关闭 NFS quotas    [ 失败 ]
关闭 NFS 服务:    [  确定   ]
启动 NFS 服务:    [  确定   ]
关掉 NFS 配额:     [  确定   ]
启动 NFS 守护进程: [  确定   ]
启动 NFS mountd   [  确定   ]
[root@localhost /]# service dhcpd restart
关闭 dhcpd [ 失败 ]
启动 dhcpd [  确定   ]
[root@localhost /]# chkconfig --level 345 xinetd on
[root@localhost /]# chkconfig --level

你可能感兴趣的:(linux,职场,休闲,PXE引导安装Linux)