HCIP-交换实验

根据实验要求,完成实验内容:

实验拓扑图如下所示 :

 搭建拓补图:

LSW1,LSW2:

[LS1]interface Eth-Trunk 0
[LS1-Eth-Trunk0]q
[LS1]interface g0/0/3
[LS1-GigabitEthernet0/0/3]eth-trunk 0	
[LS1]interface g0/0/4
[LS1-GigabitEthernet0/0/4]eth-trunk 0

[LS2]interface Eth-Trunk 0
[LS2]interface g0/0/3
[LS2-GigabitEthernet0/0/3]eth-trunk 0
[LS2]interface g0/0/4
[LS2-GigabitEthernet0/0/4]eth-trunk 0

vlan和trunk:

[LS1]vlan batch 2 to 3
[LS1]port-group group-member g0/0/5 to g0/0/7 Eth-Trunk 0
[LS1-port-group]port link-type trunk 
[LS1-port-group]port trunk allow-pass vlan all 

[LS2]vlan batch 2 to 3
[LS2]port-group group-member g0/0/5 to g0/0/7 Eth-Trunk 0
[LS2-port-group]port link-type trunk 	
[LS2-port-group]port trunk allow-pass vlan all 

[LS3]vlan batch 2 to 3
[LS3]port-group group-member g0/0/1 g0/0/2
[LS3-port-group]port link-type trunk 
[LS3-port-group]port trunk allow-pass vlan all 
[LS3]port-group group-member e0/0/3 e0/0/4
[LS3-port-group]port link-type access 
[LS3-port-group]port default vlan 2

[LS4]vlan batch 2 to 3
[LS4]port-group group-member g0/0/1 g0/0/2
[LS4-port-group]port link-type trunk 	
[LS4-port-group]port trunk allow-pass vlan all 
[LS4]port-group group-member e0/0/3 e0/0/4
[LS4-port-group]port link-type access 	
[LS4-port-group]port default vlan 3

[LS5]port-group group-member g0/0/1 g0/0/2
[LS5-port-group]port link-type trunk 	
[LS5-port-group]port trunk allow-pass vlan all 
[LS5]port-group group-member e0/0/3 e0/0/4
[LS5-port-group]port link-type access 
[LS5-port-group]port default vlan 3

 STP:

[LS1]stp enable 
[LS1]stp region-configuration 
[LS1-mst-region]region-name a	
[LS1-mst-region]instance 1 vlan 2	
[LS1-mst-region]instance 2 vlan 3	
[LS1-mst-region]active region-configuration 

[LS2]stp enable 
[LS2]stp region-configuration 
[LS2-mst-region]region-name a
[LS2-mst-region]instance 1 vlan 2
[LS2-mst-region]instance 2 vlan 3

[LS3]stp enable 
[LS3]stp region-configuration 
[LS3-mst-region]region-name a
[LS3-mst-region]instance 1 vlan 2
[LS3-mst-region]instance 2 vlan 3

[LS4]stp enable 
[LS4]stp region-configuration 
[LS4-mst-region]region-name a
[LS4-mst-region]instance 1 vlan 2
[LS4-mst-region]instance 2 vlan 3

[LS5]stp enable 
[LS5]stp region-configuration 
[LS5-mst-region]region-name a
[LS5-mst-region]instance 1 vlan 2
[LS5-mst-region]instance 2 vlan 3

 根与备份根:

[LS1]stp instance 1 root primary 
[LS1]stp instance 2 root secondary 

[LS2]stp instance 2 root primary 
[LS2]stp instance 1 root secondary 

SVI:

[LS1]interface Vlanif 2
[LS1-Vlanif2]ip address 192.168.2.1 24
[LS1]interface Vlanif 3
[LS1-Vlanif3]ip address 192.168.3.1 24

[LS2]interface Vlanif 2
[LS2-Vlanif2]ip address 192.168.2.2 24
[LS2]interface Vlanif 3
[LS2-Vlanif3]ip address 192.168.3.2 24

vrrp:

[LS1]interface Vlanif 2
[LS1-Vlanif2]vrrp vrid 1 virtual-ip 192.168.2.255
[LS1-Vlanif2]vrrp vrid 1 priority 120
[LS1-Vlanif2]vrrp vrid 1 track interface g0/0/24 reduced 30	
[LS1]interface Vlanif 3
[LS1-Vlanif3]vrrp vrid 2 virtual-ip 192.168.3.254

[LS2]interface Vlanif 3
[LS2-Vlanif3]vrrp vrid 2 virtual-ip 192.168.3.254
[LS2-Vlanif3]vrrp vrid 2 track interface g0/0/1 reduced 30	
[LS2]interface Vlanif 2
[LS2-Vlanif2]vrrp vrid 1 virtual-ip 192.168.2.254

dhcp:

[LS1]dhcp enable 
[LS1]ip pool v2
[LS1-ip-pool-v2]network 192.168.2.0 mask 24
[LS1-ip-pool-v2]gateway-list 192.168.2.254
[LS1]interface Vlanif 2
[LS1-Vlanif2]dhcp select global 

[LS1]ip pool v3
[LS1-ip-pool-v3]network 192.168.3.0 mask 24
[LS1-ip-pool-v3]gateway-list 192.168
[LS1-ip-pool-v3]gateway-list 192.168.3.254
[LS1]interface Vlanif 3
[LS1-Vlanif3]dhcp select global 

[LS2]dhcp enable 	
[LS2]ip pool v2
[LS2-ip-pool-v2]network 192.168.2.0 mask 24
[LS2-ip-pool-v2]gateway-list 192.168.2.254
[LS2]interface Vlanif 2
[LS2-Vlanif2]dhcp select global 	

[LS2]ip pool v3
[LS2-ip-pool-v3]network 192.168.3.0 mask 24
[LS2-ip-pool-v3]gateway-list 192.168.3.254
[LS2]interface Vlanif 3
[LS2-Vlanif3]dhcp select global 

配置IP:

[LS1]vlan 4
[LS1]interface g0/0/2
[LS1-GigabitEthernet0/0/2]port link-type access 
[LS1-GigabitEthernet0/0/2]port default vlan 4
[LS1]interface Vlanif 4
[LS1-Vlanif4]ip address 192.168.0.2 30

[LS2]vlan 4
[LS2]interface g0/0/1
[LS2-GigabitEthernet0/0/1]port link-type access 
[LS2-port-group-default]port default vlan 4
[LS2]interface Vlanif 4
[LS2-Vlanif4]ip address 192.168.0.6 30

R1:

[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.0.1 30
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip address 192.168.0.5 30
[R1-GigabitEthernet0/0/2]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24

R2:

[R2]interface LoopBack 0
[R2-LoopBack0]ip address 2.2.2.2 24
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 12.1.1.2 24

启动OSPF:

[LS1]ospf 1
[LS1-ospf-1]area 0
[LS1-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.255.255

[LS2]ospf 1
[LS2-ospf-1]area 0
[LS2-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.255.255

[R1]ospf 1
[R1-ospf-1]area 0	
[R1-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.255.255

实现公网访问:

[R1]ospf 1	
[R1-ospf-1]default-route-advertise always 
[R1]ip route-static 0.0.0.0 0 12.1.1.2
[R1]acl 200	
[R1-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]nat outbound 2000

结果:

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值