Eu tenho um servidor TFTP no Centos 7.4. O servidor TFTP está ativo e funcionando e funciona bem ao tentar acessar um arquivo, conectando-se ao host local. No entanto, se eu tentar acessar o servidor TFTP de outro servidor, obtenho um tempo limite.
O firewall está configurado corretamente e a porta está acessível.
cat /etc/xinetd.d/tftp
service tftp {
socket_type = dgram
protocol = udp
port = 69
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4 }
cat /etc/xinetd.conf
defaults
{
log_type = SYSLOG daemon info
log_on_failure = HOST
log_on_success = PID HOST DURATION EXIT
cps = 50 10
instances = 50
per_source = 10
v6only = no
groups = yes
umask = 002
}
includedir /etc/xinetd.d
Acesso TFTP usando localhost, da mesma máquina:
[root@tftp-001 ~]# tftp -v localhost -c get dir.txt
Connected to localhost (::1), port 69
getting from localhost:dir.txt to dir.txt [netascii]
Received 11 bytes in 0.0 seconds [3093 bit/s]
Acesso TFTP usando outro computador:
[root@pbx-001 ~]# tftp -v 51.15.xxx.yy -c get dir.txt
Connected to 51.15.xxx.yy (51.15.xxx.yy), port 69
getting from 51.15.xxx.yy:dir.txt to dir.txt [netascii]
Transfer timed out.
tail -F / var / log / messages mostrará a seguinte linha ao acessar do host local, mas nada ao acessar de outra máquina.
Oct 21 09:44:55 pbx-001 in.tftpd[11986]: Client ::1 finished dir.txt
Eu tentei executar uma varredura de porta a partir da outra máquina e parece que a porta está acessível e aberta:
[root@pbx-001 ~]# nmap -sU -p 69 51.15.XXX.YY
Starting Nmap 6.40 ( http://nmap.org ) at 2017-10-21 09:47 UTC
Nmap scan report for ZZZZZZZZZZZZZZZZZZZZZZZZ (51.15.XXX.YY)
Host is up (0.00068s latency).
PORT STATE SERVICE
69/udp open|filtered tftp
Nmap done: 1 IP address (1 host up) scanned in 0.55 seconds
Eu também tentei desativar o firewalld, mas ainda tenho esse problema.
Eu preciso que o servidor TFTP seja acessível por qualquer computador fora da rede para configurar algumas centenas de telefones CISCO em diferentes países e escritórios.
Eu posso conectar a SSH, HTTP, etc. na máquina, não é um problema, é apenas um problema de TFTP.
EDIT 1: A saída de iptables -L -n -v é:
[root @ tftp-001 ~] # iptables -L -n -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
13425 5433K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
249 14891 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
351 19544 INPUT_direct all -- * * 0.0.0.0/0 0.0.0.0/0
351 19544 INPUT_ZONES_SOURCE all -- * * 0.0.0.0/0 0.0.0.0/0
351 19544 INPUT_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0
3 117 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate INVALID
221 12353 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
0 0 FORWARD_direct all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FORWARD_IN_ZONES_SOURCE all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FORWARD_IN_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FORWARD_OUT_ZONES_SOURCE all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FORWARD_OUT_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate INVALID
0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT 14168 packets, 1284K bytes)
pkts bytes target prot opt in out source destination
14168 1284K OUTPUT_direct all -- * * 0.0.0.0/0 0.0.0.0/0
Chain FORWARD_IN_ZONES (1 references)
pkts bytes target prot opt in out source destination
0 0 FWDI_public all -- + * 0.0.0.0/0 0.0.0.0/0 [goto]
Chain FORWARD_IN_ZONES_SOURCE (1 references)
pkts bytes target prot opt in out source destination
Chain FORWARD_OUT_ZONES (1 references)
pkts bytes target prot opt in out source destination
0 0 FWDO_public all -- * + 0.0.0.0/0 0.0.0.0/0 [goto]
Chain FORWARD_OUT_ZONES_SOURCE (1 references)
pkts bytes target prot opt in out source destination
Chain FORWARD_direct (1 references)
pkts bytes target prot opt in out source destination
Chain FWDI_public (1 references)
pkts bytes target prot opt in out source destination
0 0 FWDI_public_log all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FWDI_public_deny all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FWDI_public_allow all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
Chain FWDI_public_allow (1 references)
pkts bytes target prot opt in out source destination
Chain FWDI_public_deny (1 references)
pkts bytes target prot opt in out source destination
Chain FWDI_public_log (1 references)
pkts bytes target prot opt in out source destination
Chain FWDO_public (1 references)
pkts bytes target prot opt in out source destination
0 0 FWDO_public_log all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FWDO_public_deny all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 FWDO_public_allow all -- * * 0.0.0.0/0 0.0.0.0/0
Chain FWDO_public_allow (1 references)
pkts bytes target prot opt in out source destination
Chain FWDO_public_deny (1 references)
pkts bytes target prot opt in out source destination
Chain FWDO_public_log (1 references)
pkts bytes target prot opt in out source destination
Chain INPUT_ZONES (1 references)
pkts bytes target prot opt in out source destination
351 19544 IN_public all -- + * 0.0.0.0/0 0.0.0.0/0 [goto]
Chain INPUT_ZONES_SOURCE (1 references)
pkts bytes target prot opt in out source destination
Chain INPUT_direct (1 references)
pkts bytes target prot opt in out source destination
Chain IN_public (1 references)
pkts bytes target prot opt in out source destination
351 19544 IN_public_log all -- * * 0.0.0.0/0 0.0.0.0/0
351 19544 IN_public_deny all -- * * 0.0.0.0/0 0.0.0.0/0
351 19544 IN_public_allow all -- * * 0.0.0.0/0 0.0.0.0/0
48 2953 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
Chain IN_public_allow (1 references)
pkts bytes target prot opt in out source destination
77 4004 ACCEPT tcp -- * * [MY_HOME_IP] 0.0.0.0/0 tcp dpt:80 ctstate NEW
2 117 ACCEPT tcp -- * * [MY_HOME_IP] 0.0.0.0/0 tcp dpt:22 ctstate NEW
0 0 ACCEPT udp -- * * [MY_HOME_IP] 0.0.0.0/0 udp dpt:69 ctstate NEW
Chain IN_public_deny (1 references)
pkts bytes target prot opt in out source destination
Chain IN_public_log (1 references)
pkts bytes target prot opt in out source destination
Chain OUTPUT_direct (1 references)
pkts bytes target prot opt in out source destination
[root@tftp-001 ~]#
* EDIT 2 * Eu uso 'firewall-cmd' como GUI e esta é a saída de firewall-cmd --zone = public --list-all :
[root@tftp-001 ~]# firewall-cmd --zone=public --list-all
public
target: default
icmp-block-inversion: no
interfaces:
sources:
services: dhcpv6-client
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
rule family="ipv4" source address="[MY_HOME_IP]" port port="80" protocol="tcp" accept
rule family="ipv4" source address="[MY_HOME_IP]" port port="22" protocol="tcp" accept
rule family="ipv4" source address="[MY_HOME_IP]" port port="69" protocol="udp" accept