我想制作一个脚本来在一行中复制交换机 4506 的运行配置。到目前为止,我看到两个选项:
复制运行 tftp:
sw#copy run tftp://10.0.0.1/cfg.cfg
Address or name of remote host [10.0.0.1]?
Destination filename [cfg.cfg]?
缺点:需要确认,按回车。
信息:我已经定义了ip tftp source-interface Vlan10
与管理 vlan 的连接。
或者
显示运行配置 | 重定向 tftp://10.0.0.1/run-R1.cfg
sw#show running-config | redirect tftp://10.0.0.1/run-R1.cfg
.....
%Error opening tftp://10.0.0.1/run-R1.cfg (Timed out)
sw#sh ip route 10.0.0.1
% Subnet not in table
缺点:重定向的 IP 源是私有 IP 172.16.0.2,因为这是一个传输子网。所以没有与传出接口 IP 的连接,但与管理子网的连接。正如你在下面看到的。
sw#ping 10.0.0.1 source vlan 10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
Packet sent with a source address of 172.16.0.2
.....
Success rate is 0 percent (0/5)
sw#ping 10.0.0.1 source vlan 11
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
Packet sent with a source address of <Public_IP>
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/6/8 ms
sw#
ip tftp source-interface Vlan10
没有帮助 redirect
问题:
- 是否有可能没有使用“copy run tftp:”进行确认复制?
- 如何定义交换机上的所有数据包都应使用已定义的 IP?