Centos6.5全自動安裝 vsftpd+dhcp+nfs+tftp_Linux

來源:互聯網
上載者:User

步驟

1、mount /dev/sr0 /media/

2、安裝所需要的軟體

安裝並配置tftp服務

yum install tftp tftp-server vsftpd dhcp syslinux nfs-utilsvim /etc/xinetd.d/tftp      service tftp  {    disable = no    socket_type       = dgram    protocol        = udp    wait          = yes    user          = root    server         = /usr/sbin/in.tftpd    server_args       = -s /var/lib/tftpboot    per_source       = 11    cps           = 100 2    flags          = IPv4  }

配置dhcp

# dhcpd.conf  #  # Sample configuration file for ISC dhcpd  #   allow booting;  allow bootp;    # A slightly different configuration for an internal subnet.  subnet 192.168.1.0 netmask 255.255.255.0 {  range 192.168.1.50 192.168.1.60;  option domain-name-servers KangChangWei;  option domain-name "KangChangWei";  option routers 192.168.1.1;  default-lease-time 600;  max-lease-time 7200;  filename "pxelinux.0";  next-server 192.168.1.101;  }

以上IP可以根據自己所在的網路修改

3、複製所需要的開機檔案

cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot cp /media/images/pxeboot/initrd.img /var/lib/tftpboot/ cp /media/images/pxeboot/vmlinuz /var/lib/tftpboot/mkdir /var/lib/tftpboot/pxelinux.cfg cp /media/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default

編輯
 Vim /var/lib/tftpboot/pxelinux.cfg/default

default linux#default vesamenu.c32prompt 1timeout 600 display boot.msg menu background splash.jpgmenu title Welcome to CentOS 6.5!menu color border 0 #ffffffff #00000000menu color sel 7 #ffffffff #ff000000menu color title 0 #ffffffff #00000000menu color tabmsg 0 #ffffffff #00000000menu color unsel 0 #ffffffff #00000000menu color hotsel 0 #ff000000 #ffffffffmenu color hotkey 7 #ffffffff #ff000000menu color scrollbar 0 #ffffffff #00000000 label linux menu label ^Install or upgrade an existing system menu default kernel vmlinuz append initrd=initrd.img ks=ftp://192.168.1.101/pub/ks.cfglabel vesa menu label Install system with ^basic video driver kernel vmlinuz append initrd=initrd.img xdriver=vesa nomodesetlabel rescue menu label ^Rescue installed system kernel vmlinuz append initrd=initrd.img rescuelabel local menu label Boot from ^local drive localboot 0xfffflabel memtest86 menu label ^Memory test kernel memtest append -

4、共用光碟片

vim /etc/export/media *(ro,sync)

啟動nfs服務

[root@kcw ~]# /etc/init.d/rpcbind restart停止 rpcbind:                       [確定]正在啟動 rpcbind:                     [確定][root@kcw ~]# /etc/init.d/nfs restart關閉 NFS 守護進程:                    [確定]關閉 NFS mountd:                     [確定]關閉 NFS 服務:                      [確定]Shutting down RPC idmapd:                 [確定]啟動 NFS 服務:                      [確定]啟動 NFS mountd:                     [確定]啟動 NFS 守護進程:                    [確定]正在啟動 RPC idmapd:                   [確定]

查看nfs輸出

[root@kcw ~]# showmount -e localhostExport list for localhost:/media *

產生ks.cfg檔案安裝工具

[root@kcw ~]# yum install system-config-kickstart

然後運行

system-config-kickstart

來修改頁面得到自己安裝的用戶端
我這裡省略。。

這有個做好的ks.cfg

內容如下:

#platform=x86, AMD64, or Intel EM64T#version=DEVELkey --skip# Firewall configurationfirewall --disabled# Install OS instead of upgradeinstall# Use network installationnfs --server=192.168.1.101 --dir=/media# Root passwordrootpw --iscrypted $1$9ElloIHk$pO.NfjND/6K88z3CiIvPc.# Network informationnetwork --bootproto=dhcp --device=eth0 --onboot=on# System authorization informationauth --useshadow --passalgo=md5# Use text mode installtext# System keyboardkeyboard us# System languagelang zh_CN# SELinux configurationselinux --disabled# Do not configure the X Window Systemskipx# Installation logging levellogging --level=info# Reboot after installationreboot# System timezonetimezone Asia/Shanghai# System bootloader configurationbootloader --location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart --all # Disk partitioning informationpart swap --size 2048 part /boot --size 200 part pv.01 --size 30000 volgroup vol0 pv.01logvol / --vgname=vol0 --size=25000 --name=root#logvol /home --vgname=vol0 --size=500 --name=home %post#wget ftp://192.168.1.101/pub/yum.repo -P /etc/yum.repos.d/%packages@ Desktop@ Console internet tools@ Desktop Platform@ Development Tools@ General Purpose Desktop@ Graphical Administration Tools@ Internet Browser@ Network file system client@ Printing client@ X Window System@ Chinese Support

注意我這塊root密碼是redhat
我這裡分區時lvm分區根據你的需求也可以修改

然後把ks.cfg放到你的vsftpd預設可以訪問的目錄裡

即:

[root@kcw ~]# cd /var/ftp/pub/[root@kcw pub]# lsks.cfg[root@kcw pub]# pwd/var/ftp/pub


注意先測試你的這個檔案能不能訪問開啟IE
輸入ftp://192.168.1.101/pub/ks.cfg

看能否看到內容!

做完重啟dhcp vsftpd xine xinetd nfs

然後重新開台電腦開機設定從網卡引導看能否啟動成功並且自動安裝

我這塊等待預設600秒 自動安裝

開機引導到boot:時按斷行符號安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.