🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 拓扑图 ![](https://box.kancloud.cn/f004bffd79162f99a69de27429b7c56e_684x624.png) ## MS1 ~~~ Switch>enable Switch#configure terminal Switch(config)#hostname MS1 MS1(config)#ip routing MS1(config)#interface FastEthernet0/1 MS1(config-if)#switchport mode access MS1(config-if)#switchport access vlan 80 MS1(config)#interface FastEthernet0/2 MS1(config-if)#switchport mode access MS1(config-if)#switchport access vlan 53 MS1(config)#interface FastEthernet0/3 MS1(config-if)#switchport mode access MS1(config-if)#switchport access vlan 69 MS1(config)#interface FastEthernet0/5 MS1(config-if)#switchport mode access MS1(config-if)#switchport access vlan 10 MS1(config)#ip dhcp excluded-address 192.168.10.254 MS1(config)#ip dhcp pool vlan10 MS1(dhcp-config)#network 192.168.10.0 255.255.255.0 MS1(dhcp-config)#default-router 192.168.10.254 MS1(dhcp-config)#dns-server 192.168.53.1 MS1(config)#Vlan 10 MS1(config)#interface Vlan10 MS1(config-if)#ip address 192.168.10.254 255.255.255.0 MS1(config)#Vlan 53 MS1(config)#interface Vlan53 MS1(config-if)#ip address 192.168.53.254 255.255.255.0 MS1(config)#Vlan 69 MS1(config)#interface Vlan69 MS1(config-if)#ip address 192.168.69.254 255.255.255.0 MS1(config)#Vlan 80 MS1(config)#interface Vlan80 MS1(config-if)#ip address 192.168.80.254 255.255.255.0 ~~~ ## S1 ~~~ Switch>enable Switch#configure terminal Switch(config)#hostname S1 S1(config)#Vlan 10 S1(config)#interface range fastEthernet 0/1-5 S1(config-if-range)#switchport mode access S1(config-if-range)#switchport access vlan 10 ~~~ ## TFTP 备份还原 ~~~ MS1#write //保存配置到 startup-config 文件 Building configuration... [OK] MS1#copy startup-config tftp //备份配置文件到 TFTP 服务器 Address or name of remote host []? 192.168.69.1 Destination filename [MS1-confg]? MS1-config Writing startup-config...!! [OK - 1659 bytes] 1659 bytes copied in 0.002 secs (829500 bytes/sec)、 MS1#erase startup-config //删除本地配置文件 Erasing the nvram filesystem will remove all configuration files! Continue? [confirm] [OK] Erase of nvram: complete %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram MS1#copy tftp: startup-config //从 TFTP 服务器还原配置文件 Address or name of remote host []? 192.168.69.1 Source filename []? MS1-config Destination filename [startup-config]? Accessing tftp://192.168.69.1/MS1-config... Loading MS1-config from 192.168.69.1: ! [OK - 1659 bytes] 1659 bytes copied in 0.002 secs (829500 bytes/sec) ~~~ # 实验测试 * PC 均能通过 DHCP 获取到 IP 地址 * PC 能通过域名 test.cisco.com 访问 web 页面 * 备份配置文件到 TFTP 服务器后,删除本地配置文件并重启,先配置与 TFTP 服务器的通信,然后从 TFTP 服务器恢复配置文件并重启,测试与其它设备之间的通信。