Difference between revisions of "TFTP"

From ArchWiki
Jump to: navigation, search
(removed parts about tcp_wrappers (deprecated))
(Add configuration for tftpd, removed configuration for dhcpd (unrelated))
Line 1: Line 1:
 
[[Category:Networking (English)]]
 
[[Category:Networking (English)]]
 
{{stub}}
 
  
 
== Introduction ==
 
== Introduction ==
Line 8: Line 6:
 
== Installation ==
 
== Installation ==
 
The first thing is to install all necessary stuff:
 
The first thing is to install all necessary stuff:
  # pacman -S mkpxelinux  tftp-hpa dhcpcd
+
  # pacman -S tftp-hpa
  
 
== Configuration ==
 
== Configuration ==
At first we will create a /etc/dhcpd.conf file. It has to look like this (basic dhcpd config):
+
The configuration for tftpd is in /etc/conf.d/tftpd
 
+
ddns-update-style interim;
+
+
subnet *'''your subnet'''* netmask *'''your netmask'''* {
+
        option routers                  *'''IP of your router'''*;
+
        option subnet-mask              *'''your subnet again'''*;
+
+
        option domain-name              "'''here you can put your domain name if you dont have one take example.com'''";
+
+
        option time-offset              -18000;    # Eastern Standard Time
+
        next-server *'''IP of your machine where dhcpd is running'''*;
+
        filename "pxelinux.0";
+
+
        allow booting;
+
        allow bootp;
+
+
        range *'''the range of ip addresses your dhcpd is allow to take, example: 10.0.0.10 10.0.0.200'''*;
+
}
+
  
Remove the ** from the config.
+
The default configuration is
  
Run <code>mkpxelinux</code>, which will put the required boot files in <code>/var/tftpboot</code>.
+
#
 +
# Parameters to be passed to TFTPD
 +
#
 +
TFTPD_ARGS="-l -s /var/tftpboot"
  
~# mkpxelinux -c=/etc/mkpxelinux.conf
+
The directory /var/tftpdboot is created automatically when tftp-hpa is installed.
  
This will create all images and stuff to boot.
+
== Run ==
 +
Tftpd daemon can be started in one of the three ways.
  
Now we replace the kernel and the initrd.img with the newest from the install iso.
+
1. From /etc/rc.conf
$ wget ftp://ftp.archlinux.org/other/0.8/i686/ftp-0.8-beta2-20070222-i686.iso
+
When the download is finished, we nearly finished.
+
# mount -o loop /where/the/iso/is/located /path/to/mount/
+
# cp /path/to/mount/isolinux/initd.img /var/tftpboot/
+
# cp /path/to/mount/isolinux/vmlinuz /var/tftpboot/
+
  
Now do:
+
Add "tftpd" to the DAEMON line in /etc/rc.conf
# /etc/rc.d/tftpd start
+
  
Note: The tftpd server will fail to start if you disabled ipv6 support in your kernel. You will need to edit /etc/conf.d/tftpd and add --ipv4 to the beginning of the TFTPD_ARGS string.
+
2. From /etc/rc.d
  
And in a terminal:
+
  /etc/rc.d/tftpd start
  # dhcpcd
+
  
Now you can start the PC you want to install.
+
3. From commandline
  
Good Luck!
+
/usr/sbin/tftpd -l -s path/to/folder/to/export.

Revision as of 21:11, 12 August 2011


Introduction

This HOWTO describes how to set up a tftpd server under Arch Linux.

Installation

The first thing is to install all necessary stuff:

# pacman -S tftp-hpa

Configuration

The configuration for tftpd is in /etc/conf.d/tftpd

The default configuration is

#
# Parameters to be passed to TFTPD
#
TFTPD_ARGS="-l -s /var/tftpboot" 

The directory /var/tftpdboot is created automatically when tftp-hpa is installed.

Run

Tftpd daemon can be started in one of the three ways.

1. From /etc/rc.conf

Add "tftpd" to the DAEMON line in /etc/rc.conf

2. From /etc/rc.d

/etc/rc.d/tftpd start

3. From commandline

/usr/sbin/tftpd -l -s path/to/folder/to/export.