三层架构综合实验

一.实验要求

请添加图片描述

二.配置

2.1 top

在这里插入图片描述

2.2 配置trunk

[rw1]vlan 2
[rw2]vlan 2

[rw1]interface Eth-Trunk 0
[rw1-GigabitEthernet0/0/22]eth-trunk 0
[rw1-GigabitEthernet0/0/23]eth-trunk 0
[rw2]interface Eth-Trunk 0
[rw2-GigabitEthernet0/0/22]eth-trunk 0
[rw2-GigabitEthernet0/0/23]eth-trunk 0

[rw1]int Eth-Trunk 0
[rw1-Eth-Trunk0]port link-type trunk 
[rw1-Eth-Trunk0]port trunk allow-pass vlan 2
[rw1]int g0/0/1
[rw1-GigabitEthernet0/0/1]port link-type trunk 
[rw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[rw1]int g0/0/2
[rw1-GigabitEthernet0/0/2]port link-type trunk 
[rw1-GigabitEthernet0/0/2]port trunk allow-pass vlan2

[rw2]port-group group-member Eth-Trunk 0 GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
[rw2-port-group]port link-type trunk 
[rw2-Eth-Trunk0]port link-type trunk 
[rw2-GigabitEthernet0/0/1]port link-type trunk 
[rw2-GigabitEthernet0/0/2]port link-type trunk 
[rw2-port-group]port trunk allow-pass vlan 2
[rw2-Eth-Trunk0]port trunk allow-pass vlan 2
[rw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[rw2-GigabitEthernet0/0/2]port trunk allow-pass vlan 2
 
[rw3]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
[rw3-port-group]port link-type trunk 
[rw3-GigabitEthernet0/0/1]port link-type trunk 
[rw3-GigabitEthernet0/0/2]port link-type trunk 
[rw3-port-group]port trunk allow-pass vlan 2
[rw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[rw3-GigabitEthernet0/0/2]port trunk allow-pass vlan 2
 
[rw4]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
[rw4-port-group]port link-type trunk 
[rw4-GigabitEthernet0/0/1]port link-type trunk 
[rw4-GigabitEthernet0/0/2]port link-type trunk 
[rw4-port-group]port trunk allow-pass vlan 2
[rw4-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[rw4-GigabitEthernet0/0/2]port trunk allow-pass vlan 2
 
[rw3-GigabitEthernet0/0/4]port link-type access
[rw3-GigabitEthernet0/0/4]port default vlan 2
[rw4-GigabitEthernet0/0/4]port link-type access
[rw4-GigabitEthernet0/0/4]port default vlan 2

2.3 配置stp

[rw1]stp enable 
[rw1]stp region-configuration 
[rw1-mst-region]region-name a          
[rw1-mst-region]instance 1 vlan 1      
[rw1-mst-region]instance 2 vlan 2   
[rw1-mst-region]active region-configuration
[rw1]stp instance 1 root primary    
[rw1]stp instance 2 root secondary 
 
[rw1]stp enable
[rw2]stp region-configuration
[rw2-mst-region] region-name a
[rw2-mst-region] instance 1 vlan 1
[rw2-mst-region] instance 2 vlan 2
[rw2-mst-region] active region-configuration
[rw2]stp instance 1 root secondary   
[rw2]stp instance 2 root primary        
 
[rw3]stp enable
[rw3]stp region-configuration
[rw3-mst-region] region-name a
[rw3-mst-region] instance 1 vlan 1
[rw3-mst-region] instance 2 vlan 2
[rw3-mst-region] active region-configuration
[rw3]port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4
[rw3-port-group]stp edged-port enable 
[rw3-GigabitEthernet0/0/3]stp edged-port enable 
[rw3-GigabitEthernet0/0/4]stp edged-port enable 
 
[rw4]stp enable
[rw4]stp region-configuration
[rw4-mst-region] region-name a
[rw4-mst-region] instance 1 vlan 1
[rw4-mst-region] instance 2 vlan 2
[rw4-mst-region] active region-configuration
 
[rw4]port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4
[rw4-port-group]stp edged-port enable 
[rw4-GigabitEthernet0/0/3]stp edged-port enable 
[rw4-GigabitEthernet0/0/4]stp edged-port enable 
 
[rw1]display stp brief   

2.4 配置svi

[rw1]interface vlan 1
[rw1-Vlanif1]ip address 172.16.1.1 25
[rw1-Vlanif2]ip address 172.16.1.129 25
 
[rw2]int vlan 1
[rw2-Vlanif1]ip address 172.16.1.2 25
[rw2-Vlanif2]ip address 172.16.1.130 25
 
[rw2]ping 172.16.1.1     
[rw2]ping 172.16.1.129

2.5 配置vrrp

[rw1-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126
[rw1-Vlanif1]vrrp vrid 1 priority 105   
[rw1-Vlanif1]vrrp vrid 1 track interface GigabitEthernet 0/0/24 reduced 10[rw1-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254
 
 
[rw2-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126
[rw2-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254
[rw2-Vlanif2]vrrp vrid 1 priority 105
[rw2-Vlanif2]vrrp vrid 1 track interface GigabitEthernet 0/0/24 
 
<rw1>display vrrp

2.6 配置公网

[rw1]dhcp enable 
[rw1]ip pool a
[rw1-ip-pool-a] gateway-list 172.16.1.126
[rw1-ip-pool-a] network 172.16.1.0 mask 255.255.255.128
[rw1-ip-pool-a]ip pool b
[rw1-ip-pool-b] gateway-list 172.16.1.254
[rw1-ip-pool-b] network 172.16.1.128 mask 255.255.255.128
[rw1-Vlanif1]dhcp select global
[rw1-Vlanif2]dhcp select global
 
[rw2]dhcp enable 
[rw2]ip pool a
[rw2-ip-pool-a] gateway-list 172.16.1.126
[rw2-ip-pool-a] network 172.16.1.0 mask 255.255.255.128
[rw2-ip-pool-a]ip pool b
[rw2-ip-pool-b] gateway-list 172.16.1.254
[rw2-ip-pool-b] network 172.16.1.128 mask 255.255.255.128
[rw2-Vlanif1]dhcp select global
[rw2-Vlanif2]dhcp select global

[isp-LoopBack0]ip address 1.1.1.1 24
[isp-GigabitEthernet0/0/0]ip address 12.1.1.1 24
 
[r2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[r2-GigabitEthernet0/0/1]ip address 172.16.0.1 30
[r2-GigabitEthernet0/0/2]ip address 172.16.0.5 30
 
[rw1]vlan 99   
[rw1-GigabitEthernet0/0/24]port link-type access 
[rw1-GigabitEthernet0/0/24]port default vlan 99
[rw1-GigabitEthernet0/0/24]int vlan99
[rw1-Vlanif99]ip address 172.16.0.2 30
 
[rw2]vlan 99
[rw2-GigabitEthernet0/0/24]port link-type access 
[rw2-GigabitEthernet0/0/24]port default vlan 99
[rw2-GigabitEthernet0/0/24]int vlan99
[rw2-Vlanif99]ip address 172.16.0.6 30

2.7 路由

[r2]ospf 1 router-id 2.2.2.2 
[r2-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 172.16.0.5 0.0.0.0
[rw1]ospf 1 router-id 3.3.3.3
[rw1-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[rw1-ospf-1-area-0.0.0.1]network 172.16.1.1 0.0.0.0
[rw1-ospf-1-area-0.0.0.1]network 172.16.1.129 0.0.0.0
 
[rw2]ospf 1 router-id 4.4.4.4
[rw2-ospf-1-area-0.0.0.0]network 172.16.0.6 0.0.0.0
[rw2-ospf-1-area-0.0.0.1]network 172.16.1.2 0.0.0.0
[rw2-ospf-1-area-0.0.0.1]network 172.16.1.130 0.0.0.0

[rw1-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0 
[rw2-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0 
 
[r2]ip route-static 0.0.0.0 0 12.1.1.1  
[r2-ospf-1]default-route-advertise  

[rw1-ospf-1]silent-interface all
[rw1-ospf-1]undo silent-interface Vlanif 1
[rw1-ospf-1]undo silent-interface Eth-Trunk 0
[rw1-ospf-1]undo silent-interface Vlanif 99
 
[rw2-ospf-1]silent-interface all
[rw2-ospf-1]undo silent-interface Vlanif 1
[rw2-ospf-1]undo silent-interface Eth-Trunk 0
[rw2-ospf-1]undo silent-interface Vlanif 99

[r2]acl 2000
[r2-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r2-GigabitEthernet0/0/0]nat outbound 2000
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值