批量部署linux机器(redhat5.4/centos5.3):
命令: cp /usr/share/doc/dhcp*/dhcpd.conf.sample /etc/dhcpd.conf vim /etc/dhcpd.conf #--------------global------------------------------------------ option domain-name-servers 192.168.1.199; ddns-update-style none; default-lease-time 14400; max-lease-time 43200; #----------tftp------------------------------------------ ignore client-updates; allow booting; allow bootp; class "pxeclients"{ match if substring(option vendor-class-identifier,0,9) = "PXEClient"; filename "gpxelinux.0"; next-server 192.168.1.199; } #----------subnet--------------------------------------------- subnet 192.168.1.0 netmask 255.255.255.0 { option routers 192.168.1.1; option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.1.200 192.168.1.254; } 检查文件/var/lib/dhcpd/dhcpd.leases,文件存在即可 如果考虑到安全问题,在多网卡的机器上可以编辑/etc/sysconfig/dhcpd文件来制定DHCP服务在那个设备上启动 命令: vim /etc/sysconfig/dhcpd 编辑内容为: # Command line options here DHCPDARGS=eth0 重启DHCP服务 service dhcpd restart或/etc/rc.d/ini.d/dhcpd restart 3、tftp配置 yum -y install xinetd tftp tftp-server 编辑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 = -u nobody -s /tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 } 重启TFTP服务需要重启xinetd这个守护服务 service xinetd restart 4、nfs配置: yum -y install nfs-utils nfs-utils-lib 编辑NFS的配置文件 命令: vim /etc/exports /tftpboot *(ro,sync) /data/centos5.3 *(ro,sync) 重启nfs服务: service nfs restart service portmap restart 或者可以不必重启整个服务,用下面命令更新NFS服务 exportfs -arv 检查目录设置是否正确: showmount -e localhost 只需要根据自己业务定义cfg文件: /tftpboot/ks下的ceentos5.3.cfg和redhat5.4.cfg #########/tftpboot/pxelinux.cfg/default####### default ct53_32 |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |