# PXE + TFTP boot problem

## srd

I'm having an issue PXE booting from another host. I can TFTP as localhost or from other machine from the command line, but the diskless appears to not be able to download the kernel upon boot, even though it seems to be getting the IP just fine. Any ideas?

This is the error that appears on the diskless nodes console.

```
PXE-E32: TFTP open time-out
```

Here are the master nodes configs.

/etc/conf.d/in.tftpd

```
INTFTPD_PATH="/diskless"

INTFTPD_OPTS="-R 4096:32767 -v -s ${INTFTPD_PATH}"

```

/diskless/pxelinux.cfg/default

```
DEFAULT /gentoo-x86_64/boot/kernel-3.14.14-gentoo

APPEND ip=dhcp ro rootfstype=nfs root=/dev/nfs nfsroot=10.0.0.100:/diskless/gentoo-x86_64 init=/linuxrc

```

Master node /var/log/messages. The diskless nodes seems to be getting through to the master node to get the IP.

```
Nov 6 18:38:30 winky dhcpd: DHCPDISCOVER from 00:AA:73:D9:24:22 via eno1

Nov 6 18:38:30 winky dhcpd: DHCPOFFER on 10.0.1.1 to 00:AA:73:D9:24:22

via eno1

Nov 6 18:38:34 winky dhcpd: DHCPDISCOVER from 00:AA:73:D9:24:22 via eno1

Nov 6 18:38:34 winky dhcpd: DHCPOFFER on 10.0.1.1 to 00:AA:73:D9:24:22

via eno1

Nov 6 18:38:38 winky dhcpd: DHCPREQUEST for 10.0.1.1 (10.0.0.100) from

00:13:72:f9:54:41 via eno1

Nov 6 18:38:38 winky dhcpd: DHCPACK on 10.0.1.1 to 00:AA:73:D9:24:22 via eno1

Nov 7 00:38:38 winky in.tftpd[4481]: RRQ from 10.0.1.1 filename pxelinux.0

Nov 7 00:38:40 winky in.tftpd[4483]: RRQ from 10.0.1.1 filename pxelinux.0

Nov 7 00:38:44 winky in.tftpd[4484]: RRQ from 10.0.1.1 filename pxelinux.0

Nov 7 00:38:50 winky in.tftpd[4485]: RRQ from 10.0.1.1 filename pxelinux.0

Nov 7 00:38:58 winky in.tftpd[4487]: RRQ from 10.0.1.1 filename pxelinux.0

Nov 7 00:39:08 winky in.tftpd[4488]: RRQ from 10.0.1.1 filename pxelinux.0

```

Here's the master nodes dhcp config.

/etc/dhcp/dhcpd.conf

```
ddns-update-style none;

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

allow bootp;

subnet 10.0.0.0 netmask 255.255.0.0 {

default-lease-time 86400;

max-lease-time 86400;

option routers 10.0.0.1;

option broadcast-address 10.0.0.255;

option subnet-mask 255.255.0.0;

option domain-name-servers xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx;

option domain-name "mydomain.com";

}

group {

filename "pxelinux.0";

next-server 10.0.0.100;

host node-1 {

hardware ethernet 00:AA:73:D9:24:22;

fixed-address 10.0.1.1;

}

host node-2 {

hardware ethernet 00:DA:43:B2:44:33;

fixed-address 10.0.1.2;

}

}

```

Last edited by srd on Tue Feb 03, 2015 12:58 am; edited 2 times in total

----------

## machspeed

hey srd

I literally had this issue 3 days ago. Check that tftpd is actually running.

I got the same error message, "PXE-E32: TFTP open time-out" and I had foolishly uninstalled my tftpd at some stage. Reinstalled, made sure it was running (simple "ps ajfx") and then my PXE booted systems worked.

----------

## srd

Thanks, but my ftp server is running. I was able to test it locally and from another machine and download the files just fine. But when booting from the diskless node, I receive the following error.

```

PXE-E32: TFTP open time-out

PXE-E32: TFTP open time-out

PXE-E32: TFTP open time-out

PXE-MOF: Exiting Broadcom PXE ROM.

```

Last edited by srd on Wed Jan 21, 2015 12:22 am; edited 1 time in total

----------

## machspeed

Edit: On re-reading everything. Maybe you'll only need to shift the "next-server" line into the subnet section. It may be a case of the PXE loader on the local machine looking to your router at 10.0.0.1 instead of your PXE server at 10.0.0.100

Ah ok, maybe this is an issue of your node locating the file on the server.

I'd assume you have pxelinux.0 in the /diskless directory along with your pxelinux.cfg directory. Pays to double check.

Something else I've noticed is in your dhcpd config, you have a group specified with the filename option there. Can you try adding the filename option directly into the host section? Also, your next-server probably should go into the subnet part.

I'll add part of mine for reference. It's nothing glamorous but it works.

```
allow booting;

ddns-update-style none;

subnet 172.16.1.0 netmask 255.255.255.0 {

    range    172.16.1.251 172.16.1.253;    # IP addresses for servicing

    default-lease-time 3600;

    max-lease-time 36000;

    option domain-name-servers 172.16.1.254,192.168.1.1;

    option routers 172.16.1.254;

    option broadcast-address 172.16.1.255;

    next-server 172.16.1.254;

}

host twilight {

    hardware ethernet 00:1e:0b:2d:d7:d9;

    fixed-address 172.16.1.1;

    server-name "twilight-sparkle";

    filename "pxelinux.0";

}
```

----------

## krinn

https://forums.gentoo.org/viewtopic-p-7592928.html#7592928

----------

## srd

I've still been unable to get these diskless nodes to boot.

The following is from running "tcpdump port 69" on the master.

```

19:25:39.387642 IP 10.0.1.1.2070 > 10.0.0.11.tftp:  27 RRQ "pxelinux.0" octet tsize 0

19:25:41.412420 IP 10.0.1.1.2071 > 10.0.0.11.tftp:  27 RRQ "pxelinux.0" octet tsize 0

19:25:45.421847 IP 10.0.1.1.2072 > 10.0.0.11.tftp:  27 RRQ "pxelinux.0" octet tsize 0

19:25:51.408511 IP 10.0.1.1.2073 > 10.0.0.11.tftp:  27 RRQ "pxelinux.0" octet tsize 0

19:25:59.372434 IP 10.0.1.1.2074 > 10.0.0.11.tftp:  27 RRQ "pxelinux.0" octet tsize 0

19:26:09.317169 IP 10.0.1.1.2075 > 10.0.0.11.tftp:  32 RRQ "pxelinux.0" octet blksize 1456

19:26:45.343473 IP 10.0.1.1.2076 > 10.0.0.11.tftp:  32 RRQ "pxelinux.0" octet blksize 1456

19:27:57.348274 IP 10.0.1.1.2077 > 10.0.0.11.tftp:  32 RRQ "pxelinux.0" octet blksize 1456

19:29:45.328035 IP 10.0.1.1.2078 > 10.0.0.11.tftp:  32 RRQ "pxelinux.0" octet blksize 1456

19:32:09.282724 IP 10.0.1.1.2079 > 10.0.0.11.tftp:  32 RRQ "pxelinux.0" octet blksize 1456

```

@krinn - I followed your link, but I'm not even at the point of trying to get NFS to boot (though I do plan to use NFSv4). My issue is that I cannot get the client to download the kernel, so the kernel hasn't even started loading yet.

This is a new master node. I have done the same thing with an older node thats been running for a while, but a new master node w/ a new install configured the exact same way, I'm having trouble with.

@machspeed - I don't see that I have an issue with the dhcpd config yet. I believe this is strictly related to syslinux, pxe, and tftp. Also, the diskless node is getting the correct ip and at the point of trying to download the kernel.

Note that I can grab the file manually using the below commands to get the files such as pxelinux.0 or even the path with the kernel from another machine. This works find so I know the TFTP server is running correctly.

```
$ tftp 10.0.0.11

$ get pxelinux.0

$ quit

```

----------

## szatox

My working dhcpd config, comments and non-pxe zone striped, the key positions set bold

 *Quote:*   

> ddns-update-style none;
> 
> option domain-name "local";
> 
> default-lease-time 3000;
> ...

 

Also, show us your tftp server's config and the absolute path to pxelinux.0 on your host. It's easy to make a little mistake there that will break pxe but will not break other tftp clients.

It's also pretty important to know what tftp daeomon you use. They might have different variables.

----------

## srd

Here is /etc/conf.d/in.tftpd for tftp-hpa.

```

INTFTPD_PATH="/diskless"

INTFTPD_OPTS="-R 4096:32767 -v -s ${INTFTPD_PATH}"

```

Here is a listing of the contents of /diskless. There exists another copy of the file pxelinux.0 within the directory gentoo-x86_64 in case I had that path misconfigured.

```

drwxr-xr-x 20 root root   4096 Jan 20 19:26 gentoo-x86_64

-rw-r--r--  1 root root 115304 Jan 20 18:59 ldlinux.c32

drwx------  2 root root  16384 Sep  6 10:12 lost+found

-rw-r--r--  1 root root  40577 Jan 12 19:12 pxelinux.0

drwxr-xr-x  3 root root   4096 Jan 20 20:16 pxelinux.cfg

```

Here is dhcpd.conf, the nodes are set as static and here the IP for the master has been changed to 10.0.0.10 as well as in the pxelinux.cfg/default file.

```

ddns-update-style none;

authoritative;

log-facility local7;

allow booting;

allow bootp;

subnet 10.0.0.0 netmask 255.255.0.0 {

    default-lease-time 86400;

    max-lease-time 86400;

    option routers 10.0.0.1;

    option broadcast-address 10.0.0.255;

    option subnet-mask 255.255.0.0;

    option domain-name-servers v.x.y.z, w.x.y.z; 

    option domain-name "x.y.z"; 

}

group {

    next-server 10.0.0.10;

    filename "pxelinux.0";

    # also tried filename as "/gentoo-x86_64/pxelinux.0"

    host node-1 {

        hardware ethernet 00:13:72:F9:54:41;

        fixed-address 10.0.1.1;

    }

    

    # ...

}

```

I'm thinking that dhcp is working because the client shows info like the following when booting and just before the TFTP server times out (as shown above). Also, the fact that the TFTP server shows activity on the correct master node seems to say its gotten past the DHCP config.

```

CLIENT MAX ADDR: xxxxxxxxxxxxxx GUID: xxxxxxxxxxxxxxxxxxxx

CLIENT IP: 10.0.1.1  MASK 255.255.0.0  DHCP IP: 10.0.0.11

GATEWAY IP 10.0.0.1

```

----------

## szatox

I had been using wireshark to sniff on the network traffix during dhcp negotiation. This let's you see at what point things go wrong.

Mine setup is very different

 *Quote:*   

> ddns-update-style none;
> 
> option domain-name "local";
> 
> default-lease-time 3000;
> ...

 

I marked stuff that seems to be most important with bold I am not completly sure about ping-check, but this config does work. Well, your config should work as well, but we can't be sure until you manage to boot with it.

So, let's do some tuning here:

 *Quote:*   

> ddns-update-style none;
> 
> authoritative;
> 
> log-facility local7; 
> ...

 Broadcast address seems to be bad. I think with network IP 10.0/16 it should be 10.0.255.255 rather than 10.0.0.255.

I skipped group tag. If you want to only allow a single host to boot with pxe, then be it. You might consider putting it in global section though. Hosts that are nit interested will simply ignore it

Paths are fine. 

AFAIR i had some problems with getting tftp to work. It's been long time ago and I'm not sure what was wrong, but I finaly installed atftp and put this in config:

 *Quote:*   

> # cat /etc/conf.d/atftp 
> 
> # Config file for tftp server
> 
> rc_net_vn0_need="!net lan" # custom option due to my unusual network setup. In case of doubt you don't want this line one.
> ...

 

You might give it a shot or have a look at https://wiki.debian.org/PXEBootInstall#Set_up_TFTP_server No idea if it's up to date.

 *Quote:*   

> configuration file, /etc/default/tftpd-hpa. There should be no need to modify the following default contents:
> 
>   TFTP_USERNAME="tftp"
> 
>   TFTP_DIRECTORY="/srv/tftp"
> ...

 

Either way, I suggest you launch sniffer and have a look at traffic. Look into those dhcp offers and see where does it point the client for pxelinux.0 file.

----------

## srd

Ugh ... so I replaced the bad broadcast address and made other changes like what you had, but nothing has changed, still seeing the TFTP server timeout.

I also put wireshark on and it looks as if the DHCP server is working fine, 1) because the host is showing the correct DHCP IP address on it's boot screen, and 2) wireshark is showing the Discover, Offer, Request, and Ack between the server and the client node, and 3) /var/log/messages on the server side is showing a RRQ from the proper node ip (as given by DHCP) for the filename /pxelinux.0. 

From what I understand, this line in /var/log/messages is telling me that the client is doing a read request from the tftp server, and it looks correct. The file is there, has read perms ...

```

in.tftpd[5130]: RRQ from 10.0.1.1 filename pxelinux.0

```

Also, I did give atftp a try, but same thing. So I went back to in.tftp because I have this same config working on a much older server.

What it looks like to me is that the client makes a read request (RRQ), but the server is not sending the data packets.

----------

