三层架构综合实验

一.实验要求

三层架构综合实验_第1张图片

二.配置

2.1 top

三层架构综合实验_第2张图片

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

你可能感兴趣的:(架构,网络)