第一步 搭建拓扑,并规划拓扑。
第二步 规划vlan,并配置ip与vrrp
[LSW1]vlan b 111 123
[LSW1]interface Eth-Trunk1
[LSW1-Eth-Trunk1]port link-type trunk
[LSW1-Eth-Trunk1]port trunk allow-pass vlan 111 123
[LSW1]interface GigabitEthernet0/0/3
[LSW1-GigabitEthernet0/0/3]port link-type trunk
[LSW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 111 123
[LSW1-GigabitEthernet0/0/3]interface GigabitEthernet0/0/4
[LSW1-GigabitEthernet0/0/4]port link-type trunk
[LSW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 111 123
[LSW1]int vlanif 111
[LSW1-Vlanif111]ip add 192.168.10.253 24
[LSW1-Vlanif111]vrrp vrid 111 virtual-ip 192.168.10.254
[LSW1-Vlanif111]vrrp vrid 111 priority 105
[LSW1-Vlanif111]int vlanif 123
[LSW1-Vlanif123]ip add 192.168.20.253 24
[LSW1-Vlanif123]vrrp vrid 123 virtual-ip 192.168.20.254
[LSW1-Vlanif123]int vlanif 1
[LSW1-Vlanif1]ip add 192.168.1.1 24
其中vrrp vrid 111 priority 105是为了让LSW1变为vrrp111的master,优先级越大越优先,LSW2中的vrrp vrid 123 priority 105同理。
[LSW2]vlan b 111 123
[LSW2]interface Eth-Trunk1
[LSW2-Eth-Trunk1]port link-type trunk
[LSW2-Eth-Trunk1]port trunk allow-pass vlan 111 123
[LSW2]interface GigabitEthernet0/0/3
[LSW2-GigabitEthernet0/0/3]port link-type trunk
[LSW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 111 123
[LSW2-GigabitEthernet0/0/3]interface GigabitEthernet0/0/4
[LSW2-GigabitEthernet0/0/4]port link-type trunk
[LSW2-GigabitEthernet0/0/4]port trunk allow-pass vlan 111 123
[LSW2-GigabitEthernet0/0/4]quit
[LSW2]int vlanif 111
[LSW2-Vlanif111]ip add 192.168.10.252 24
[LSW2-Vlanif111]vrrp vrid 111 virtual-ip 192.168.10.254
[LSW2-Vlanif111]int vlanif 123
[LSW2-Vlanif123]ip add 192.168.20.252 24
[LSW2-Vlanif123]vrrp vrid 123 virtual-ip 192.168.20.254
[LSW2-Vlanif123]vrrp vrid 123 priority 105
[LSW2-Vlanif123]int vlanif 1
[LSW2-Vlanif1]ip add 192.168.2.1 24
[LSW3]vlan b 111 123
[LSW3]interface GigabitEthernet0/0/1
[LSW3-GigabitEthernet0/0/1]port link-type trunk
[LSW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 111 123
[LSW3-GigabitEthernet0/0/1]interface GigabitEthernet0/0/2
[LSW3-GigabitEthernet0/0/2]port link-type trunk
[LSW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 111 123
[LSW3-GigabitEthernet0/0/2]interface GigabitEthernet0/0/3
[LSW3-GigabitEthernet0/0/3]port link-type access
[LSW3-GigabitEthernet0/0/3]port default vlan 111
[LSW3-GigabitEthernet0/0/3]interface GigabitEthernet0/0/4
[LSW3-GigabitEthernet0/0/4]port link-type access
[LSW3-GigabitEthernet0/0/4]port default vlan 123
[LSW4]vlan b 111 123
[LSW4]interface GigabitEthernet0/0/1
[LSW4-GigabitEthernet0/0/1]port link-type trunk
[LSW4-GigabitEthernet0/0/1]port trunk allow-pass vlan 111 123
[LSW4-GigabitEthernet0/0/1]interface GigabitEthernet0/0/2
[LSW4-GigabitEthernet0/0/2]port link-type trunk
[LSW4-GigabitEthernet0/0/2]port trunk allow-pass vlan 111 123
[LSW4-GigabitEthernet0/0/2]interface GigabitEthernet0/0/3
[LSW4-GigabitEthernet0/0/3]port link-type access
[LSW4-GigabitEthernet0/0/3]port default vlan 123
[LSW4-GigabitEthernet0/0/3]interface GigabitEthernet0/0/4
[LSW4-GigabitEthernet0/0/4]port link-type access
[LSW4-GigabitEthernet0/0/4]port default vlan 123
[AR1]int g 0/0/0
[AR1-GigabitEthernet0/0/0]ip add 192.168.10.1 24
[AR1]ip route-static 0.0.0.0 0 192.168.10.254
此时为了让全网互通,在AR1中以LSW1中的vlanif111中的IP地址192.168.10.254为下一跳接口配置默认路由
[AR2]int g 0/0/0
[AR2-GigabitEthernet0/0/0]ip add 192.168.0.1 24
[AR2-GigabitEthernet0/0/0]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip add 192.168.1.111 24
[AR2-GigabitEthernet0/0/1]int g0/0/2
[AR2-GigabitEthernet0/0/2]ip add 192.168.2.123 24
[AR3]int g 0/0/0
[AR3-GigabitEthernet0/0/0]ip add 192.168.0.2 24
测试直连网段连通性。
第三步 配置MSTP
[LSW1]stp region-configuration
[LSW1-mst-region]region-name cake
[LSW1-mst-region]revision-level 123
[LSW1-mst-region]instance 1 vlan 111
[LSW1-mst-region]instance 2 vlan 123
[LSW1-mst-region]active region-configuration
[LSW1]stp instance 1 root primary
[LSW1]stp instance 2 root secondary
其中stp instance 1 root primary指的是把LSW1设为实例1的根桥。
stp instance 2 root secondary指的是把LSW1设为实例2的备份根桥。
[LSW2]stp region-configuration
[LSW2-mst-region]region-name cake
[LSW2-mst-region]revision-level 123
[LSW2-mst-region]instance 1 vlan 111
[LSW2-mst-region]instance 2 vlan 123
[LSW2-mst-region]active region-configuration
[LSW2]stp instance 2 root primary
[LSW2]stp instance 1 root secondary
[LSW3]stp region-configuration
[LSW3-mst-region]region-name cake
[LSW3-mst-region]revision-level 123
[LSW3-mst-region]instance 1 vlan 111
[LSW3-mst-region]instance 2 vlan 123
[LSW3-mst-region]active region-configuration
[LSW4]stp region-configuration
[LSW4-mst-region]region-name cake
[LSW4-mst-region]revision-level 123
[LSW4-mst-region]instance 1 vlan 111
[LSW4-mst-region]instance 2 vlan 123
[LSW4-mst-region]active region-configuration
第四步 配置OSPF使全网互通
[LSW1]ospf 10 router-id 2.2.2.1
[LSW1-ospf-10]area 0
[LSW1-ospf-10-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[LSW1-ospf-10-area-0.0.0.0]network 192.168.10.0 0.0.0.255
[LSW2]ospf 10 router-id 2.2.2.2
[LSW2-ospf-10]area 0
[LSW2-ospf-10-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[LSW2-ospf-10-area-0.0.0.0]network 192.168.20.0 0.0.0.255
[AR2]ospf 10 router-id 1.1.1.2
[AR2-ospf-10]area 0
[AR2-ospf-10-area-0.0.0.0]network 192.168.0.0 0.0.0.255
[AR2-ospf-10-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[AR2-ospf-10-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[AR3]ospf 10 router-id 1.1.1.3
[AR3-ospf-10]area 0
[AR3-ospf-10-area-0.0.0.0]network 192.168.0.0 0.0.0.255
查看邻接关系是否建好
然后测试全网的连通性
关于ospf—我两个交换机上可能会有错误,欢迎指出问题。
第五步 在AR3上配置telnet功能
此时全网互通,开始配置telnet功能
[AR3]aaa
[AR3-aaa]local-user cake password cipher 123456 privilege level 15
[AR3-aaa]local-user cake service-type telnet
[AR3-aaa]quit
[AR3]user-interface vty 0 4
[AR3-ui-vty0-4]authentication-mode aaa
—进入aaa协议视图
—创建本地用户cake 权限级别为15(验证与授权)
—本地用户cake服务类型为telnet
—进入、开启用户虚拟终端0到4
—认证模式为aaa
此时telnet功能已打开,在AR1上测试登录。
登陆成功,实验完成。