cobbler dhcp安裝系統

 

    cobbler服務器準備工作:掛載centos5.5的鏡像。(本機環境IP192.168.0.220+64)

    上次ISO文件至服務器:

     

        [root@dbops1 www]#       ll /data/ISO/

        total 4294960

        -rw-r--r-- 1 root root 4393730048 Mar 21  2011 CentOS_5.5_Final_x64.iso

       掛載ISO文件

       /bin/mount -o loop /data/ISO/CentOS_5.5_Final_x64.iso /data/yum/iso_files/

    由於centos5.5默認安裝沒有rpmforge,所以需要下載rpm包。

    wget ftp://ftp.univie.ac.at/systems/linux/dag/redhat/el5/en/x86_64/dag/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

    安裝所需包:

    yum install cobbler tftp-server dhcp httpd xinetd

     

    cobbler check

    修改 /var/lib/cobbler/settings //把兩處127.0.0.1ip改爲虛擬機提供dhcptftpip 17行的manage_dhcp 0改爲1

     

    vi /var/lib/cobbler/settings

    ---

    bootloaders:

        ia64: /var/lib/cobbler/elilo-3.6-ia64.efi

        standard: /usr/lib/syslinux/pxelinux.0

    default_kickstart: /etc/cobbler/default.ks

    dhcpd_bin: /usr/sbin/dhcpd

    dhcpd_conf: /etc/dhcpd.conf

    dnsmasq_bin: /usr/sbin/dnsmasq

    dnsmasq_conf: /etc/dnsmasq.conf

    httpd_bin: /usr/sbin/httpd

    kernel_options:

        ksdevice: eth0

        lang: ' '

        syslog: '192.168.0.220:25150'

        text: ~

    koan_path: ''

    manage_dhcp: 1

    manage_dhcp_mode: isc

    minimize_syncs: 1

    next_server: '192.168.0.220'

    server: '192.168.0.220'

    syslog_port: 25150

    tftpboot: /tftpboot

    tftpd_bin: /usr/sbin/in.tftpd

    tftpd_conf: /etc/xinetd.d/tftp

    webdir: /var/www/cobbler

    xmlrpc_port: 25151

    yum_core_mirror_from_server: 0

     

    修改 /etc/xinetd.d/tftp //把第14行的= yes 改爲= no

    vi /etc/xinetd.d/tftp

    service tftp

    {

            socket_type             = dgram

            protocol                = udp

            wait                    = yes

            user                    = root

            server                  = /usr/sbin/in.tftpd

            server_args             = -s /tftpboot

            disable                 = no

            per_source              = 11

            cps                     = 100 2

            flags                   = IPv4

    }

     

    yum install system-config-kickstart

    //圖形化界面執行,生成kickstart的配置文件

    保存在/etc/cobbler目錄文件內容如下

    vim /etc/cobbler/default.ks

    #platform=x86, AMD64, or Intel EM64T

     

    # System authorization information

     

    auth

    --useshadow

    --enablemd5

     

    # System bootloader configuration

     

    bootloader --location=mbr

     

    # Clear the Master Boot Record

     

    zerombr

     

    # Partition clearing information

     

    clearpart --all --initlabel

     

    # Use graphical install

     

    graphical

     

    # Firewall configuration

     

    firewall --disabled

     

    # Run the Setup Agent on first boot

     

    firstboot --disable

     

    #platform=x86, AMD64, or Intel EM64T

     

    # System authorization information

     

    auth

    --useshadow

    --enablemd5

     

    # System bootloader configuration

     

    bootloader --location=mbr

     

    # Clear the Master Boot Record

     

    zerombr

     

    # Partition clearing information

     

    clearpart --all --initlabel

     

    # Use graphical install

     

    graphical

     

    # Firewall configuration

     

    firewall --disabled

     

    # Run the Setup Agent on first boot

     

    firstboot --disable

     

    # System keyboard

     

    keyboard us

     

    # System language

     

    lang en_US

     

    # Installation logging level

     

    logging --level=info

     

    # Use NFS installation media

     

    nfs --server=192.168.0.220 --dir=/

     

    # Network information

     

    network --bootproto=dhcp --device=eth0 --onboot=on

     

    #Root password

     

    rootpw --iscrypted $1$zlwzVSO6$.mAx831sa.sEeK2Mjzkyh/

     

    # SELinux configuration

     

    selinux --disabled

     

    # System timezone

     

    timezone

    Asia/Shanghai

     

    # Install OS instead of upgrade

     

    install

     

    # X Window System configuration information

     

    xconfig

    --defaultdesktop=GNOME --depth=16 --resolution=1024x768

     

    # Disk partitioning information

     

    part swap --bytes-per-inode=4096 --fstype="swap" --size=1024

     

    cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf

    vi /etc/dhcpd.conf

     

     

     

    備註:

    本機IP192.168.0.220

    子網掩碼:255.255.0.0

    網關:192.168.1.1

    ddns-update-style interim;

    ignore client-updates;

     

    subnet 192.168.0.0 netmask 255.255.255.0 {

     

    # --- default gateway

            option routers                  192.168.1.1;

            option subnet-mask              255.255.0.0;

     

            option nis-domain               "domain.org";

            option domain-name              "domain.org";

            option domain-name-servers      192.168.1.1;

     

            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.200 192.168.0.254;

            default-lease-time 21600;

            max-lease-time 43200;

     

            # 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 192.168.1.1;

            }

    }

    vim /etc/cobbler/dhcp.template

    ddns-update-style interim;

     

    allow booting;

    allow bootp;

     

    ignore client-updates;

    set vendorclass = option vendor-class-identifier;

     

    subnet 192.168.0.0 netmask 255.255.255.0 {

         option routers          192.168.1.1;

         option subnet-mask      255.255.0.0;

         range dynamic-bootp     192.168.0.200 192.168.0.254;//dhcp範圍

         filename                "/pxelinux.0";

         default-lease-time      21600;

         max-lease-time          43200;

         next-server             $next_server;

    }

     

    $insert_cobbler_system_definitions

    導入鏡像名稱:

    cobbler import --mirror=/data/yum/iso_files/ --name=Centos5.5

     

    cobbler list    //檢查列表

    正常返回

     

    生成並同步所有配置:

    cobbler sync

     

    啓動相關服務:

    service httpd start

    service xinetd start

    service dhcpd start

    service cobblerd start

    注:關閉防火牆,檢查Http是否是80端口。

    服務端到此配置完畢

     

    客戶端

    Workstation新建一臺虛擬機

    選擇網絡啓動

    啓動後會停留在boot

    此時手工輸入menu回車

    然後選擇第二項即可正常安裝。

     

     

    輸入menu

     

    選擇第二個即可!!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章