linux的mtftp服务,linux下通过pxe安装系统

步骤为:

配置dhcp服务器

配置tftp服务器

配置nfs服务器

配置boot文件

1、配置dhcp

通过自带rpm包安装,然后vi /etc/dhcpd.conf

#

# DHCP Server Configuration file.

#   see /usr/share/doc/dhcp*/dhcpd.conf.sample

#

ddns-update-style interim;

ignore client-updates;

option space PXE;

option PXE.mtftp-ip               code 1 = ip-address;

option PXE.mtftp-cport            code 2 = unsigned integer 16;

option PXE.mtftp-sport            code 3 = unsigned integer 16;

option PXE.mtftp-tmout            code 4 = unsigned integer 8;

option PXE.mtftp-delay            code 5 = unsigned integer 8;

option PXE.discovery-control      code 6 = unsigned integer 8;

option PXE.discovery-mcast-addr   code 7 = ip-address;

class "pxeclients" {

match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";

option vendor-class-identifier "PXEClient";

vendor-option-space PXE;

# At least one of the vendor-specific PXE options must be set in

# order for the client boot ROMs to realize that we are a PXE-compliant

# server.  We set the MCAST IP address to 0.0.0.0 to tell the boot ROM

# that we can't provide multicast TFTP (address 0.0.0.0 means no

# address).

option PXE.mtftp-ip 0.0.0.0;

# This is the name of the file the boot ROMs should download.

filename "pxelinux.0";

# This is the name of the server they should get it from.

next-server 192.168.1.99;

}

subnet 192.168.1.0 netmask 255.255.255.0 {

# --- default gateway

option routers                  192.168.1.1;

option subnet-mask              255.255.255.0;

#       option nis-domain               "domain.org";

option domain-name              "domain.org";

option domain-name-servers      61.139.2.69;

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.1.10 192.168.1.30;

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 00:0C:29:54:03:D2;

fixed-address 192.168.1.99;

}

host linux {

hardware ethernet 00:0C:29:EA:04:FC;

fixed-address 192.168.1.22;

}

}

2、配置tftp

使用自带的rpm包安装xinetd和tftp,然后vi /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

}

3、配置nfs

一般有,vi /etc/exports

/media/cdrom *(ro,sync)

4、启动配置的服务

service dhcpd start

service xinetd start

service nfs start

5、配置boot启动镜像

将启动光盘的/media/cdrom/isolinux下所有文件复制到/tftpboot下

将/usr/lib/syslinux/pxelinux.0复制到/tftpboot下

创建目录pxelinux.cfg

将isolinux.cfg移动到pxelinux.cfg目录下名称为default

6、检测各个服务是否启动

(1)dhcpd

端口udp 67应该打开了

使用windows检测

(2)tftp

本机 tftp localhost

tftp>get 文件

windows: tftp ip get 文件

(3)nfs

exportsfs -av

ok,远程使用pxe启动后,一切安装就按照nfs方式安装就好了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值