实验拓扑
实验要求
1.Server1及5erver2是两种不同业务的服务器,分别处于两个vLA: 10及20。pc要求能够访向到server1及server2;
2,当网络正常时,PC1访问server1的流量走Router>SM1>SN3>Server1这条路径,并且往返路轻—致,而PC2访间
server2的流量则走Router>SW2 SW3>Server2这条路径并且也要求来回路径一致;
3.当SW1发生故障或者SW1连接Router的链路Down掉时,要求pc访问server1的流量能够自动切换到sw2,同样的当
sw2发生故障时,Pc访问server2的流量要能够自动切换到sw1;
4.SW1,SW2、5w3三台交换机构成一个二层环路,运行MSTP防止环路;
5.Sw1及sw2为汇聚交换机,server1和server2的网关在这两台设备上;
6.SW1 、 SW2及 Router运行O5PF ; SW1及SW2的RouteID分别为192.168.255.11及192.168.255.12,
Router的RouterID为192.168. 255.1
配置
R1
sysname R1 router id 192.168.255.1 interface GigabitEthernet0/0/0 ip address 192.168.202.2 255.255.255.0 # interface GigabitEthernet0/0/1 ip address 192.168.201.2 255.255.255.0 # interface GigabitEthernet0/0/2 ip address 192.168.1.254 255.255.255.0 # interface NULL0 # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.201.0 0.0.0.255 network 192.168.202.0 0.0.0.255 #
SW1
# sysname SW1 # router id 192.168.255.11 # vlan batch 10 20 201 to 203 # stp instance 1 root primary stp instance 2 root secondary # stp region-configuration region-name test instance 1 vlan 10 instance 2 vlan 20 active region-configuration # interface Vlanif1 # interface Vlanif10 ip address 192.168.10.253 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254 vrrp vrid 10 priority 120 vrrp vrid 10 track interface GigabitEthernet0/0/2 reduced 30 # interface Vlanif20 ip address 192.168.20.253 255.255.255.0 vrrp vrid 20 virtual-ip 192.168.20.254 # interface Vlanif201 ip address 192.168.201.1 255.255.255.0 # interface Vlanif203 ip address 192.168.203.1 255.255.255.0 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 20 # interface GigabitEthernet0/0/2 port link-type access port default vlan 201 # interface GigabitEthernet0/0/10 port link-type trunk port trunk allow-pass vlan 10 20 203 # ospf 1 import-route direct route-policy vlanif10and20 area 0.0.0.0 network 192.168.201.0 0.0.0.255 network 192.168.203.0 0.0.0.255 # route-policy vlanif10and20 permit node 10 if-match interface Vlanif10 apply cost 10 # route-policy vlanif10and20 permit node 20 if-match interface Vlanif20 apply cost 20 #
SW2
# sysname SW2 # router id 192.168.255.12 # vlan batch 10 20 23 201 to 203 # stp instance 1 root secondary stp instance 2 root primary # stp region-configuration region-name test instance 1 vlan 10 instance 2 vlan 20 active region-configuration # interface Vlanif1 # interface Vlanif10 ip address 192.168.10.252 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254 # interface Vlanif20 ip address 192.168.20.252 255.255.255.0 vrrp vrid 20 virtual-ip 192.168.20.254 vrrp vrid 20 priority 120 vrrp vrid 20 track interface GigabitEthernet0/0/2 reduced 30 # interface Vlanif202 ip address 192.168.202.1 255.255.255.0 # interface Vlanif203 ip address 192.168.203.2 255.255.255.0 # interface MEth0/0/1 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 20 # interface GigabitEthernet0/0/2 port link-type access port default vlan 202 # interface GigabitEthernet0/0/10 port link-type trunk port trunk allow-pass vlan 10 20 203 # interface GigabitEthernet0/0/11 # ospf 1 import-route direct route-policy vlanif10and20 area 0.0.0.0 network 192.168.202.0 0.0.0.255 network 192.168.203.0 0.0.0.255 # route-policy vlanif10and20 permit node 10 if-match interface Vlanif10 apply cost 20 # route-policy vlanif10and20 permit node 20 if-match interface Vlanif20 apply cost 10 #
SW3
sysname SW3 # vlan batch 10 20 # stp region-configuration region-name test instance 1 vlan 10 instance 2 vlan 20 active region-configuration # interface Vlanif1 # interface GigabitEthernet0/0/1 port link-type access port default vlan 10 stp edged-port enable # interface GigabitEthernet0/0/2 port link-type access port default vlan 20 stp edged-port enable # interface GigabitEthernet0/0/3 port link-type trunk port trunk allow-pass vlan 10 20 # interface GigabitEthernet0/0/4 port link-type trunk port trunk allow-pass vlan 10 20 #
配置仅供参考 如有错误欢迎在评论区指正,谢谢!
我的微信
这是我的微信扫一扫
评论