了解 TFTP 服务器的工作原理

了解 TFTP 服务器的工作原理

我有一台充当 TFTP 服务器的 Ubuntu 机器。我想配置我的 Cisco IOS 路由器,使其在启动时从此 TFTP 服务器获取配置。

我有几个疑问 - 我应该将 Cisco 路由器的配置文件存储在 TFTP 服务器的哪里?目前,我在以下位置创建了两个临时文件夹/var/lib/tftpboot-

automation@automation:/var/lib/tftpboot$ ls -l
total 8
drwx------ 2 tftp tftp 4096 Mar 31 15:37 ExrZHRa-incoming
drwxr-xr-x 2 root root 4096 Mar 31 15:52 TXJla-outgoing

automation@automation:/var/lib/tftpboot$ tree
.
├── ExrZHRa-incoming [error opening dir]
└── TXJla-outgoing
    └── R1.txt

2 directories, 1 file

根据 Cisco 的文档,这是从 TFTP 服务器获取文件的语法-

copy tftp: [[[//location ]/directory ]/filename ] nvram:startup-config 

Example:
Device# copy tftp://server1/dir10/datasource nvram:startup-config

根据我的理解,location将是我的 TFTP 服务器的 IP,并且filename将是要加载的实际配置文件。但是应该在中配置什么directory?我试过了/var/lib/tftpboot/TXJla-outgoing,但没有用。

终端截图

答案1

假设你使用某些东西喜欢这个配置指南, 这TFTP 服务器的地址是/var/lib/tftpboot/

如果这是根目录,并且文件直接在那里,那么您的 tftp 命令将如下所示:

copy tftp://ip.add.re.ss/FILENAME nvram:startup-config

就像 Web 服务器一样,TFTP 服务器配置的“根”是服务器将提供服务的磁盘上的根目录;这是省略在进行复制的远程系统中。

相关内容