Page MenuHomeVyOS Platform

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
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

rob created this object in space S1 VyOS Public.
rob added a project: VyOS 1.2 Crux.

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

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 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.
dmbaturin set Is it a breaking change? to Unspecified (possibly destroys the router).
dmbaturin set Issue type to Unspecified (please specify).