AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[tftp](server)

Martin Hope
Caenem
Asked: 2024-10-21 18:42:21 +0800 CST

启动 tftpd32 的多个实例

  • 5

我有 9 块并行的电路板,它们从托管在 tftpd32 上的 TFTP 服务器上获取二进制文件,以对其中一个微控制器进行编程。

每个板都通过 USB-C 电缆连接到托管 TFTP 服务器的 PC,通信协议是 Ethernet-over-USB。

因此,创建了 9 个具有 9 个不同 IP 地址的以太网适配器,并且我必须为每个 IP 地址启动一个 TFTP 服务器实例,因为我认为您只能在 tftpd32 上绑定一个 IP 地址。

下图显示了主板如何连接到 PC:

框图电路板图

是否可以启动 9 个 tftpd32.exe 实例,并为每个实例绑定一个唯一的 IP 地址?

我在 Windows 10 上

tftp
  • 1 个回答
  • 28 Views
Martin Hope
elyograg
Asked: 2022-11-04 18:17:46 +0800 CST

无法让 tftp 服务器在 Ubuntu 22.04 上运行

  • 6

我让 tftpf-hpa 在我的 Ubuntu 服务器上工作,以从我的 Cisco 设备发送/接收图像和配置。

今天它不工作。即使我手动尝试,该服务也不会启动。它没有告诉我为什么它不会启动。如果我用 strace 运行 start-stop-daemon,我会得到很多输出,但我看不出问题是什么。

我尝试切换到 atftpd,但是当它尝试写入我从 cisco 交换机发送的文件时,核心转储……这是我经常做的事情,并且以前一直有效。

我还尝试使用 tftpd 包,但系统日志表明它正在尝试发送我要求交换机发送的文件,而不是接收它。交换机将“权限被拒绝”指示为问题。为了使用 tftpd 进行测试,我将 /var/lib/tftboot 及其所有内容的所有权更改为 nobody:nogroup。

我在另一台运行 Ubuntu 20.04 的服务器上安装了 tftpd-hpa,并且可以正常工作。所以我并没有死在水里,但那是一个辅助服务器。

任何人都可以帮助我在我的主要 Ubuntu 服务器上获得一个工作的 tftp 服务器吗?如果有解决这些问题的方法,请告诉我。

tftp
  • 1 个回答
  • 37 Views
Martin Hope
Rino Bino
Asked: 2022-04-05 20:01:09 +0800 CST

pxe 引导时使用压缩的 initrd

  • 1

我正在使用带有 grub 的 netboot/pxeboot。

menuentry "Install Ubuntu 20.04" {
  set gfxpayload=keep
  echo 'Loading vmlinuz ...'
  linux  /tftp/vmlinuz ip=dhcp netboot=nfs nfsroot=10.0.0.20:/data/netboot/nfs/ubuntu2004/ boot=casper toram noquiet splash=off console=tty0 console=ttyS1,57600n8 ---
  echo 'Loading initrd, this takes a long time ...'
  initrd /tftp/initrd
}

它工作正常,但是,通过 tftp 加载 initrd 需要很长时间(30 多分钟)。我想压缩(gz/bz2)这个文件以节省一些文件传输时间。

我看到了一些例子,指的是initrd.gz(一个例子:https ://unix.stackexchange.com/questions/217002/which-iso-file-vmlinuz-and-initrd-gz-to-use-for-installing- centos-from-multiboo)但是当我试图用 gzip 压缩文件并使用它时,我收到一个错误,例如:

[   12.543547] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[   12.558487] Please append a correct "root=" boot option; here are the available partitions:
[   12.575161] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

有没有办法压缩这个文件,以便它可以传输更小的文件大小,并在尝试挂载根 fs 之前将其解压缩?

或者,有没有办法通过不同的协议(HTTP/FTP/SFTP/SCP/etc)传输它?

boot pxe-boot linux-kernel tftp
  • 2 个回答
  • 490 Views
Martin Hope
azurepancake
Asked: 2021-02-03 13:18:45 +0800 CST

不同的 TFTP(临时?)UDP 端口

  • 0

我有一块硬件,我正在尝试 PXE 引导。目前,它通过 PXE 启动,DHCP 将 TCP/IP 数据租给端点,然后通过一些 iPXE 固件将其转到“下一个服务器”到 TFTP。

它会在端口 69 上建立 TFTP 连接并开始尝试传输固件。这是我遇到问题的地方,因为它尝试的“返回”端口被我们的公司防火墙阻止。

这是netstat在 TFTP 服务器上的那个时刻拍摄的:

# netstat -tunap | grep tftp
udp        0      0 10.254.52.26:45140      10.55.32.175:2073       ESTABLISHED 25115/in.tftpd
udp        0      0 10.254.52.26:53684      10.55.32.175:2072       ESTABLISHED 25108/in.tftpd

它似乎总是在端点上尝试端口 2073 和 2072。非常一致。

但是,如果我从同一端点上的磁盘加载操作系统并使用 TFTP 客户端进行连接(atftp在这种情况下),它会建立连接并下载没有问题。这是其中netstat的:

# netstat -tunap | grep tftp
udp        0      0 10.254.52.26:50986      10.55.32.175:44669      ESTABLISHED 26500/in.tftpd
udp        0      0 10.254.52.26:54390      10.55.32.175:44669      ESTABLISHED 26484/in.tftpd

在这种情况下,它使用的端口号通常在 40000 以上,这是我们的防火墙允许的。这也是非常一致的。

我可以请求打开一些额外的端口,但是我真的很想了解它为什么会这样。这和客户有关系吗?这是在这种情况下似乎唯一发生变化的事情(PXE 客户端固件与atftp操作系统上的客户端)。

任何人可以提供的理解将不胜感激。

pxe-boot tftp
  • 2 个回答
  • 703 Views
Martin Hope
Michał Sacharewicz
Asked: 2021-01-13 06:09:42 +0800 CST

如何通过脚本(类 PHP)提供 TFTP 内容?

  • 0

我正在寻找一种方法来使用脚本(bash、PHP?)的输出来提供 TFTP 请求,该脚本以 TFTP 请求路径作为参数调用。Apache+PHP 的简单 TFTP 等价物。

像 PHP + mod_rewrite 之类的东西,即。当客户端请求“file123”时,服务器将调用脚本(例如“.\myscript.sh file123”)并将脚本的输出作为返回的 TFTP 数据传递。

谁能暗示一个好的、值得生产的解决方案?:D

linux php bash tftp
  • 1 个回答
  • 163 Views
Martin Hope
tim11g
Asked: 2020-12-23 07:10:05 +0800 CST

我能否确定日期为 2019 年 4 月的 SolarWinds TFTP 服务器是否受到威胁?

  • 1

SolarWinds由于其服务器遭到黑客攻击而成为新闻。目前尚不清楚妥协可以追溯到多远。我从他们那里使用的唯一产品是他们的免费 TFTP 服务器。是否记录了妥协的“指纹”,以便确定特定下载是否受到影响?现在可以使用商业病毒/恶意软件扫描程序检测到受损文件吗?

security tftp
  • 1 个回答
  • 671 Views
Martin Hope
Kevin Keane
Asked: 2020-11-11 15:02:22 +0800 CST

CentOS 8 作为带有 nft 和 firewalld 的 NAT 路由器 - 如何让它通过 TFTP?

  • 4

我正在尝试在隐藏在 NAT 路由器后面的一个网络上设置 PXE 引导(需要 TFTP)。

我的问题与网络上的许多其他问题相似,但我发现的所有答案都适用于带有 iptables 的 CentOS 7。我需要使用以 firewalld 和 nft 作为后端的 CentOS 8 来执行此操作。

无法对 TFTP 流量进行 NAT,因为 iptables 未将返回连接转发到客户端,尽管 TFTP 帮助程序创建了期望 https://unix.stackexchange.com/questions/579508/iptables-rules-to-forward-tftp-via-nat

这是我的简化网络图:

     Outside NAT               Inside NAT
10.0.10.10  10.0.10.11->192.168.1.1  192.168.1.2
TFTP server --------> NAT ---------> PXE/TFTP client

TFTP 不工作。使用 tcpdump,我看到 RRQ 消息从 192.168.1.2 成功传输到 10.0.10.10。响应到达路由器,但未正确 NAT 到达客户端。

我尝试了 sysctl net.netfilter.nf_contrack_helper 的两种设置(更改设置后重新启动):

# sysctl -a | grep conntrack_helper
net.netfilter.nf_conntrack_helper = 0

使用 nf_contrack_helper=0:

tcpdump: listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes

Initial RRQ:

14:02:27.842563 IP (tos 0x0, ttl 64, id 64642, offset 0, flags [DF], proto UDP (17), length 54)
    192.168.1.2.36799 > 10.0.10.10.69: [udp sum ok]  26 RRQ "grub2/grubx64.efi" octet

Initial RRQ after NAT:

14:02:27.842619 IP (tos 0x0, ttl 63, id 64642, offset 0, flags [DF], proto UDP (17), length 54)
    10.0.10.11.36799 > 10.0.10.10.69: [udp sum ok]  26 RRQ "grub2/grubx64.efi" octet

Response from TFTP server to NAT router:

14:02:27.857924 IP (tos 0x0, ttl 63, id 60000, offset 0, flags [none], proto UDP (17), length 544)
    10.0.10.10.60702 > 10.0.10.11.36799: [udp sum ok] UDP, length 516

(repeated several times until timeout)

在 nf_contrack_helper=1 的情况下,传出的数据包甚至根本没有经过 NAT:

tcpdump: listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes

Initial RRQ:

14:02:27.842563 IP (tos 0x0, ttl 64, id 64642, offset 0, flags [DF], proto UDP (17), length 54)
    192.168.1.2.36799 > 10.0.10.10.69: [udp sum ok]  26 RRQ "grub2/grubx64.efi" octet

(repeated several times until timeout)

都加载了 nf_*_tftp 助手(无论 nf_contrack_helper 设置如何):

# lsmod | grep tftp
nf_nat_tftp            16384  0
nf_conntrack_tftp      16384  3 nf_nat_tftp
nf_nat                 36864  3 nf_nat_ipv6,nf_nat_ipv4,nf_nat_tftp
nf_conntrack          155648  10 nf_conntrack_ipv6,nf_conntrack_ipv4,nf_nat,nf_conntrack_tftp,nft_ct,nf_nat_ipv6,nf_nat_ipv4,nf_nat_tftp,nft_masq,nft_masq_ipv4

上面链接的一篇文章建议使用 iptables 进行以下操作(这是有道理的):

iptables -A PREROUTING -t raw -p udp --dport 69 -s 192.168.11.0/24 -d 172.16.0.0/16 -j CT --helper tftp

我将如何使用带有 nft 后端的 firewalld 进行等效操作。

更新:

firewalld 配置相当复杂,所以我只添加相关区域:

外部区域:

<?xml version="1.0" encoding="utf-8"?>
<zone>
  <source address="10.0.10.0/24"/>
  <service name="tftp-client"/>
  <service name="ssh"/>
  <masquerade/>
</zone>

和内部区域:

<?xml version="1.0" encoding="utf-8"?>
<zone>
  <source address="192.168.1.0/24"/>
  <service name="dhcp"/>
  <service name="ssh"/>
  <service name="dns"/>
  <service name="tftp"/>
  <masquerade/>
</zone>

注意:内部区域的化妆舞会是一个错误。我删除了它,但行为没有改变。

区域漂移被禁用。

更新 2:

要回答评论者的请求:

DHCP 配置

DHCP 服务器与 NAT 路由器(网络图中的 192.168.1.1)在同一系统上运行。它是标准 ISC DHCP,分发 IP 地址(作为固定地址;不涉及池)、掩码、网关、DNS 服务器等,以及 PXE Boot 下一个服务器和文件名选项。

这一切显然有效。tcpdump 显示客户端向服务器发送了正确的 RRQ 数据包。

响应返回到 NAT 路由器,但不会发送到 NAT 后侧。

有关 TFTP 如何工作以及它如何与 NAT 中断的详细信息

如果您了解 TFTP 协议,就很清楚发生了什么;我只是不知道如何使用 firewalld/nft/CentOS 8 来处理它。

从根本上说,问题在于 TFTP 协议以非标准方式使用 UDP 端口。在“标准”基于 UDP 的协议(例如 DNS)中,响应来自服务器侦听的同一端口。

Request: client:54321 -> server:53
Response: server:53 -> client:54321

(其中 54321 可以是客户端选择的任何随机临时端口号)。

NAT 匹配这些 IP 地址和端口以识别哪个响应属于哪个请求。

TFTP 的做法不同;响应不是来自端口 69,而是来自其他一些随机端口。

Request (RRQ): client54321 -> server:69
Response (Data): server:12345 -> client:54321

其中 54321 再次是客户端选择的随机临时端口,而 12345 是服务器选择的随机临时端口。

结果,标准 NAT 行为将找不到与源服务器匹配的连接:12345,并丢弃数据包。

此问题的解决方案涉及使用帮助程序 - 理解此怪癖的 nf_nat_tftp 内核模块。

我只是无法弄清楚如何使用 CentOS 8、nftables 和 firewalld 来实现这一点。

使用 nftables 的答案对我来说是完全可以接受的,只要它不违反任何防火墙规则。

nftables firewalld tftp
  • 1 个回答
  • 3004 Views
Martin Hope
ThaChillera
Asked: 2020-06-11 06:12:35 +0800 CST

无法连接到 TFTP docker 容器

  • 0

我试图在 docker 中设置 TFTP 服务器作为设置 PXE 引导的第一步,但我无法连接到它。

我使用命令启动容器docker run --name tftp -p 0.0.0.0:69:69/udp -v /var/tftpboot/:/var/tftpboot -d local-tftp。

从容器内部我可以运行curl -o ./foo tftp://0.0.0.0/foo并且它可以工作,从容器外部我从 docker 主机或网络上的另一台计算机运行相同的命令(使用正确的 ip),两者都不起作用。

我尝试禁用主机上的防火墙,但这也无济于事,这不是防火墙问题。

感谢您提供任何帮助或设置此设置的替代解决方案。

docker tftp
  • 3 个回答
  • 2383 Views
Martin Hope
eXe
Asked: 2017-03-07 01:38:28 +0800 CST

Windows - 多个并发无人值守安装

  • 0

分发服务器和软件:

Debian 8
TFTP Server
SAMBA Server
DHCP Server

现在我们使用以下方式将 Windows (2012) 分发到我们的服务器:

  • 安装任务 inkomming
  • 编辑 dhcp 服务器(新服务器)
  • 自动创建 wim 启动映像(通过 debian 服务器,通过wimlib修改 wim 模板)
  • 使用 unattended.xml 创建 samba 共享
  • 电脑开机
  • 新服务器的 dhcp 请求
  • tftp 下载 wim (winpe) 映像
  • winpe 启动和挂载 sambsa 共享
  • 无人值守安装windows

这按预期工作 - 但 tftp 下载仅限于一个修复源{TFTPSource}/Boot/startrom.0

由于路径的限制,目前只能一次启动一个windows安装,直到加载完wim镜像。完成 wim 映像后,可以触发下一次安装。

现在我们寻找一种“更好”的方式来一次安装多个 Windows 服务器。我们发现了几个像OPSI或Unattended这样的项目,但它们似乎都不符合我们的要求:

OPSI 似乎需要在客户端上安装一个软件,该软件在客户端上是永久的。似乎没有对 Windows Server 2016 Distribution 的官方支持。

无人值守似乎仅适用于 Windows 2000 / XP / 2003。

我们需要(它可能是一个 Windows 部署服务器)一个部署服务器,它可以一次交付多个客户端(基于无人值守模板的无人值守安装,我们将在安装之前对其进行编辑)

将 Windows Server 2012(2016,可能还有其他 Windows 发行版)交付到多个客户端的正确方法是什么?

是否有满足此需求的免费 Windows 软件(最好可通过命令行远程控制)?

也许有一种方法可以修改{TFTPSource}/Boot/startrom.0Windows Bootrom 的修复编码路径?

windows unattended windows-pe tftp
  • 1 个回答
  • 300 Views
Martin Hope
ArunMKumar
Asked: 2016-09-05 14:46:17 +0800 CST

TFTP 请求 未得到服务

  • 2

这可能看起来像一个重复的问题,但我做了我的搜索,但找不到任何解决方案。

我创建了一个 tftp 服务器,当从本地 tftp 客户端访问该服务器时,通过环回获取并放置文件就好了。当我尝试通过外部客户端访问服务器时,请求超时。连接已建立。我可以看到连接在 tftp 客户端中已连接,那里没有问题。文件传输未开始。

客户端通过以太网电缆直接连接到主机,我创建了一个 2 设备 LAN。ping 在它们之间起作用。

我最初认为这是一个防火墙问题,现在我禁用了防火墙,允许在 iptables 中配置的端口 69 上输入和输出。端口 69 上也允许使用 udp。

我也没有运行 tftpd-hpa 服务器的多个实例,它作为守护进程运行,而netstat -aup只运行一个 tftp 服务器。

客户给出了正确的请求,我可以在wireshark中看到它们,但没有任何响应。

并且失败总是超时。

**firewall disabled**
**ports allow connection **
**file transfer fails**
** outgoing tftp request as a client to other tftp servers is alos blocked **

更新2:

我不太确定防火墙的事情,因为这台笔记本电脑是由我的雇主发行的,我怀疑他们不会允许禁用防火墙。阅读/var/log/syslog并没有给出任何提示,因此尝试查看内核打印信息以了解是否有任何 kmodules 做任何可疑的事情,我看到了这些。

[10989.915231] FIREWALL: IN=eth1 OUT= MAC=50:7b:9d:f9:44:5d:68:9e:19:99:9e:e4:08:00 SRC=10.42.0.89 DST=10.42.0.1 LEN=65 TOS=0x00 PREC=0x00 TTL=255 ID=117 DF PROTO=UDP SPT=2495 DPT=69 LEN=45

SRC、DESTT 、DPT、PROTO MAC 地址都与我的tftp 客户端匹配。

我无法真正说出这里发生了什么,所以如果有人能给我提示以寻找一些日志或其他东西,那将非常有帮助。

在此之后,我安装了gufw来管理防火墙并允许所有传入和传出流量。我仍然会超时,这就是我现在在 syslog 上看到的。

Sep  5 16:16:01 arun-TP kernel: [13836.201853] [UFW AUDIT] IN= OUT=eth1 SRC=10.42.0.1 DST=10.42.0.255 LEN=184 TOS=0x00 PREC=0x00 TTL=64 ID=12630 DF PROTO=UDP SPT=17500 DPT=17500 LEN=164 
Sep  5 16:16:01 arun-TP kernel: [13836.201870] [UFW ALLOW] IN= OUT=eth1 SRC=10.42.0.1 DST=10.42.0.255 LEN=184 TOS=0x00 PREC=0x00 TTL=64 ID=12630 DF PROTO=UDP SPT=17500 DPT=17500 LEN=164 

这次DST没有意义,客户端位于10.42.0.89而不是10.42.0.255。

更新1:

/etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure  --create  -s"
RUN_DAEMON="YES"

ls -lrt /

drwxr-xr-x   2 tftp nogroup  4096 Sep  5 03:30 tftpboot

网络统计-aup

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 *:mdns                  *:*                                 739/avahi-daemon: r
udp        0      0 *:50694                 *:*                                 2514/rpc.mountd 
udp        0      0 *:55107                 *:*                                 2514/rpc.mountd 
udp        0      0 *:nfs                   *:*                                 -               
udp        0      0 *:3471                  *:*                                 8567/dhclient   
udp        0      0 *:56776                 *:*                                 739/avahi-daemon: r
udp        0      0 10.42.0.1:domain        *:*                                 5403/dnsmasq    
udp        0      0 127.0.1.1:domain        *:*                                 3025/dnsmasq    
udp        0      0 *:bootps                *:*                                 5403/dnsmasq    
udp        0      0 *:bootpc                *:*                                 8567/dhclient   
udp        0      0 *:tftp                  *:*                                 4316/in.tftpd  
udp        0      0 *:sunrpc                *:*                                 966/rpcbind     
udp        0      0 *:ipp                   *:*                                 1476/cups-browsed
udp        0      0 *:707                   *:*                                 966/rpcbind     
udp        0      0 *:33526                 *:*                                 2514/rpc.mountd 
udp        0      0 *:49935                 *:*                                 -               
udp        0      0 localhost:796           *:*                                 1044/rpc.statd  
udp        0      0 *:54194                 *:*                                 1044/rpc.statd  
udp        0      0 *:17500                 *:*                                 3785/dropbox    
udp6       0      0 [::]:mdns               [::]:*                              739/avahi-daemon: r
udp6       0      0 [::]:42779              [::]:*                              -               
udp6       0      0 [::]:59279              [::]:*                              1044/rpc.statd  
udp6       0      0 [::]:nfs                [::]:*                              -               
udp6       0      0 [::]:60007              [::]:*                              2514/rpc.mountd 
udp6       0      0 [::]:52311              [::]:*                              2254/BESClient  
udp6       0      0 [::]:11656              [::]:*                              8567/dhclient   
udp6       0      0 [::]:sunrpc             [::]:*                              966/rpcbind     
udp6       0      0 [::]:45289              [::]:*                              739/avahi-daemon: r
udp6       0      0 [::]:57589              [::]:*                              2514/rpc.mountd 
udp6       0      0 [::]:707                [::]:*                              966/rpcbind     
udp6       0      0 [::]:37709              [::]:*                              2514/rpc.mountd 

/etc/xinetd.d/中没有 tftp 配置文件

防火墙被禁用。ufw 状态 = 不活动

iptables -L -v

Chain INPUT (policy DROP 0 packets, 0 bytes) pkts bytes target     prot opt in     out     source               destination         
    2   656 ACCEPT     udp  --  eth1   any     anywhere             anywhere             udp dpt:bootps
    0     0 ACCEPT     tcp  --  eth1   any     anywhere             anywhere             tcp dpt:bootps
    0     0 ACCEPT     udp  --  eth1   any     anywhere             anywhere             udp dpt:domain
    0     0 ACCEPT     tcp  --  eth1   any     anywhere             anywhere             tcp dpt:domain
36569 3800K ACCEPT     all  --  lo     any     anywhere             anywhere            
30392   20M ACCEPT     tcp  --  any    any     anywhere             anywhere             state RELATED,ESTABLISHED
 2704  679K ACCEPT     udp  --  any    any     anywhere             anywhere             state RELATED,ESTABLISHED
    0     0 ACCEPT     254  --  ipsec+ any     anywhere             anywhere            
    0     0 ACCEPT     esp  --  any    any     anywhere             anywhere            
    0     0 ACCEPT     ah   --  any    any     anywhere             anywhere            
    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:isakmp
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:cfengine
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:5900
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:5901
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:12080
    0     0 REJECT     tcp  --  any    any     anywhere             anywhere             tcp dpt:auth reject-with icmp-port-unreachable
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:https
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:5656
    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpts:5004:5005
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpts:5004:5005
    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:20830
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:20830
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpts:sip:5062
    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpts:sip:5062
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:21100
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:2001
    0     0 ACCEPT     gre  --  any    any     anywhere             anywhere            
    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp destination-unreachable
    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp source-quench
  689 56460 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp time-exceeded
    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp parameter-problem
    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp router-advertisement
    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp echo-request
   13   832 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp echo-reply
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:tproxy
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:1533
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpts:30000:30005
    0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcp dpts:bootps:bootpc
    6  1968 DROP       udp  --  any    any     anywhere             anywhere             udp dpts:bootps:bootpc
    0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcp dpt:netbios-ns
    0     0 DROP       udp  --  any    any     anywhere             anywhere             udp dpt:netbios-ns
    0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcp dpt:netbios-dgm
    0     0 DROP       udp  --  any    any     anywhere             anywhere             udp dpt:netbios-dgm
    0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcp dpt:netbios-ssn
    0     0 DROP       udp  --  any    any     anywhere             anywhere             udp dpt:netbios-ssn
    0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcp dpts:tcpmux:ftp-data
    0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcp dpt:sunrpc
    0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcp dpts:snmp:snmp-trap
    0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcp dpt:520
    0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcp dpts:6348:6349
    0     0 DROP       tcp  --  any    any     anywhere             anywhere             tcp dpts:6345:gnutella-rtr
   75  3256 LOG        tcp  --  any    any     anywhere             anywhere             limit: avg 3/min burst 5 LOG level debug prefix  "FIREWALL: "
 1459  263K LOG        udp  --  any    any     anywhere             anywhere             limit: avg 3/min burst 5 LOG level debug prefix "FIREWALL: "
 3347  568K DROP       all  --  any    any     anywhere             anywhere            
    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:tftp state NEW,ESTABLISHED
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:69 state NEW,ESTABLISHED

Chain FORWARD (policy DROP 0 packets, 0 bytes) pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  any    eth1    anywhere             10.42.0.0/24         state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  eth1   any     10.42.0.0/24         anywhere            
    0     0 ACCEPT     all  --  eth1   eth1    anywhere             anywhere            
    0     0 REJECT     all  --  any    eth1    anywhere             anywhere             reject-with icmp-port-unreachable
    0     0 REJECT     all  --  eth1   any     anywhere             anywhere             reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT 68593 packets, 6962K bytes) pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:69 state NEW,ESTABLISHED
    1    45 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:tftp state NEW,ESTABLISHED

作为客户端的传出 tftp 请求也被阻止。我的 IP 是 192,168.0.5 尝试连接到 192.168.0.2

tftp 192.168.0.2
tftp> verbose on
Verbose mode on.
tftp> status
Connected to 192.168.0.2.
Mode: netascii Verbose: on Tracing: off Literal: off
Rexmt-interval: 5 seconds, Max-timeout: 25 seconds
tftp> put hello
putting hello to 192.168.0.2:hello [netascii]
Transfer timed out.

我的路由器有问题吗?有没有我需要处理的设置,但是即使我使用以太网电缆将客户端直接连接到服务器,这个问题仍然存在。我厌倦了 BeagleBone Black、MACbook 和我的 Android 手机作为 tftp 客户端向服务器提出请求。

客户端:10.42.0.89(BeagleBlack,在 u-boot)服务器:10.42.0.1

我现在用wireshark嗅探以太网数据包。

ARP:

32  927.886269000   10.42.0.89  Broadcast   ARP 60  Who has 10.42.0.1?  Tell 10.42.0.89
33  927.886320000   50:7b:9d:f9:44:5d   10.42.0.89  ARP 42  10.42.0.1 is at 50:7b:9d:f9:44:5d

在此之后,我只看到从客户端启动,没有任何结果。

36  932.887008000   10.42.0.89  10.42.0.1   TFTP    79  Read Request, File: hello, Transfer type: octet, timeout\000=5\000, blksize\000=1468\000
file-transfer udp tftp
  • 4 个回答
  • 9918 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve