Page MenuHomePhabricator

TFTP-Server only listen on 127.0.0.1
Closed, ResolvedPublic

Description

I try to run the TFTP-Server

set service tftp-server directory '/config/user-data/tftpdata/'
set service tftp-server listen-address '192.168.188.103'
vyos@vyos# ss -lun
State  Recv-Q  Send-Q                       Local Address:Port      Peer Address:Port
UNCONN 0       0                                  0.0.0.0:68             0.0.0.0:*
UNCONN 0       0                          192.168.188.103:123            0.0.0.0:*
UNCONN 0       0                                127.0.0.1:123            0.0.0.0:*
UNCONN 0       0                                  0.0.0.0:123            0.0.0.0:*
UNCONN 0       0                                  0.0.0.0:28881          0.0.0.0:*
UNCONN 0       0                                127.0.0.1:69             0.0.0.0:*
UNCONN 0       0                                  0.0.0.0:2942           0.0.0.0:*
UNCONN 0       0          [fe80::a00:27ff:fe2b:c00b]%eth0:546               [::]:*
UNCONN 0       0                                     [::]:35418             [::]:*
UNCONN 0       0          [fe80::a00:27ff:fe81:c659]%eth1:123               [::]:*
UNCONN 0       0                                    [::1]:123               [::]:*
UNCONN 0       0          [fe80::a00:27ff:fe2b:c00b]%eth0:123               [::]:*
UNCONN 0       0                                     [::]:123               [::]:*
UNCONN 0       0                                     [::]:52457             [::]:*

port change in config

set service tftp-server port '6900'
vyos@vyos# ss -lun
State  Recv-Q  Send-Q                       Local Address:Port      Peer Address:Port
UNCONN 0       0                                  0.0.0.0:68             0.0.0.0:*
UNCONN 0       0                          192.168.188.103:123            0.0.0.0:*
UNCONN 0       0                                127.0.0.1:123            0.0.0.0:*
UNCONN 0       0                                  0.0.0.0:123            0.0.0.0:*
UNCONN 0       0                                  0.0.0.0:28881          0.0.0.0:*
UNCONN 0       0                                127.0.0.1:6900           0.0.0.0:*
UNCONN 0       0                                  0.0.0.0:2942           0.0.0.0:*
UNCONN 0       0          [fe80::a00:27ff:fe2b:c00b]%eth0:546               [::]:*
UNCONN 0       0                                     [::]:35418             [::]:*
UNCONN 0       0          [fe80::a00:27ff:fe81:c659]%eth1:123               [::]:*
UNCONN 0       0                                    [::1]:123               [::]:*
UNCONN 0       0          [fe80::a00:27ff:fe2b:c00b]%eth0:123               [::]:*
UNCONN 0       0                                     [::]:123               [::]:*
UNCONN 0       0                                     [::]:52457             [::]:*

it also failed wenn i change the IP config from DHCP to static

providing a non existing IP to tftp-server config failed as expected.

vyos@vyos# set service tftp-server listen-address 1.1.1.1
[edit]
vyos@vyos# commit
[ service tftp-server ]
WARNING: TFTP server listen address 1.1.1.1 not configured!

also adding

set service tftp-server allow-upload

with no effect

Details

Difficulty level
Unknown (require assessment)
Version
1.2.0 LTS, 1.2.0-rolling+201902080337
Why the issue appeared?
Will be filled on close

Event Timeline

rob created this task.Feb 21 2019, 10:00 PM
rob created this object in space S1 VyOS Public.
rob added a project: VyOS 1.2 Crux.
pasik added a subscriber: pasik.Feb 22 2019, 2:29 PM
c-po claimed this task.Feb 22 2019, 2:40 PM

Root cause is the inability of tftpd to listen on multiple addresses.

Python scripts need to be adjusted to spawn one tftp instance per configured listen address. As 127.0.0.1 is a preconfigured address this blocks all other addresses.

A workaround would be to remove the marked lines: https://github.com/vyos/vyos-1x/blob/crux/src/conf_mode/tftp_server.py#L99-L101

c-po added a comment.EditedFeb 24 2019, 8:25 PM
cpo@LR1:~$ netstat -an | grep 69
udp        0      0 172.18.201.10:69        0.0.0.0:*
udp6       0      0 2001:db8::ffff:69       :::*

Works with the bugfix

c-po closed this task as Resolved.Feb 25 2019, 5:23 PM
c-po added a project: VyOS 1.3 Equuleus.
c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.
c-po moved this task from Need Triage to VyOS 1.2.1 on the VyOS 1.2 Crux board.
c-po edited projects, added VyOS 1.2 Crux (VyOS 1.2.1); removed VyOS 1.2 Crux.
c-po moved this task from Needs Triage to Finished on the VyOS 1.2 Crux (VyOS 1.2.1) board.