zoukankan      html  css  js  c++  java
  • CenOS6 nginx+pxe+tftpd+samba/nfs+dhcpd 无盘安装windows & linux

    CenOS6
    nginx+pxe+tftpd+samba/nfs+dhcpd

    无盘安装windows & linux


    参考文档:
    http://www.debian-administration.org/article/478/Setting_up_a_server_for_PXE_network_booting
    https://wiki.ubuntu.com/UEFI/PXE-netboot-install
    http://drbl.sourceforge.net/about/


    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    1.安装软件
    yum -y install nfs-utils samba syslinux tftp tftp-server dhcp

    2.配置网卡(bridge)---kvm等虚拟机需要桥接,这样才能支持pxe
    vim /etc/sysconfig/network-scripts/ifcfg-br0
    DEVICE="br0"
    BOOTPROTO="static"
    NM_CONTROLLED="no"
    ONBOOT="yes"

    IPADDR=192.168.0.1
    NETMASK=255.255.255.0
    GATEWAY=192.168.0.1
    DNS1=192.168.0.1

    TYPE=Bridge
    DELAY=0


    vim /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE="eth0"
    BOOTPROTO="none"
    NM_CONTROLLED="no"
    ONBOOT="yes"

    BRIDGE=br0

    3.配置samba (共享windows安装源)
    mkdir /smb/{win2008,win2012,win7_x64,win7_x86,win8e_x64,win8e_x86,winxp}
    vim /etc/samba/smb.conf

    # This is the main Samba configuration file. You should read the
    # smb.conf(5) manual page in order to understand the options listed
    # here. Samba has a huge number of configurable options (perhaps too
    # many!) most of which are not shown in this example
    #
    # For a step to step guide on installing, configuring and using samba,
    # read the Samba-HOWTO-Collection. This may be obtained from:
    http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
    #
    # Many working examples of smb.conf files can be found in the
    # Samba-Guide which is generated daily and can be downloaded from:
    http://www.samba.org/samba/docs/Samba-Guide.pdf
    #
    # Any line which starts with a ; (semi-colon) or a # (hash)
    # is a comment and is ignored. In this example we will use a #
    # for commentry and a ; for parts of the config file that you
    # may wish to enable
    #
    # NOTE: Whenever you modify this file you should run the command "testparm"
    # to check that you have not made any basic syntactic errors.
    #
    #---------------
    # SELINUX NOTES:
    #
    # If you want to use the useradd/groupadd family of binaries please run:
    # setsebool -P samba_domain_controller on
    #
    # If you want to share home directories via samba please run:
    # setsebool -P samba_enable_home_dirs on
    #
    # If you create a new directory you want to share you should mark it as
    # "samba_share_t" so that selinux will let you write into it.
    # Make sure not to do that on system directories as they may already have
    # been marked with othe SELinux labels.
    #
    # Use ls -ldZ /path to see which context a directory has
    #
    # Set labels only on directories you created!
    # To set a label use the following: chcon -t samba_share_t /path
    #
    # If you need to share a system created directory you can use one of the
    # following (read-only/read-write):
    # setsebool -P samba_export_all_ro on
    # or
    # setsebool -P samba_export_all_rw on
    #
    # If you want to run scripts (preexec/root prexec/print command/...) please
    # put them into the /var/lib/samba/scripts directory so that smbd will be
    # allowed to run them.
    # Make sure you COPY them and not MOVE them so that the right SELinux context
    # is applied, to check all is ok use restorecon -R -v /var/lib/samba/scripts
    #
    #--------------
    #
    #======================= Global Settings =====================================
        
    [global]
        
    # ----------------------- Network Related Options -------------------------
    #
    # workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
    #
    # server string is the equivalent of the NT Description field
    #
    # netbios name can be used to specify a server name not tied to the hostname
    #
    # Interfaces lets you configure Samba to use multiple interfaces
    # If you have multiple network interfaces then you can list the ones
    # you want to listen on (never omit localhost)
    #
    # Hosts Allow/Hosts Deny lets you restrict who can connect, and you can
    # specifiy it as a per share option as well
    #
        workgroup = WORKGROUP
        server string = Samba Server Version %v
        
       netbios name = Jlive
        
       interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
       hosts allow = 127. 192.168.12. 192.168.13.
        
    # --------------------------- Logging Options -----------------------------
    #
    # Log File let you specify where to put logs and how to split them up.
    #
    # Max Log Size let you specify the max size log files should reach
        
        # logs split per machine
        log file = /var/log/samba/log.%m
        # max 50KB per log file, then rotate
        max log size = 50
        
    # ----------------------- Standalone Server Options ------------------------
    #
    # Scurity can be set to user, share(deprecated) or server(deprecated)
    #
    # Backend to store user information in. New installations should
    # use either tdbsam or ldapsam. smbpasswd is available for backwards
    # compatibility. tdbsam requires no further configuration.

        security = user
        passdb backend = tdbsam

    #**********************************************************************#
        username map = /etc/samba/smbusers


    # ----------------------- Domain Members Options ------------------------
    #
    # Security must be set to domain or ads
    #
    # Use the realm option only with security = ads
    # Specifies the Active Directory realm the host is part of
    #
    # Backend to store user information in. New installations should
    # use either tdbsam or ldapsam. smbpasswd is available for backwards
    # compatibility. tdbsam requires no further configuration.
    #
    # Use password server option only with security = server or if you can't
    # use the DNS to locate Domain Controllers
    # The argument list may include:
      password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
    # or to auto-locate the domain controller/s
      password server = *
        
        
       security = domain
       passdb backend = tdbsam
       realm = MY_REALM

       password server =

    # ----------------------- Domain Controller Options ------------------------
    #
    # Security must be set to user for domain controllers
    #
    # Backend to store user information in. New installations should
    # use either tdbsam or ldapsam. smbpasswd is available for backwards
    # compatibility. tdbsam requires no further configuration.
    #
    # Domain Master specifies Samba to be the Domain Master Browser. This
    # allows Samba to collate browse lists between subnets. Don't use this
    # if you already have a Windows NT domain controller doing this job
    #
    # Domain Logons let Samba be a domain logon server for Windows workstations.
    #
    # Logon Scrpit let yuou specify a script to be run at login time on the client
    # You need to provide it in a share called NETLOGON
    #
    # Logon Path let you specify where user profiles are stored (UNC path)
    #
    # Various scripts can be used on a domain controller or stand-alone
    # machine to add or delete corresponding unix accounts
    #
       security = user
       passdb backend = tdbsam
        
       domain master = yes
       domain logons = yes
        
        # the login script name depends on the machine name
       logon script = %m.bat
        # the login script name depends on the unix user used
       logon script = %u.bat
       logon path = \\%L\Profiles\%u
        # disables profiles support by specifing an empty path
       logon path =          
        
       add user script = /usr/sbin/useradd "%u" -n -g users
       add group script = /usr/sbin/groupadd "%g"
       add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u"
       delete user script = /usr/sbin/userdel "%u"
       delete user from group script = /usr/sbin/userdel "%u" "%g"
       delete group script = /usr/sbin/groupdel "%g"
        
        
    # ----------------------- Browser Control Options ----------------------------
    #
    # set local master to no if you don't want Samba to become a master
    # browser on your network. Otherwise the normal election rules apply
    #
    # OS Level determines the precedence of this server in master browser
    # elections. The default value should be reasonable
    #
    # Preferred Master causes Samba to force a local browser election on startup
    # and gives it a slightly higher chance of winning the election
       local master = no
       os level = 33
       preferred master = yes
        
    #----------------------------- Name Resolution -------------------------------
    # Windows Internet Name Serving Support Section:
    # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
    #
    # - WINS Support: Tells the NMBD component of Samba to enable it's WINS Server
    #
    # - WINS Server: Tells the NMBD components of Samba to be a WINS Client
    #
    # - WINS Proxy: Tells Samba to answer name resolution queries on
      behalf of a non WINS capable client, for this to work there must be
      at least one    WINS Server on the network. The default is NO.
    #
    # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
    # via DNS nslookups.
        
       wins support = yes
       wins server = w.x.y.z
       wins proxy = yes
        
       dns proxy = yes
        
    # --------------------------- Printing Options -----------------------------
    #
    # Load Printers let you load automatically the list of printers rather
    # than setting them up individually
    #
    # Cups Options let you pass the cups libs custom options, setting it to raw
    # for example will let you use drivers on your Windows clients
    #
    # Printcap Name let you specify an alternative printcap file
    #
    # You can choose a non default printing system using the Printing option
        
        load printers = yes
        cups options = raw

       printcap name = /etc/printcap
        #obtain list of printers automatically on SystemV
       printcap name = lpstat
       printing = cups

    # --------------------------- Filesystem Options ---------------------------
    #
    # The following options can be uncommented if the filesystem supports
    # Extended Attributes and they are enabled (usually by the mount option
    # user_xattr). Thess options will let the admin store the DOS attributes
    # in an EA and make samba not mess with the permission bits.
    #
    # Note: these options can also be set just per share, setting them in global
    # makes them the default for all shares

       map archive = no
       map hidden = no
       map read only = no
       map system = no
       store dos attributes = yes


    #============================ Share Definitions ==============================
        
    [homes]
        comment = Home Directories
        browseable = no
        writable = yes
       valid users = %S
       valid users = MYDOMAIN\%S
        
    [printers]
        comment = All Printers
        path = /var/spool/samba
        browseable = no
        guest ok = no
        writable = no
        printable = yes
        
    # Un-comment the following and create the netlogon directory for Domain Logons
       [netlogon]
       comment = Network Logon Service
       path = /var/lib/samba/netlogon
       guest ok = yes
       writable = no
       share modes = no
        
        
    # Un-comment the following to provide a specific roving profile share
    # the default is to use the user's home directory
       [Profiles]
       path = /var/lib/samba/profiles
       browseable = no
       guest ok = yes
        
        
    # A publicly accessible directory, but read only, except for people in
    # the "staff" group
       [public]
       comment = Public Stuff
       path = /home/samba
       public = yes
       writable = yes
       printable = no
       write list = +staff


    #######################################################
        [software]
        comment = software for windows&linux
        path = /mnt/software
        browseable = yes
        public = no
        writable = no
        valid users = liujun
        #hosts allow = 192.168.0.0/24 127.0.0.1
        

        [iso]
        comment = Kinds of iso(linux,windows)
        path = /mnt/ISO
        browseable = yes
        public = no
        writable = no
        valid users = liujun
        #hosts allow = 192.168.0.0/24 127.0.0.1

        [main]
        comment = main source
        path = /mnt/main
        browseable = yes
        public = no
        writable = no
        valid users = liujun
        write list = liujun
        #hosts allow = 192.168.0.0/24 127.0.0.1

        [tmp]
        comment = tmp
        path = /mnt/tmp
        browseable = yes
        public = no
        writable = no
        valid users = liujun
        write list = liujun
        #hosts allow = 192.168.0.0/24 127.0.0.1

        [usb]
        comment = usb
        path = /mnt/usb
        browseable = yes
        public = no
        writable = no
        valid users = liujun
        write list = liujun
        #hosts allow = 192.168.0.0/24 127.0.0.1
    #######################################################
        [win7_x86]
        comment = win7_x86 pxe install
        path = /smb/win7_x86
        writable = no
        public = yes

        [win7_x64]
        comment = win7_x64 pxe install
        path = /smb/win7_x64
        writable = no
        public = yes

        [win2008]
        comment = win2008 pxe install
        path = /smb/win2008
        writable = no
        public = yes


    #################################################

        [win8e_x64]
        comment = Win8 Enterprise 64 bit pxe install
        path = /smb/win8e_x64
        writable = no
        public = yes

        [win8e_x86]
        comment = Win8 Enterprise 32 bit pxe install
        path = /smb/win8e_x86
        writable = no
        public = yes

        [win2012]
        comment = win2012 pxe install
        path = /smb/win2012
        writable = no
        public = yes

    #################################################

        [winxp]
        comment = winXP pxe install
        path = /smb/winxp
        writable = no
        public = yes

    #################################################



    可以加上windows/unix用户映射
    cat /etc/samba/smbusers

    # Unix_name = SMB_name1 SMB_name2 ...
    root = administrator admin
    #nobody = guest pcguest smbguest
    liujun = guest pcguest smbguest


    #############################################
    4.nginx安装与配置(用来共享linux镜像及安装源)
    #############################################
    这里建议采用源码来安装,我安装的时候nginx的版本是1.4.1,具体的情况依个人环境而定,详情请访问nginx官方网站nginx.org
    下面是我写的一个自动安装部署脚本,有兴趣的朋友可以参考参考,不足之处还请不吝指教噢!

    ##############################################
    #!/bin/bash
    ##############################################
    #:<<TEST_SYNTAX
    #varnish(memcache)

    #########################################################
    #Check user & group
    #########################################################

    USER=$(cat /etc/passwd|cut -d: -f1 |grep nginx)
    GROUP=$(cat /etc/group|cut -d: -f1 |grep nginx)

    echo "--------------------------------------------"
    echo -e "Check \e[31;1muser & group\e[0m"
    echo ""
    if [ "$GROUP" = "" ];then
        groupadd -r nginx -g 600
        echo -e "\e[32;1mGroup nginx\e[0m is added"
    else
        echo -e "\e[32;1mGroup\e[0m nginx is exist"
    fi

    if [ "$USER" = "" ];then
        useradd -r nginx  -u 600 -g nginx -s /sbin/nologin
        echo -e "\e[32;1mUser nginx\e[0m is added"
    else
        echo -e "\e[32;1mUser\e[0m nginx is exist"
    fi
    echo ""
    echo ""
    echo ""


    #########################################################
    #Install libs developed
    #########################################################
    echo "--------------------------------------------"
    echo -e "Check \e[31;1mlibs developed\e[0m"
    echo ""
    PACKAGE="gcc gcc-c++ autoconf automake make zlib zlib-devel openssl openssl-devel pcre-devel     libxml2-devel libxslt-devel perl-ExtUtils-Embed"
    for i in $PACKAGE
    do
        FLAG=$(rpm -qa|grep -w $i)
        if [ "$FLAG" == "" ];then
            yum -y install $i
        else
            echo -e "\e[32;1m$i\e[0m is installed"
        fi
    done


    #########################################################
    #Building & Install
    #########################################################
    echo ""
    echo "--------------------------------------------"
    echo -e "\e[31;1mWether nginx is installed or not\e[0m"
    echo ""
    which nginx >/dev/null 2>&1
    if [ "$?" != "0" ];then
    echo -e "\e[31;1mInstalling nginx\e[0m \e[34;1m... ...\e[0m"
    sleep 1
    echo ""

    NGINX_SOURCE_FILE=
    NGINX_SOURCE_FILE_VERSION="1.4.1"

    tar -zxvf ${NGINX_SOURCE_FILE:-nginx-${NGINX_SOURCE_FILE_VERSION}.tar.gz} -C /usr/local/src/
    cd /usr/local/src/nginx-${NGINX_SOURCE_FILE_VERSION}
    ./configure    \
      --prefix=/usr/local/nginx                      \
      --sbin-path=/usr/sbin/nginx \
      --conf-path=/etc/nginx/nginx.conf \
      --error-log-path=/var/log/nginx/error_log    \
      --pid-path=/var/run/nginx.pid         \
      --lock-path=/var/lock/subsys/nginx \
      --user=nginx                       \
      --group=nginx                      \
      --with-http_ssl_module             \
      --with-http_realip_module          \
      --with-http_addition_module        \
      --with-http_xslt_module            \
      --with-http_sub_module             \
      --with-http_dav_module             \
      --with-http_flv_module             \
      --with-http_mp4_module             \
      --with-http_gzip_static_module     \
      --with-http_random_index_module    \
      --with-http_secure_link_module     \
      --with-http_degradation_module     \
      --with-http_stub_status_module     \
      --http-log-path=/var/log/nginx/access_log          \
      --http-client-body-temp-path=/var/tmp/nginx/client \
      --http-proxy-temp-path=/var/tmp/nginx/proxy        \
      --http-fastcgi-temp-path=/var/tmp/nginx/fcgi      \
      --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi      \
      --http-scgi-temp-path=/var/tmp/nginx/scgi       

    make && make install

    else
        echo -e "\e[32;1mNginx\e[0m is installed"
        echo ""
    fi

    echo -e "\e[31;1mInstall\e[0m \e[32;1mOK!\e[0m"

    #########################################################
    #Check init.d shell script
    #########################################################
    mkdir -p /var/tmp/nginx/client #Because of a little bug, this directory needs created by yourself

    NGINX_INIT=/etc/init.d/nginx
    cat > $NGINX_INIT <<HELLO
    #!/bin/sh
    #
    # nginx - this script starts and stops the nginx daemon
    #
    # chkconfig:   - 85 15
    # description:  Nginx is an HTTP(S) server, HTTP(S) reverse \
                  proxy and IMAP/POP3 proxy server
    # processname: nginx
    # config:      /etc/nginx/nginx.conf
    # config:      /etc/sysconfig/nginx
    # pidfile:     /var/run/nginx.pid

    # Source function library.
    . /etc/rc.d/init.d/functions

    # Source networking configuration.
    . /etc/sysconfig/network

    # Check that networking is up.
    [ "\$NETWORKING" = "no" ] && exit 0

    nginx="/usr/sbin/nginx"
    prog=\$(basename \$nginx)

    sysconfig="/etc/sysconfig/\$prog"
    lockfile="/var/lock/subsys/nginx"
    pidfile="/var/run/\${prog}.pid"

    NGINX_CONF_FILE="/etc/nginx/nginx.conf"

    [ -f \$sysconfig ] && . \$sysconfig


    start() {
        [ -x \$nginx ] || exit 5
        [ -f \$NGINX_CONF_FILE ] || exit 6
        echo -n "Starting \$prog: "
        daemon \$nginx -c \$NGINX_CONF_FILE
        retval=\$?
        echo
        [ \$retval -eq 0 ] && touch \$lockfile
        return \$retval
    }

    stop() {
        echo -n "Stopping \$prog: "
        killproc -p \$pidfile \$prog
        retval=\$?
        echo
        [ \$retval -eq 0 ] && rm -f \$lockfile
        return \$retval
    }

    restart() {
        configtest_q || return 6
        stop
        start
    }

    reload() {
        configtest_q || return 6
        echo -n "Reloading \$prog: "
        killproc -p \$pidfile \$prog -HUP
        echo
    }

    configtest() {
        \$nginx -t -c \$NGINX_CONF_FILE
    }

    configtest_q() {
        \$nginx -t -q -c \$NGINX_CONF_FILE
    }

    rh_status() {
        status \$prog
    }

    rh_status_q() {
        rh_status >/dev/null 2>&1
    }

    # Upgrade the binary with no downtime.
    upgrade() {
        local oldbin_pidfile="\${pidfile}.oldbin"

        configtest_q || return 6
        echo -n "Upgrading \$prog: "
        killproc -p \$pidfile \$prog -USR2
        retval=\$?
        sleep 1
        if [[ -f \${oldbin_pidfile} && -f \${pidfile} ]];  then
            killproc -p \$oldbin_pidfile \$prog -QUIT
            success \$"\$prog online upgrade"
            echo
            return 0
        else
            failure "\$prog online upgrade"
            echo
            return 1
        fi
    }

    # Tell nginx to reopen logs
    reopen_logs() {
        configtest_q || return 6
        echo -n "Reopening \$prog logs: "
        killproc -p \$pidfile \$prog -USR1
        retval=\$?
        echo
        return \$retval
    }

    case "\$1" in
        start)
            rh_status_q && exit 0
            \$1
            ;;
        stop)
            rh_status_q || exit 0
            \$1
            ;;
        restart|configtest|reopen_logs)
            \$1
            ;;
        force-reload|upgrade)
            rh_status_q || exit 7
            upgrade
            ;;
        reload)
            rh_status_q || exit 7
            \$1
            ;;
        status|status_q)
            rh_\$1
            ;;
        condrestart|try-restart)
            rh_status_q || exit 7
            restart
            ;;
        *)
            echo "Usage: \$0 {start|stop|reload|configtest|status|force-reload|upgrade|restart|reopen_logs}"
            exit 2
    esac

    HELLO

    chmod 755 $NGINX_INIT
    chkconfig --add $(basename $NGINX_INIT)
    chkconfig $(basename $NGINX_INIT) on
    echo ""
    /etc/init.d/nginx start
    /etc/init.d/nginx status
    /etc/init.d/nginx restart




    ##############################
    在/etc/nginx/nginx.conf中只需加上一个别名和一个autoindex on的选项就可以完成介质共享噢!

    #别名
          location /iso {
               alias /var/www/pub/iso;
           }
           location /pub {
                alias /var/www/pub/;
            autoindex on;
            }
    #nginx状态
           location /nginx_status {
            stub_status on;
            access_log off;
            auth_basic "请输入用户名&密码"; #基本密码认证(htpasswd -cm ...)
            auth_basic_user_file /etc/nginx/.htpasswd;
            }



    最后,将iso镜像开机自动挂载

    #
    # /etc/fstab
    # Created by anaconda on Sun Dec 16 05:53:28 2012
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    UUID=332ad6a5-4105-4e02-af82-e24a55c655c8    /boot    ext4    defaults 1 1
    /dev/mapper/vg0-centos         ext4    defaults  1 1
    /dev/mapper/vg1-swap     none  swap    defaults    0 0
    tmpfs                   /dev/shm                tmpfs   defaults        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                   /sys                    sysfs   defaults        0 0
    proc                    /proc                   proc    defaults        0 0
    /dev/sda5 /mnt/ISO    ntfs    defaults 0 0
    /dev/sda6 /mnt/software    ntfs    defaults 0 0
    /dev/sda7 /mnt/main    ntfs    defaults 0 0
    /dev/sda8 /mnt/work    ntfs    defaults 0 0
    /dev/sda9 /mnt/backup    ntfs    defaults 0 0
    /dev/sda14 /mnt/tmp    ntfs    defaults 0 0

    ###############################################################
    #win7
    /mnt/ISO/win7/cn_windows_7_ultimate_x64_dvd_x15-66043.iso /smb/win7_x64 udf defaults,loop    0 0
    /mnt/ISO/win7/cn_windows_7_ultimate_x86_dvd_x15-65907.iso /smb/win7_x86 udf defaults,loop    0 0
    /mnt/ISO/win7/cn_windows_server_2008_r2_standard_enterprise_datacenter_and_web_with_sp1_vl_build_x64_dvd_617396.iso /smb/win2008 udf defaults,loop    0 0

    #win8
    /mnt/ISO/win8/cn_windows_8_enterprise_x64_dvd_917570.iso /smb/win8e_x64 udf defaults,loop     0 0
    /mnt/ISO/win8/cn_windows_8_enterprise_x86_dvd_917682.iso /smb/win8e_x86 udf defaults,loop     0 0
    /mnt/main/iso/windows_server2012_x64.iso /smb/win2012 udf defaults,loop     0 0

    #winXP
    #/mnt/ISO/XP/GHOSTXP_SP2_purge.iso /smb/winxp iso9660 defaults,loop     0 0
    /mnt/ISO/XP/XP_PRO_SP3_purge.iso   /smb/winxp iso9660 defaults,loop     0 0
    ##############################################################


    ############################################################
    #Centos6.3
    /mnt/ISO/linux/centos/CentOS-6.3-x86_64-bin-DVD1.iso /var/www/pub/ftp/centos6.3_1 iso9660 defaults,loop    0 0
    /mnt/ISO/linux/centos/CentOS-6.3-x86_64-bin-DVD2.iso /var/www/pub/ftp/centos6.3_2 iso9660 defaults,loop    0 0

    #Ubuntu12.04
    /mnt/ISO/linux/ubuntu/ubuntu-12.04-server-amd64.iso  /var/www/pub/ftp/ubuntu12.04 iso9660 defaults,loop    0 0

    #Kubuntu12.04
    /mnt/ISO/linux/ubuntu/kubuntu-12.04-dvd-amd64.iso    /var/www/pub/ftp/kubuntu12.04 iso9660 defaults,loop    0 0

    #Debian6.0
    /mnt/ISO/linux/debian/debian-6.0.6-amd64-DVD-1.iso   /var/www/pub/ftp/debian6.0 iso9660 defaults,loop    0 0

    #Red Hat Enterprise Server 6
    /mnt/ISO/linux/redhat/rhel-server-6.2-x86_64-dvd.iso   /var/www/pub/ftp/rhel6.2 iso9660 defaults,loop    0 0

    #Red Hat Enterprise Server 5
    /mnt/ISO/linux/redhat/rhel-server-5.8-x86_64-dvd.iso    /var/www/pub/ftp/rhel5_x64 iso9660 defaults,loop    0 0

    /mnt/main/iso/rhel-server-5.8-i386-dvd.iso /var/www/pub/ftp/rhel5_x86 iso9660 defaults,loop    0 0
    /mnt/main/iso/rhds_x86.iso /var/www/pub/ftp/rhds iso9660 defaults,loop    0 0

    #linuxMINT 13
    /mnt/ISO/linux/mint13_mate_cinnamon_x64.iso    /var/www/pub/ftp/mint iso9660 defaults,loop    0 0

    #BT5
    /mnt/ISO/linux/bt5_r3_x64.iso    /var/www/pub/ftp/bt5 iso9660 defaults,loop    0 0

    #Arch linux
    /mnt/ISO/linux/archlinux-2012.12.01-dual.iso     /var/www/pub/ftp/arch iso9660 defaults,loop    0 0

    #Free BSD 9.0
    /mnt/ISO/linux/freebsd/FreeBSD-9.0-RELEASE-amd64-dvd1.iso /var/www/pub/ftp/freebsd iso9660 defaults,loop    0 0

    可以看到,上面iso太多,而系统默认只开了loop0,loop1...loop7这8个loop设备,所以必需增加loop设备,可以在/etc/rc.local中加入
    #!/bin/sh
    #
    # This script will be executed *after* all the other init scripts.
    # You can put your own initialization stuff in here if you don't
    # want to do the full Sys V style init stuff.

    touch /var/lock/subsys/local


    mknod /dev/loop8 b 7 8
    mknod /dev/loop9 b 7 9
    mknod /dev/loop10 b 7 10
    mknod /dev/loop11 b 7 11
    mknod /dev/loop12 b 7 12
    mknod /dev/loop13 b 7 13
    mknod /dev/loop14 b 7 14
    mknod /dev/loop15 b 7 15
    mknod /dev/loop16 b 7 16
    mknod /dev/loop17 b 7 17
    mknod /dev/loop18 b 7 18
    mknod /dev/loop19 b 7 19
    mknod /dev/loop20 b 7 20
    mknod /dev/loop21 b 7 21
    mknod /dev/loop22 b 7 22
    mknod /dev/loop23 b 7 23
    mknod /dev/loop24 b 7 24
    mknod /dev/loop25 b 7 25

    mount -a

    5.配置dhcp服务器
    vim /etc/dhcp/dhcpd.conf

    # Sample configuration file for ISC dhcpd for Debian
    #
    # Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
    # configuration file instead of this file.
    #
    #
    allow bootp;
    allow booting;
    next-server 192.168.0.1;
    filename "gpxelinux.0";


    pid-file-name "/var/run/dhcp-server/dhcpd.pid";

    # The ddns-updates-style parameter controls whether or not the server will
    # attempt to do a DNS update when a lease is confirmed. We default to the
    # behavior of the version 2 packages ('none', since DHCP v2 didn't
    # have support for DDNS.)
    ddns-update-style none;

    # option definitions common to all supported networks...
    option domain-name "example.org";
    option domain-name-servers ns1.example.org, ns2.example.org;

    default-lease-time 600;
    max-lease-time 7200;

    # If this DHCP server is the official DHCP server for the local
    # network, the authoritative directive should be uncommented.
    #authoritative;

    # Use this to send dhcp log messages to a different log file (you also
    # have to hack syslog.conf to complete the redirection).
    log-facility local7;

    # No service will be given on this subnet, but declaring it helps the
    # DHCP server to understand the network topology.

    #subnet 10.152.187.0 netmask 255.255.255.0 {
    #}

    # This is a very basic subnet declaration.

    #subnet 10.254.239.0 netmask 255.255.255.224 {
    range 10.254.239.10 10.254.239.20;
    option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
    #}

    # This declaration allows BOOTP clients to get dynamic addresses,
    # which we don't really recommend.

    #subnet 10.254.239.32 netmask 255.255.255.224 {
    range dynamic-bootp 10.254.239.40 10.254.239.60;
    option broadcast-address 10.254.239.31;
    option routers rtr-239-32-1.example.org;
    #}

    # A slightly different configuration for an internal subnet.
    #subnet 10.5.5.0 netmask 255.255.255.224 {
    range 10.5.5.26 10.5.5.30;
    option domain-name-servers ns1.internal.example.org;
    option domain-name "internal.example.org";
    option routers 10.5.5.1;
    option broadcast-address 10.5.5.31;
    default-lease-time 600;
    max-lease-time 7200;
    #}

    # A slightly different configuration for an internal subnet.
    subnet 192.168.0.0 netmask 255.255.255.0 {
      range 192.168.0.100 192.168.0.200;
      option domain-name-servers ns1.internal.example.org;
      option domain-name "internal.example.org";
      option routers 192.168.0.1;
      option broadcast-address 192.168.0.255;
      default-lease-time 600;
      max-lease-time 7200;
    }


    # Hosts which require special configuration options can be listed in
    # host statements.   If no address is specified, the address will be
    # allocated dynamically (if possible), but the host-specific information
    # will still come from the host declaration.

    #host passacaglia {
    hardware ethernet 0:0:c0:5d:bd:95;
    filename "vmunix.passacaglia";
    server-name "toccata.fugue.com";
    #}

    # Fixed IP addresses can also be specified for hosts.   These addresses
    # should not also be listed as being available for dynamic assignment.
    # Hosts for which fixed IP addresses have been specified can boot using
    # BOOTP or DHCP.   Hosts for which no fixed address is specified can only
    # be booted with DHCP, unless there is an address range on the subnet
    # to which a BOOTP client is connected which has the dynamic-bootp flag
    # set.
    #host fantasia {
    hardware ethernet 08:00:07:26:c0:a5;
    fixed-address fantasia.fugue.com;
    #}

    # You can declare a class of clients and then do address allocation
    # based on that.   The example below shows a case where all clients
    # in a certain class get addresses on the 10.17.224/24 subnet, and all
    # other clients get addresses on the 10.0.29/24 subnet.

    #class "foo" {
    match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
    #}

    #shared-network 224-29 {
    subnet 10.17.224.0 netmask 255.255.255.0 {
       option routers rtr-224.example.org;
    }
    subnet 10.0.29.0 netmask 255.255.255.0 {
       option routers rtr-29.example.org;
    }
    pool {
       allow members of "foo";
       range 10.17.224.10 10.17.224.250;
    }
    pool {
       deny members of "foo";
       range 10.0.29.10 10.0.29.230;
    }
    #}

    netstat -tunlp|grep :67 看是否有监听

    6.pxe配置
    vim  /etc/xinet.d/tftp                      #将disable=yes必为no
    # 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
    {
        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
    }

    HERE

    /etc/init.d/xinetd restart

    netstat -tunlp|grep :69 看是否有监听

    mkdir /var/lib/tftpboot

    ls /var/lib/tftpboot将会看到类似文件,当然这些依各自情况而定,
    beauty.png
    boot.msg
    gpxelinux.0
    pxelinux.0
    pxelinux.cfg
    syslinux.jpg
    syslinux_splash.jpg
    vesamenu.c32

    arch
    bt5
    centos6.3
    debian
    debian6.0
    debian-installer
    freebsd
    kubuntu12.04
    mint
    rhel5.8_x64
    rhel5.8_x86
    rhel6.2
    ubuntu12.04
    win2008
    win2012
    win7
    win8
    winxp

    最主要的配置文件
    cat /var/lib/tftpboot/pxelinux.cfg/default

    ###################################################################
    default vesamenu.c32
    #prompt 1
    timeout 600

    display boot.msg

    menu clear

    menu background syslinux.jpg
    menu title Welcome to Jlive's install server!

        menu color screen    37;40      #80ffffff #00000000 std
        menu color border    30;44      #400060 #00000000 std
        menu color title    1;36;44    #20ff00 #00000000 std
        menu color unsel    37;44      #ffff00 #00000000 std
        menu color hotkey    1;37;44    #ffffffff #00000000 std
        menu color sel        7;37;40    #ff0000 #20ff8000 all
        menu color hotsel    1;7;37;40  #e0400000 #20ff8000 all
        menu color disabled    1;30;44    #60cccccc #00000000 std
        menu color scrollbar    30;44      #20ff00 #00000000 std
        menu color tabmsg    31;40      #2000ff #00000000 std
        menu color cmdmark    1;36;40    #c000ffff #00000000 std
        menu color cmdline    37;40      #c0ffffff #00000000 std
        menu color pwdborder    30;47      #80ffffff #20ffffff std
        menu color pwdheader    31;47      #80ff8080 #20ffffff std
        menu color pwdentry    30;47      #80ffffff #20ffffff std
        menu color timeout_msg    37;40      #600000 #00000000 std
        menu color timeout    1;37;40    #40ffff #00000000 std
        menu color help        37;40      #c0ffffff #00000000 std
        menu color msg07    37;40      #90ffffff #00000000 std

    ############################################################
    #Default
    ############################################################
       menu color screen    37;40      #80ffffff #00000000 std
       menu color border    30;44      #40000000 #00000000 std
       menu color title    1;36;44    #c00090f0 #00000000 std
       menu color unsel    37;44      #90ffffff #00000000 std
       menu color hotkey    1;37;44    #ffffffff #00000000 std
       menu color sel        7;37;40    #e0000000 #20ff8000 all
       menu color hotsel    1;7;37;40  #e0400000 #20ff8000 all
       menu color disabled    1;30;44    #60cccccc #00000000 std
       menu color scrollbar    30;44      #40000000 #00000000 std
       menu color tabmsg    31;40      #90ffff00 #00000000 std
       menu color cmdmark    1;36;40    #c000ffff #00000000 std
       menu color cmdline    37;40      #c0ffffff #00000000 std
       menu color pwdborder    30;47      #80ffffff #20ffffff std
       menu color pwdheader    31;47      #80ff8080 #20ffffff std
       menu color pwdentry    30;47      #80ffffff #20ffffff std
       menu color timeout_msg    37;40      #80ffffff #00000000 std
       menu color timeout    1;37;40    #c0ffffff #00000000 std
       menu color help        37;40      #c0ffffff #00000000 std
       menu color msg07    37;40      #90ffffff #00000000 std
    ###############################################################


    ###############################################################
    menu include /rhel5.8_x64/default linux    #rhel5.8_x64
    menu include /rhel5.8_x86/default linux    #rhel5.8_x86
    menu include /rhel6.2/default linux    #rhel6.2
    menu include /centos6.3/default linux    #Centos6.3
    menu include /ubuntu12.04/default linux #Ubuntu12.04
    menu include /kubuntu12.04/default linux #Kubuntu12.04
    menu include /debian6.0/default linux    #Debian6.0
    menu include /mint/default linux    #Mint13
    menu include /bt5/default linux        #Bt5
    menu include /arch/default
    menu include /freebsd/default linux    #FreeBSD 9.0

    menu separator

    menu include /win7/default win7_x64    #Win7_x64
    menu include /win8/default win8_x64    #Win7_x64
    menu include /winxp/default winxp    #WinXP
    menu include /win2008/default win2008_x64    #Win7_x64
    menu include /win2012/default win2012_x64    #Win7_x64
    ###############################################################


    ########
    windows
    ########
    cat /var/lib/tftpboot/win7/default

    default /win7/vesamenu.c32
    #prompt 1
    timeout 600

    display /win7/boot.msg

    menu background /win7/win7.png
    menu title Windows 7 Ultimite
    menu color border 0 #ffffffff #00000000
    menu color sel 7 #ffffffff #ff000000
    menu color title 0 #ffffffff #00000000
    menu color tabmsg 0 #ffffffff #00000000
    menu color unsel 0 #ffffffff #00000000
    menu color hotsel 0 #ff000000 #ffffffff
    menu color hotkey 7 #ffffffff #ff000000
    menu color scrollbar 0 #ffffffff #00000000

    label win7_x64
      menu label Win7 (^64 bit)
      menu default
      kernel /win7/memdisk
      append iso raw initrd=/win7/winpe_x64.iso

    label win7_x86
      menu label Win7 (^32 bit)
      kernel /win7/memdisk
      append iso raw initrd=/win7/winpe_x86.iso
    label local
      menu label Boot from ^local drive
      localboot 0xffff

    注意:这里只是把winpe_x64.iso通过pxe发布给客户端,linux下批量装windows我这里选用最简单的办法,就是通过samba共享windows安装镜像,把预先封装好的windows pe通过网络发布,pe再驱动客户端的网卡通过samba来访问安装源。
    不过这里就又出现一个问题,我们的电脑各式各样,网卡也是纷繁复杂,很难做到一个pe驱动所有网卡,所以企业里面一般都是大批采购相同型号的电脑,这样网卡的问题就得到了解决,因为只需要针对该类型的网卡进行pe封装,具体的封装方法请参考windows AIK.
        还有,32位和64位的镜像要分别对应32位和64位的pe镜像,要不然windows镜像中setup.exe运行不了。
    ##############
    ubuntu
    ##############
    cat /var/lib/tftpboot/ubuntu12.04/default

    # D-I config version 2.0
    include /ubuntu12.04/boot-screens/menu.cfg
    default /ubuntu12.04/boot-screens/vesamenu.c32
    prompt 0
    timeout 0

    cat /var/lib/tftpboot/ubuntu12.04/boot-screens/menu.cfg

    menu hshift 13
    menu width 49
    menu margin 8

    menu title Ubuntu 12.04 server LTS
    include /ubuntu12.04/boot-screens/stdmenu.cfg
    include /ubuntu12.04/boot-screens/txt.cfg
    include /ubuntu12.04/boot-screens/gtk.cfg
    menu begin advanced
        menu title Advanced options
        include /ubuntu12.04/boot-screens/stdmenu.cfg
        label mainmenu
            menu label ^Back..
            menu exit
        include /ubuntu12.04/boot-screens/adtxt.cfg
        include /ubuntu12.04/boot-screens/adgtk.cfg
    menu end
    label help
        menu label ^Help
        text help
       Display help screens; type 'menu' at boot prompt to return to this menu
        endtext
        config /ubuntu12.04/boot-screens/prompt.cfg

        
    cat /var/lib/tftpboot/ubuntu12.04/boot-screens/stdmenu.cfg

    menu background /ubuntu12.04/boot-screens/splash.png
    menu color title    * #FFFFFFFF *
    menu color border    * #00000000 #00000000 none
    menu color sel        * #ffffffff #76a1d0ff *
    menu color hotsel    1;7;37;40 #ffffffff #76a1d0ff *
    menu color tabmsg    * #ffffffff #00000000 *
    menu color help        37;40 #ffdddd00 #00000000 none
    menu vshift 12
    menu rows 10
    menu helpmsgrow 15
    # The command line must be at least one line from the bottom.
    menu cmdlinerow 16
    menu timeoutrow 16
    menu tabmsgrow 18
    menu tabmsg Press ENTER to boot or TAB to edit a menu entry


    cat /var/lib/tftpboot/ubuntu12.04/boot-screens/txt.cfg

    default install
    label install
        menu label ^Install
        menu default
        kernel /ubuntu12.04/linux
        append vga=788 initrd=/ubuntu12.04/initrd.gz -- quiet
    label preseed autoinstall
        menu label ^Autoinstall
        kernel /ubuntu12.04/linux
        append video=vesa:ywrap,mtrr vga=788 debian-installer/allow_unauthenticated=true  auto=true url=http://www.jlive.com/preseed/ubuntu12.04.seed initrd=/ubuntu12.04/initrd.gz --
    label cli

        menu label ^Command-line install
        kernel /ubuntu12.04/linux
        append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=788 initrd=/ubuntu12.04/initrd.gz -- quiet



    ###############
    rhel6
    ###############

    default /rhel6.2/vesamenu.c32
    #prompt 1
    timeout 600

    display /rhel6.2/boot.msg

    menu background /rhel6.2/splash.jpg
    menu title Red Hat Enterprise Linux 6.2
    menu color border 0 #ffffffff #00000000
    menu color sel 7 #ffffffff #ff000000
    menu color title 0 #ffffffff #00000000
    menu color tabmsg 0 #ffffffff #00000000
    menu color unsel 0 #ffffffff #00000000
    menu color hotsel 0 #ff000000 #ffffffff
    menu color hotkey 7 #ffffffff #ff000000
    menu color scrollbar 0 #ffffffff #00000000

    label linux
      menu label ^Install or upgrade an existing system
      menu default
      kernel /rhel6.2/vmlinuz
      append initrd=/rhel6.2/initrd.img
    label vesa
      menu label Install system with ^basic video driver
      kernel /rhel6.2/vmlinuz
      append initrd=/rhel6.2/initrd.img xdriver=vesa nomodeset
    label text
      menu label ^Text mode
      kernel /rhel6.2/vmlinuz
      append initrd=/rhel6.2/initrd.img text
    label ks
      menu label ^KS desktop
      kernel /rhel6.2/vmlinuz
      append ks=http://192.168.0.1/ks/rhel6-desktop.cfg initrd=/rhel6.2/initrd.img

    label rescue
      menu label ^Rescue installed system
      kernel /rhel6.2/vmlinuz
      append initrd=/rhel6.2/initrd.img rescue
    label local
      menu label Boot from ^local drive
      localboot 0xffff
    label memtest86
      menu label ^Memory test
      kernel /rhel6.2/memtest
      append -

    rhel5

    default linux
    prompt 1
    timeout 600
    display /rhel5.8_x64/boot.msg

    menu background /beauty.png
    menu title Red Hat Enterprise Linux 5.8 64bit
    menu color border 0 #ffffffff #00000000
    menu color sel 7 #ffffffff #ff000000
    menu color title 0 #ffffffff #00000000
    menu color tabmsg 0 #ffffffff #00000000
    menu color unsel 0 #ffffffff #00000000
    menu color hotsel 0 #ff000000 #ffffffff
    menu color hotkey 7 #ffffffff #ff000000
    menu color scrollbar 0 #ffffffff #00000000

    label linux
      menu label ^Install or upgrade an existing system
      menu default
      kernel /rhel5.8_x64/vmlinuz
      append initrd=/rhel5.8_x64/initrd.img
    label boot
      menu label ^Boot.iso
      kernel /rhel5.8_x64/memdisk
      append iso raw initrd=/rhel5.8_x64/boot.iso

    label vesa
      menu label Install system with ^basic video driver
      kernel /rhel5.8_x64/vmlinuz
      append initrd=/rhel5.8_x64/initrd.img xdriver=vesa nomodeset
    label text
      menu label ^Text mode
      kernel /rhel5.8_x64/vmlinuz
      append initrd=/rhel5.8_x64/initrd.img text
    label ks
      menu label ^KS desktop
      kernel /rhel5.8_x64/vmlinuz
      append ks=http://192.168.0.1/ks/rhel5-desktop.cfg initrd=/rhel5.8_x64/initrd.img
    label rescue
      menu label ^Rescue installed system
      kernel /rhel5.8_x64/vmlinuz
      append initrd=/rhel5.8_x64/initrd.img rescue
    label local
      menu label Boot from ^local drive
      localboot 0xffff
    label memtest86
      menu label ^Memory test
      kernel /rhel5.8_x64/memtest
      append -

    #############
    backtrack5
    #############

    default /bt5/vesamenu.c32
    prompt 0
    timeout 300

    menu title BackTrack 5
    menu background /bt5/splash.png
    menu color title 1;37;44 #c0ffffff #00000000 std

    label linux
      menu label BackTrack ^Text - Default Boot Text Mode
      kernel /bt5/vmlinuz
      append  boot=casper initrd=/bt5/initrd.gz root=/dev/nfs  netboot=nfs nfsroot=192.168.0.1:/var/www/pub/ftp/bt5

    label STEALTH
      menu label BackTrack Stealth - No ^Networking enabled
      kernel /bt5/vmlinuz
      append  boot=casper initrd=/bt5/initrd.gz root=/dev/nfs  netboot=nfs nfsroot=192.168.0.1:/var/www/pub/ftp/bt5 text splash staticip vga=791--


    label FORENSICS
      menu label BackTrack ^Forensics - No Drive or Swap Mount
      kernel /bt5/vmlinuz
      append  boot=casper initrd=/bt5/initrd.gz root=/dev/nfs  netboot=nfs nfsroot=192.168.0.1:/var/www/pub/ftp/bt5 text splash vga=791--

    label BackTrack noDRM - No NVIDIA drm driver
      menu label BackTrack Text - No ^NVIDIA drm driver
      kernel /bt5/vmlinuz
      append  boot=casper initrd=/bt5/initrd.gz root=/dev/nfs  netboot=nfs nfsroot=192.168.0.1:/var/www/pub/ftp/bt5 text splash nomodeset vga=791--

    label debug
      menu label BackTrack ^Debug - Safe Mode
      kernel /bt5/vmlinuz
      append  boot=casper initrd=/bt5/initrd.gz root=/dev/nfs  netboot=nfs nfsroot=192.168.0.1:/var/www/pub/ftp/bt5 text--

    label memtest
      menu label BackTrack ^Memtest - Run memtest
      kernel /bt5/memtest
      append -

    label hd
      menu label ^Hard Drive Boot - boot the first hard disk
      localboot 0x80
      append -

    ####################
    linux mint
    ####################

    default /mint/vesamenu.c32
    #prompt 1
    timeout 600


    menu background /mint/splash.jpg
    menu title linux MINT 13
    menu color border 0 #ffffffff #00000000
    menu color sel 7 #ffffffff #ff000000
    menu color title 0 #ffffffff #00000000
    menu color tabmsg 0 #ffffffff #00000000
    menu color unsel 0 #ffffffff #00000000
    menu color hotsel 0 #ff000000 #ffffffff
    menu color hotkey 7 #ffffffff #ff000000
    menu color scrollbar 0 #ffffffff #00000000


    label linux
      menu label ^Start Linux Mint
      kernel /mint/linux
      append boot=casper initrd=/mint/initrd.gz root=/dev/nfs netboot=nfs nfsroot=192.168.0.1:/var/www/pub/ftp/mint
    menu default

    label memtest
      menu label ^Memory Test
      kernel memtest
    label local
      menu label Boot from ^Local drive
      localboot 0x80
    label rescue
        menu label ^Rescue mode
        kernel /mint/linux
        append boot=casper initrd=/mint/initrd.gz root=/dev/nfs netboot=nfs nfsroot=192.168.0.1:/var/www/pub/ftp/mint rescue/enable=true vga=788


    #################
    freebsd
    #################

    default /freebsd/vesamenu.c32
    #prompt 1
    timeout 600

    display /freebsd/boot.msg

    menu background /beauty.png
    menu title Free BSD 9.0
    menu color border 0 #ffffffff #00000000
    menu color sel 7 #ffffffff #ff000000
    menu color title 0 #ffffffff #00000000
    menu color tabmsg 0 #ffffffff #00000000
    menu color unsel 0 #ffffffff #00000000
    menu color hotsel 0 #ff000000 #ffffffff
    menu color hotkey 7 #ffffffff #ff000000
    menu color scrollbar 0 #ffffffff #00000000

    label freebsd
      menu label FreeBSD 9.0
      kernel /freebsd/memdisk
      append iso raw initrd=/freebsd/bootonly.iso harddisk

    label local
      menu label Boot from ^local drive
      localboot 0xffff

    注意:
        live CD类型的linux发行版,需要nfs来共享,所以要开启nfs,下面是我个人的nfs配置,仅供参考!

    cat /etc/exports

    # /etc/exports: the access control list for filesystems which may be exported
           to NFS clients.  See exports(5).
    #
    # Example for NFSv2 and NFSv3:
    # /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
    #
    # Example for NFSv4:
    # /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
    # /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
    #
    /var/www/pub/ftp/mint  192.168.0.0/24(ro,no_root_squash,sync)
    /var/www/pub/ftp/bt5  192.168.0.0/24(ro,no_root_squash,sync)
    /var/www/pub/ftp/freebsd  192.168.0.0/24(ro,no_root_squash,sync)
    /var/lib/tftpboot/freebsd  192.168.0.0/24(ro,no_root_squash,sync)
    /var/www/pub/ftp/arch  192.168.0.0/24(ro,no_root_squash,sync)


    7.测试
    可以从物理机的pxe引导,我这里用kvm来测试

      yum  -y  install virt-manager

    NOTE: KVM默认不支持桥接模式,需要手动配置,这就是为什么前面要配置桥接的缘故.若还是不能选桥接则自己指定桥接网卡,我试过,没问题。




    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux
    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

    CenOS6 <wbr>nginx+pxe+tftpd+samba/nfs+dhcpd <wbr>无盘安装windows <wbr>& <wbr>linux

  • 相关阅读:
    让VS2010/VS2012添加新类时自动添加public关键字
    Unity+MVC:实现IDependencyResolver接口需要注意的地方
    ISAPI_Rewrite引起的IIS应用程序池崩溃(fatal communication error)
    梦想成现实:用xUnit.net在单元测试中实现构造函数依赖注入
    Entity Framework 实践系列 —— 搞好关系 单相思(单向一对一,onetoone)
    在ASP.NET中运行控制台程序
    Entity Framework 实践系列 —— 搞好关系 两情相悦(双向一对一)
    程序员,用NuGet管理好你的包包
    想爱容易,相处难:当ASP.NET MVC爱上IoC
    操作步骤:用ildasm/ilasm修改IL代码
  • 原文地址:https://www.cnblogs.com/lixuebin/p/10814657.html
Copyright © 2011-2022 走看看