文档介绍:第一章路由器配置和文件管理
. 通过 TFTP 来配置路由器
提问使用 TFTP 来加载路由器的配置文件
回答
Router1#copy tftp:// running-config
Destination filename [running-config]? <enter>
Accessing tftp://...
Loading NEWCONFIG from (via 0/): !
[OK - 24 bytes]
24 bytes copied in secs (125 bytes/sec)
Router1#
注释 版本以前使用的 work 命令,另外拷贝至路由器的配置文件应该以 End 结尾,
否则会出现下面的错误提示信息:%PARSER-4-BADCFG: Unexpected end of configuration file.
. 保存路由器配置到服务器
提问保存路由器当前配置文件到 TFTP 服务器作为备份
回答
Freebsd% touch /tftpboot/router1-confg
Freebsd% chmod 666 /tftpboot/router1-confg
Freebsd% Router1
Trying ...
Connected to Router1.
Escape character is '^]'.
User Access Verification
Password: <vtypassword>
Router1>enable
Password: <enablepassword>
Router1#copy running-config tftp://-confg
Address or name of remote host []? <enter>
Destination filename [router1-confg]? <enter>
!!!
9640 bytes copied in secs (2437 bytes/sec)
Router1#
注释确保 TFTP 服务器上的目录和文件可写
. 使用远端配置文件启动路由器
提问使用另外的配置文件来启动路由器
回答
Router1#configure terminal
Enter mands, one per line. End TL/Z.
Router1(config)#service config
Router1(config)#work work-auto
Router1(config)#boot host tftp Router8-auto
Router1(config)#end
Router1#
注释 service config 缺省是关闭的,work-config, .cfg,
router1-confg, 等
. 保存大于 NVRAM 大小的配置文件
提问配置文件过大,超过了可用的 NVRAM 大小
回答
Router1#configure terminal
Enter mands, one per line. End TL/Z.
Router1(config)#press-config
Router1(config)#end
Router1#
注释可以使用 show startup-config 来验证
Router1#show startup-config
Using 5068 out of 29688 bytes, pressed size = 9969 bytes
pressed configuration from 5068 bytes to 9969 bytes
. 清除启动配置文件
提问清除配置文件恢复到出厂设置
回答
Router1#erase nvram: (erase startup-config)
Erasing the nvram filesystem will remove all files! Continue? [confirm] <enter>
[OK]
Erase of nvram: complete
Router1#reload
System configur