| Gzu521.com我的学习网 |
|
路由器配置和文件管理
1.1. 通过tFtp来配置路由器 提问 使用tftp来加载路由器的配置文件 回答 router1#copy tftp://172.25.1.1/newconfig running-config destination filename [running-config]? accessing tftp://172.25.1.1/newconfig... loading newconfig from 172.25.1.1 (via fastethernet0/0.1): ! [ok - 24 bytes] 24 bytes copied in 0.192 secs (125 bytes/sec) router1# 注释 ios12.0版本以前使用的configure network命令,另外拷贝至路由器的配置文件应该以end结尾,否则会出现下面的错误提示信息:%parser-4-badcfg: unexpected end of configuration file. 1.2. 保存路由器配置到服务器 提问 保存路由器当前配置文件到tftp服务器作为备份 回答 FreeBSD% touch /tftpboot/router1-confg freebsd% chmod 666 /tftpboot/router1-confg freebsd% telnet router1 trying 172.25.1.5... connected to router1. escape character is ’^]’. user access verification password: router1>enable password: router1#copy running-config tftp://172.25.1.1/router1-confg address or name of remote host [172.25.1.1]? destination filename [router1-confg]? !!! 9640 bytes copied in 3.956 secs (2437 bytes/sec) router1# 注释 确保tftp服务器上的目录和文件可写 1.3. 使用远端配置文件启动路由器 提问 使用另外的配置文件来启动路由器 回答 router1#configure terminal enter configuration commands, one per line. end with cntl/z. router1(config)#service config router1(config)#boot network tftp network-auto 172.25.1.1 router1(config)#boot host tftp router8-auto 172.25.1.1 router1(config)#end router1# 注释 service config缺省是关闭的,如果打开缺省会去查找的文件名为network-config, CISCOnet.cfg, router1-confg, router1.cfg等 1.4. 保存大于nvram大小的配置文件 提问 配置文件过大,超过了可用的nvram大小 回答 router1#configure terminal enter configuration commands, one per line. end with cntl/z. router1(config)#service compress-config router1(config)#end router1# 注释 可以使用show startup-config来验证 router1#show startup-config using 5068 out of 29688 bytes, uncompressed size = 9969 bytes uncompressed configuration from 5068 bytes to 9969 bytes 1.5. 清除启动配置文件 提问 清除配置文件恢复到出厂设置 回答 router1#erase nvram: (erase startup-config) erasing the nvram filesystem will remove all files! continue? [confirm] [ok] erase of nvram: complete router1#reload system configuration has been modified. save? [yes/no]: no proceed with reload? [confirm] 注释 无 1.6. 加载新的ios镜像 提问 升级当前的ios 回答 router1#copy tftp://172.25.1.1/c2600-ik9o3s-mz.122-12a.bin flash: destination filename [c2600-ik9o3s-mz.122-12a.bin]? accessing tftp://172.25.1.1/c2600-ik9o3s-mz.122-12a.bin... erase flash: before copying? [confirm] erasing the flash filesystem will remove all files! continue? [confirm] erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased erase of flash: complete loading c2600-ik9o3s-mz.122-12a.bin from 172.25.1.1 (via fastethernet0/0.1):!!!!!!!!!!!!!! [ok - 11135588 bytes] verifying checksum... ok (0xe643) 11135588 bytes copied in 82.236 secs (135410 bytes/sec) router1# reload proceed with reload? [confirm] 注释 无 |
责任编辑:gzu521