Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #189204 > unrolled thread

Debian 9 tftp issue

Started byCatalin Soare <lolinux.soare@gmail.com>
First post2017-11-22 21:30 +0100
Last post2017-11-22 21:50 +0100
Articles 8 — 4 participants

Back to article view | Back to linux.debian.user


Contents

  Debian 9 tftp issue Catalin Soare <lolinux.soare@gmail.com> - 2017-11-22 21:30 +0100
    Re: Debian 9 tftp issue Ulf Volmer <u.volmer@u-v.de> - 2017-11-22 21:50 +0100
      Re: Debian 9 tftp issue Catalin Soare <lolinux.soare@gmail.com> - 2017-11-22 22:10 +0100
        Re: Debian 9 tftp issue Ulf Volmer <u.volmer@u-v.de> - 2017-11-22 22:20 +0100
          Re: Debian 9 tftp issue Catalin Soare <lolinux.soare@gmail.com> - 2017-11-22 23:20 +0100
            Re: Debian 9 tftp issue deloptes <deloptes@gmail.com> - 2017-11-22 23:40 +0100
              Re: Debian 9 tftp issue Catalin Soare <lolinux.soare@gmail.com> - 2017-11-23 22:40 +0100
    Re: Debian 9 tftp issue Glenn English <ghe2001@gmail.com> - 2017-11-22 21:50 +0100

#189204 — Debian 9 tftp issue

FromCatalin Soare <lolinux.soare@gmail.com>
Date2017-11-22 21:30 +0100
SubjectDebian 9 tftp issue
Message-ID<uOJOF-4dV-1@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hello everyone,

I am trying to setup a PXE server on a computer on which I've just
installed Debian 9.2.

So I've installed tftpd-hpa, and left the configuration as it was:
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"

But, I can't connect to port 69, from other computers. I'm getting a timeout

This seems very strange, since I can see the tftp service in netstat:

:~$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
     PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
    488/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
    922/exim4
tcp6       0      0 :::22                   :::*                    LISTEN
    488/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN
    922/exim4
udp        0      0 0.0.0.0:68              0.0.0.0:*
     535/dhclient
udp        0      0 0.0.0.0:69              0.0.0.0:*
     1117/in.tftpd
udp        0      0 0.0.0.0:5353            0.0.0.0:*
     465/avahi-daemon: r
udp        0      0 0.0.0.0:1900            0.0.0.0:*
     664/minissdpd
udp        0      0 0.0.0.0:51554           0.0.0.0:*
     465/avahi-daemon: r
udp6       0      0 :::52077                :::*
    465/avahi-daemon: r
udp6       0      0 :::5353                 :::*
    465/avahi-daemon: r

The firewall was left with its defaults on this computer:

:~$ sudo iptables -L -nv
Chain INPUT (policy ACCEPT 968 packets, 96829 bytes)
 pkts bytes target     prot opt in     out     source
 destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source
 destination

Chain OUTPUT (policy ACCEPT 525 packets, 129K bytes)
 pkts bytes target     prot opt in     out     source
 destination


However, if I check the ports from other computers, it seems that nothing's
listening there:

:~$ nc -vz lab 69
lab.home.org [192.168.1.179] 69 (?) : Connection refused
:~$ nc -vz lab 22
lab.home.org [192.168.1.179] 22 (ssh) open

But, if I try to connect from localhost, I can get a test file that I've
created in /srv/tftp/:

:~$ echo "get hello.txt" | tftp 192.168.1.179
tftp> Received 7 bytes in 0.0 seconds
tftp>

Does anybody know what's happening here? What I should check?
Please help me with any suggestions or ideas you might have.

Thank you,


-- 
Regards,
*Catalin Soare <lolinux.soare@gmail.com>*

[toc] | [next] | [standalone]


#189206

FromUlf Volmer <u.volmer@u-v.de>
Date2017-11-22 21:50 +0100
Message-ID<uOK82-4kb-3@gated-at.bofh.it>
In reply to#189204
On 22.11.2017 21:24, Catalin Soare wrote:

> udp        0      0 0.0.0.0:69 <http://0.0.0.0:69>             
> 0.0.0.0:*                           1117/in.tftpd       

> :~$ nc -vz lab 69
> lab.home.org <http://lab.home.org> [192.168.1.179] 69 (?) : Connection
> refused

As you can see in the netstat output, tftpd is using UDP but your netcat
tool tries to connect to 69/tcp. add -u to your nc args.

best regards
Ulf

[toc] | [prev] | [next] | [standalone]


#189208

FromCatalin Soare <lolinux.soare@gmail.com>
Date2017-11-22 22:10 +0100
Message-ID<uOKrp-4G6-35@gated-at.bofh.it>
In reply to#189206

[Multipart message — attachments visible in raw view] — view raw

On Nov 22, 2017 22:42, "Ulf Volmer" <u.volmer@u-v.de> wrote:

On 22.11.2017 21:24, Catalin Soare wrote:

> udp        0      0 0.0.0.0:69 <http://0.0.0.0:69>
> 0.0.0.0:*                           1117/in.tftpd

> :~$ nc -vz lab 69
> lab.home.org <http://lab.home.org> [192.168.1.179] 69 (?) : Connection
> refused

As you can see in the netstat output, tftpd is using UDP but your netcat
tool tries to connect to 69/tcp. add -u to your nc args.

best regards
Ulf


Ah, yes you're right! Thanks!
I wasn't checking it correctly!

Now it says the port is open. This rules out the firewall.

However, this means that even though tftpd-hpa is running, it's not bound
to the port 69? Or at least it's not "listening"; this seems to be what the
netstat output is saying (there's no "listening" on the line with tftpd).

Any ideas if I might have to do any additional configuration for tftpd-hpa?
Or maybe use another tftpd server that has some logging that I could rely
on?

Regards,
Catalin Soare

[toc] | [prev] | [next] | [standalone]


#189209

FromUlf Volmer <u.volmer@u-v.de>
Date2017-11-22 22:20 +0100
Message-ID<uOKB3-4Jf-7@gated-at.bofh.it>
In reply to#189208
On 22.11.2017 22:03, Catalin Soare wrote:
> However, this means that even though tftpd-hpa is running, it's not
> bound to the port 69? Or at least it's not "listening"; this seems to be
> what the netstat output is saying (there's no "listening" on the line
> with tftpd).

That's normal behavior for netstat and UDP ports. My nameserver for example:

tcp        0      0 172.17.170.1:53             0.0.0.0:*
   LISTEN      25         13544      3208/named
udp        0      0 172.17.170.1:53             0.0.0.0:*
               25         13543      3208/named

> Any ideas if I might have to do any additional configuration for
> tftpd-hpa? Or maybe use another tftpd server that has some logging that
> I could rely on?

You can add (multiple) -v switches to TFTP_OPTIONS for turning on more
verbose logging.

best regards
Ulf

[toc] | [prev] | [next] | [standalone]


#189211

FromCatalin Soare <lolinux.soare@gmail.com>
Date2017-11-22 23:20 +0100
Message-ID<uOLx7-5hQ-5@gated-at.bofh.it>
In reply to#189209

[Multipart message — attachments visible in raw view] — view raw

Thank you for that!
Now I can indeed see the files requested by my tests.

Now the funny part is that I've decided to try a VM again, and boot a
netboot.xyz.kpxe file. And that worked!

However, I can still not test to get a file, even with the tftp-hpa client
on the machine where I'm hosting the VM.
Anyway, thank you guys very much! Maybe with time and experiments I'll
figure it out :)

Regards,
Catalin Soare

On Nov 22, 2017 23:15, "Ulf Volmer" <u.volmer@u-v.de> wrote:

> On 22.11.2017 22:03, Catalin Soare wrote:
> > However, this means that even though tftpd-hpa is running, it's not
> > bound to the port 69? Or at least it's not "listening"; this seems to be
> > what the netstat output is saying (there's no "listening" on the line
> > with tftpd).
>
> That's normal behavior for netstat and UDP ports. My nameserver for
> example:
>
> tcp        0      0 172.17.170.1:53             0.0.0.0:*
>    LISTEN      25         13544      3208/named
> udp        0      0 172.17.170.1:53             0.0.0.0:*
>                25         13543      3208/named
>
> > Any ideas if I might have to do any additional configuration for
> > tftpd-hpa? Or maybe use another tftpd server that has some logging that
> > I could rely on?
>
> You can add (multiple) -v switches to TFTP_OPTIONS for turning on more
> verbose logging.
>
> best regards
> Ulf
>
>
>

[toc] | [prev] | [next] | [standalone]


#189212

Fromdeloptes <deloptes@gmail.com>
Date2017-11-22 23:40 +0100
Message-ID<uOLQt-5qa-5@gated-at.bofh.it>
In reply to#189211
Catalin Soare wrote:

> However, I can still not test to get a file, even with the tftp-hpa client
> on the machine where I'm hosting the VM.
> Anyway, thank you guys very much! Maybe with time and experiments I'll
> figure it out :)

I use few virtual and physical machines diskless and they boot via PXE - see
the links below.

1. You have to configure at least dhcp and nfs properly.

dhcp

 host vmware3 {
    hardware ethernet 00:50:............;
    fixed-address 192.168..........;
    option host-name "vmware3";
    filename "pxelinux.0";
#tftp server
    next-server 192.168.xxx.xxx;
    option
root-path "192.168.xxx.xxx:/opt/remote/nfsroot/stretch-amd64,retry=3,rsize=8192,wsize=8192";
 }

2. you need to setup the kernel boot parameters

3. and of course have a usable initram disk image


https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt 
https://help.ubuntu.com/community/DisklessUbuntuHowto
https://wiki.archlinux.org/index.php/Diskless_system
https://www.gadgetdaily.xyz/use-css3-transforms-and-transitions-to-create-subtle-image-zooms/


good luck

[toc] | [prev] | [next] | [standalone]


#189234

FromCatalin Soare <lolinux.soare@gmail.com>
Date2017-11-23 22:40 +0100
Message-ID<uP7nY-2gu-9@gated-at.bofh.it>
In reply to#189212

[Multipart message — attachments visible in raw view] — view raw

Thanks for the hints, however, I am trying to learn how to setup an iPXE
boot menu with Debian, some utilities (maybe some .ISO) and possibly
windows.
To be honest, I've only setup a simple PXE server which worked before, but
this seems very much uncharted territory for me.
Pretty hard to find all things I need in one place, and in a readable form
for beginners.

Any suggestions are very appreciated.

Best regards,

On Thu, Nov 23, 2017 at 12:37 AM, deloptes <deloptes@gmail.com> wrote:

> Catalin Soare wrote:
>
> > However, I can still not test to get a file, even with the tftp-hpa
> client
> > on the machine where I'm hosting the VM.
> > Anyway, thank you guys very much! Maybe with time and experiments I'll
> > figure it out :)
>
> I use few virtual and physical machines diskless and they boot via PXE -
> see
> the links below.
>
> 1. You have to configure at least dhcp and nfs properly.
>
> dhcp
>
>  host vmware3 {
>     hardware ethernet 00:50:............;
>     fixed-address 192.168..........;
>     option host-name "vmware3";
>     filename "pxelinux.0";
> #tftp server
>     next-server 192.168.xxx.xxx;
>     option
> root-path "192.168.xxx.xxx:/opt/remote/nfsroot/stretch-amd64,retry=3,
> rsize=8192,wsize=8192";
>  }
>
> 2. you need to setup the kernel boot parameters
>
> 3. and of course have a usable initram disk image
>
>
> https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
> https://help.ubuntu.com/community/DisklessUbuntuHowto
> https://wiki.archlinux.org/index.php/Diskless_system
> https://www.gadgetdaily.xyz/use-css3-transforms-and-
> transitions-to-create-subtle-image-zooms/
>
>
> good luck
>
>


-- 
Regards,
*Catalin Soare <lolinux.soare@gmail.com>*

[toc] | [prev] | [next] | [standalone]


#189207

FromGlenn English <ghe2001@gmail.com>
Date2017-11-22 21:50 +0100
Message-ID<uOK82-4kb-5@gated-at.bofh.it>
In reply to#189204
On Wed, Nov 22, 2017 at 8:24 PM, Catalin Soare <lolinux.soare@gmail.com> wrote:

> Does anybody know what's happening here? What I should check?

iptables??

--
Glenn English

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web