Centos 6/7 tftp 服务器不发送回复

Rus*_*ber 2 networking tftp linux-networking centos6 centos7

我正在尝试启动并运行一个非常简单的 TFTP 服务器,以便用作 IPXE 引导服务器。但是,我似乎所做的一切似乎都无法使服务器能够与远程客户端进行通信。我可以让客户端通过 localhost 进行通信,这似乎很好用。

tftp $TFTP_SERVER -c get README
Run Code Online (Sandbox Code Playgroud)

虽然这在本地主机上效果很好,但它违背了拥有可以远程通话的服务器的目的。tftp 配置文件内容如下:

[root@ipxe tmp]# cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -vvvvv -c -s /ipxe/
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
Run Code Online (Sandbox Code Playgroud)

注意:出于调试目的,我已完成以下操作:我已禁用防火墙:

[root@ipxe ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@ipxe ~]# chkconfig iptables off
Run Code Online (Sandbox Code Playgroud)

我禁用了 SELinux,因为它很糟糕。

[root@ipxe tmp]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
Run Code Online (Sandbox Code Playgroud)

我也重启了很多次。

无论我尝试什么,即使将 CentOS 版本更改为 7 并重复该过程,我从 tftp 中获得的最多信息是:

Jan 30 22:52:01 ipxe xinetd[2013]: START: tftp pid=2265 from=192.168.10.186
Jan 30 22:52:01 ipxe in.tftpd[2266]: RRQ from 192.168.10.186 filename README
Jan 30 22:52:06 ipxe in.tftpd[2267]: RRQ from 192.168.10.186 filename README
Jan 30 22:52:11 ipxe in.tftpd[2268]: RRQ from 192.168.10.186 filename README
Jan 30 22:52:20 ipxe in.tftpd[2269]: RRQ from 192.168.10.186 filename README
Jan 30 22:52:25 ipxe in.tftpd[2270]: RRQ from 192.168.10.186 filename README
Jan 30 22:52:30 ipxe in.tftpd[2271]: RRQ from 192.168.10.186 filename README
Jan 30 22:52:35 ipxe in.tftpd[2272]: RRQ from 192.168.10.186 filename README
Jan 30 22:52:40 ipxe in.tftpd[2275]: RRQ from 192.168.10.186 filename README
Run Code Online (Sandbox Code Playgroud)

我显然可以 ping 系统并通过 ssh 进入它,而且似乎没有我能看到的任何类型的网络问题。

天哪,我在这里错过了什么?诊断问题的下一个逻辑路线是什么?我几乎准备好提交关于这个问题的错误。

Rus*_*ber 5

事实证明,在测试 TFTP 时,您必须在服务器和客户端的防火墙上打一个洞。这没有多大意义,因为大多数在线文章都会讨论 selinux 以及禁用 tftp 服务器上的防火墙。

服务器运行良好,即使我尝试了多种不同的操作系统类型,从 Windows 到 Linux 再到 Mac,所有 3 个不同的 tftp 客户端都需要将规则放入其防火墙以允许访问 tftp。

通常,这会伴随着 tftp 服务器中的一条消息,该消息会说“没有到主机的路由”的调子,但由于某种原因,该步骤被省略了。

如果你和我一样,即使你已经遵循了所有的方向,也不知道该怎么做。确保你也在客户端的防火墙上打了一个洞。