在Fedora上建立无盘工作站

1 安装dhcp

yum install dhcp

配置文件/etc/dhcpd.conf如下:

ddns-update-style none;

ignore client-updates;

next-server 192.168.0.3;   //tftp服务器地址

filename "pxelinux.0";    //引导文件

subnet 192.168.0.0 netmask 255.255.255.0 {

        option routers                  192.168.0.1;

        option subnet-mask              255.255.255.0;

        option nis-domain               "domain.org";

        option domain-name              "domain.org";

        option domain-name-servers      192.168.0.2;

        option time-offset              -18000;

        range dynamic-bootp 192.168.0.30 192.168.0.254;

        default-lease-time 21600;

        max-lease-time 43200;

        host ns1{

                hardware ethernet 00:C0:9F:8C:1C:A3;  //客户端mac地址

                fixed-address 192.168.0.4;  //客户端ip地址

        }

        host  ns2{

                 hardware ethernet 00:C0:9F:8E:5E:83;

                 fixed-address 192.168.0.5;

                 }

        host ns3{

                  hardware ethernet 00:C0:9F:7F:9C:A7;

                  fixed-address 192.168.0.6;     

                  }

        host ns4{

                   hardware ethernet 00:C0:9F:8E:60:C8;

                   fixed-address 192.168.0.7;

                 }      

        host ns5 {

                    hardware ethernet 00:C0:9F:8A:53:98;

                    fixed-address 192.168.0.8;

                 }

       host ns6 {

                    hardware ethernet 00:C0:9F:8E:5E:80;

                    fixed-address 192.168.0.9;

                 }

       host ns7 {

                    hardware ethernet 00:C0:9F:8B:93:C4;

                    fixed-address 192.168.0.10;

                }

       host ns8

                {

                    hardware ethernet 00:C0:9F:8B:93:C4;

                    fixed-address 192.168.0.11;                          

                }

       host ns9

                {

                    hardware ethernet 00:C0:9F:8C:1D:E4;

                    fixed-address 192.168.0.12;

                }

       host ns10

                {

                     hardware ethernet 00:C0:9F:8A:53:F6;

                     fixed-address 192.168.0.13;

                }

       host ns11

                {

                     hardware ethernet 00:C0:9F:8C:24:E4;

                     fixed-address 192.168.0.14;

                }

       host ns12

                {

                     hardware ethernet 00:C0:9F:8E:61:08;

                     fixed-address 192.168.0.15;

                 }

       host ns13

                {

                     hardware ethernet 00:C0:9F:8B:93:0A;

                     fixed-address 192.168.0.16;

                 }

       host ns14

                {

                     hardware ethernet 00:C0:9F:8A:55:EB;

                     fixed-address 192.168.0.17;

                 }

       host ns15

                {

                     hardware ethernet 00:C0:9F:8E:5E:FB;

                     fixed-address 192.168.0.18;

                 }

}

2安装tftp

yum install tftp

配置文件/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

}

3 安装syslinux

yum install syslinux

在服务器上建立目录 /tftpboot , 将/usr/lib/syslinux/pxelinux.0拷贝到/tftpboot/, pxelinux.0为启动文件,同时在/tftpboot下新建一个pxelinux.cfg目录,目录下的文件名以客户端的mac值命名,如mac为00c09f8e5e83,则文件命名为01-00-c0-9f-8e-5e-83,其中01为前缀,文件内容如下:

default linux

prompt 0

label linux

kernel bzImage

append init=/sbin/init root=/dev/nfs rw nfsroot=192.168.0.3:/tftpboot/remote ip=192.168.0.6:192.168.0.3:192.168.0.1:255.255.255.0:client3:eth0:off noapic acpi=off

4 安装nfs

 yum install rpcbind

 yum install nfs-utils

配置/etc/exports文件如下:

/tftpboot     *(rw,async,no_all_squash,no_root_squash,no_subtree_check)

用exportfs –r 保存结果

用showmount –e显示配置结果

Export list for localhost.localdomain:

/tftpboot *

5 编译内核

Networking ---> Networking options,选中以下两项:

   [*]     IP: kernel level auto configuration

   [*]     IP: DHCP support

File System ---> Network File Systems,选中以下三项

   [*]    NFS file system support

   [*]    Provide NFSv3 client support

   [*]    Root file system on NFS

客户端网卡驱动

把编译生成的bzImage拷贝到/tftpboot目录下

6 建立文件系统

建立目录/tftpboot/remote

cd /tftpboot/remote

cp  -ap  /bin   .

cp  -ap  /dev   .

cp  -ap  /etc   .

cp  -ap  /home  .

cp  -ap  /lib   .

cp  -ap  /lost+found   .

cp  -ap  /media    .

cp  -ap  /misc     .

cp  -ap  /mnt      .

cp  -ap  /net      .

cp  -ap  /opt      .

cp  -ap  /proc     .

cp  -ap  /root/`ls -a |grep  ‘^\.[^\.]’`   .

cp  -ap  /sbin    .

cp  -ap   /srv    .

cp  -ap   /sys    .

cp  -ap   /tmp    .

cp  -ap   /usr    .

cp  -ap  /var     .

删除/proc中间大于100的数字文件

7 配置文件/tftpboot/remote/etc/fstab

192.168.0.3:/tftpboot/remote    /    nfs   defaults    0    0

none     /proc        proc   defaults     0       0

none    /dev/pts      devpts             gid=5,mode=620      0   0

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值