一 实验拓扑

-
二 实验要求
- 内网IP地址使用172.16.0.0/16。
- SW1和SW2之间互为备份。
- 使用VRRP/MSTP/VLAN/eth-trunk等技术。
- 所有PC通过DHCP获取IP地址。
- ISP只配置IP地址,所有电脑能正常访问ISP路由器环回。
三、实验步骤
VLAN配置
undo info-center enable
#sw3
[sw3]vlan batch 2 to 3
[sw3]int g0/0/1
[sw3-GigabitEthernet0/0/1]port link-type access
[sw3-GigabitEthernet0/0/1]port default vlan 2
[sw3-GigabitEthernet0/0/1]int g0/0/2
[sw3-GigabitEthernet0/0/2]port link-type access
[sw3-GigabitEthernet0/0/2]port default vlan 2
#sw4
[SW4]vlan batch 2 to 3
[sw4]int g0/0/1
[SW4-GigabitEthernet0/0/1]port link-type access
[SW4-GigabitEthernet0/0/1]port default vlan 2
[sw4-GigabitEthernet0/0/1]int g0/0/2
[sw4-GigabitEthernet0/0/2]port link-type access
[sw4-GigabitEthernet0/0/2]port default vlan 3
#sw3、sw4与其他交换机之间配置trunk
[sw3]port-group group-member g0/0/3 g0/0/4
[sw3-port-group]port link-type trunk
[sw3-GigabitEthernet0/0/3]port link-type trunk
[sw3-GigabitEthernet0/0/4]port link-type trunk
[sw3-port-group]port trunk allow-pass vlan 2 3
[sw3-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[sw3-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3
[SW4]port-group group-member g0/0/3 g0/0/4
[sw4-port-group]port link-type trunk
[sw4-GigabitEthernet0/0/3]port link-type trunk
[sw4-GigabitEthernet0/0/4]port link-type trunk
[sw4-port-group]port trunk allow-pass vlan 2 3
[sw4-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[sw4-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3
#sw2、sw1
[sw1]vlan batch 2 3 10 20
[sw1]port-group group-member g0/0/3 g0/0/4
[sw1-port-group]port link-type trunk
[sw1-GigabitEthernet0/0/3]port link-type trunk
[sw1-GigabitEthernet0/0/4]port link-type trunk
[sw1-port-group]port trunk allow-pass vlan 2 3
[sw1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[sw1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3
[sw1]int Eth-Trunk 0
[sw1-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 to 0/0/2
[sw1-Eth-Trunk0]port link-type trunk
[sw1-Eth-Trunk0]port trunk allow-pass vlan 2 3 10 20
[sw1-Eth-Trunk0]int g 0/0/5
[sw1-GigabitEthernet0/0/5]port link-type access
[sw1-GigabitEthernet0/0/5]port default vlan 10
[sw2]vlan batch 2 3 10 20
[sw2]port-group group-member g0/0/3 g0/0/4
[sw2-port-group]port link-type trunk
[sw2-GigabitEthernet0/0/3]port link-type trunk
[sw2-GigabitEthernet0/0/4]port link-type trunk
[sw2-port-group]port trunk allow-pass vlan 2 3
[sw2-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[sw2-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3
[sw2]int Eth-Trunk 0
[sw2-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 to 0/0/2
[sw2-Eth-Trunk0]port link-type trunk
[sw2-Eth-Trunk0]port trunk allow-pass vlan 2 3 10 20
[sw2-Eth-Trunk0]int g0/0/5
[sw2-GigabitEthernet0/0/5]port link-type access
[sw2-GigabitEthernet0/0/5]port default vlan 20
display port vlan active




vlanif
[sw1]int v 2
[sw1-Vlanif2]ip add 172.16.0.1 26
[sw1-Vlanif2]int v 3
[sw1-Vlanif3]ip add 172.16.0.65 26
[sw1-Vlanif3]int v 10
[sw1-Vlanif10]ip add 172.16.0.129 26
[sw2]int v 2
[sw2-Vlanif2]ip add 172.16.0.2 26
[sw2-Vlanif2]int v 3
[sw2-Vlanif3]ip add 172.16.0.66 26
[sw2-Vlanif3]int v 20
[sw2-Vlanif20]ip add 172.16.0.193 26
[R1-GigabitEthernet0/0/1]ip add 172.16.0.130 26
[R1-GigabitEthernet0/0/1]int g 0/0/2
[R1-GigabitEthernet0/0/2]ip add 172.16.0.194 26
[R1-GigabitEthernet0/0/2]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[ISP]int g 0/0/0
[ISP-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[ISP-GigabitEthernet0/0/0]int l0
[ISP-LoopBack0]ip add 2.2.2.2 24
display ip interface brief




stp
[sw1]stp enable
[sw1]stp mode mstp
[sw1]stp region-configuration
[sw1-mst-region]region-name aa
[sw1-mst-region]instance 1 vlan 2
[sw1-mst-region]instance 2 vlan 3
[sw1-mst-region]active region-configuration
[sw1-mst-region]q
[sw1]stp instance 1 root primary
[sw1]stp instance 2 root secondary
[sw2]stp enable
[sw2]stp mode mstp
[sw2]stp region-configuration
[sw2-mst-region]region-name aa
[sw2-mst-region]instance 1 vlan 2
[sw2-mst-region]instance 2 vlan 3
[sw2-mst-region]active region-configuration
[sw2-mst-region]q
[sw2]stp instance 1 root secondary
[sw2]stp instance 2 root primary
[sw3]stp enable
[sw3]stp mode mstp
[sw3]stp region-configuration
[sw3-mst-region]region-name aa
[sw3-mst-region]instance 1 vlan 2
[sw3-mst-region]instance 2 vlan 3
[sw3-mst-region]active region-configuration
[sw4]stp enable
[sw4]stp mode mstp
[sw4]stp region-configuration
[sw4-mst-region]region-name aa
[sw4-mst-region]instance 1 vlan 2
[sw4-mst-region]instance 2 vlan 3
[sw4-mst-region]active region-configuration
display stp brief




dhcp
[sw1]dhcp enable
[sw1]ip pool aa
[sw1-ip-pool-aa]network 172.16.0.0 mask 26
[sw1-ip-pool-aa]gateway-list 172.16.0.62
[sw1-ip-pool-aa]dns-list 8.8.8.8
[sw1-ip-pool-aa]int v 2
[sw1-Vlanif2]dhcp select global
[sw1-Vlanif2]ip pool bb
[sw1-ip-pool-bb]network 172.16.0.64 mask 26
[sw1-ip-pool-bb]gateway-list 172.16.0.126
[sw1-ip-pool-bb]dns-list 8.8.8.8
[sw1-ip-pool-bb]int v 3
[sw1-Vlanif3]dhcp select global
[sw2]dhcp enable
[sw2]ip pool aa
[sw2-ip-pool-aa]network 172.16.0.0 mask 26
[sw2-ip-pool-aa]gateway-list 172.16.0.62
[sw2-ip-pool-aa]dns-list 8.8.8.8
[sw2-ip-pool-aa]int v 2
[sw2-Vlanif2]dhcp select global
[sw2]ip pool bb
Info:It's successful to create an IP address pool.
[sw2-ip-pool-bb]network 172.16.0.64 mask 26
[sw2-ip-pool-bb]gateway-list 172.16.0.126
[sw2-ip-pool-bb]dns-list 8.8.8.8
[sw2-ip-pool-bb]int v 3
[sw2-Vlanif3]dhcp select global
display ip pool


vrrp配置
[sw1]int v 2
[sw1-Vlanif2]vrrp vrid 1 virtual-ip 172.16.0.62
[sw1-Vlanif2]vrrp vrid 1 priority 120
[sw1-Vlanif2]vrrp vrid 1 track interface g0/0/5 reduced 30
[sw1-Vlanif2]int v 3
[sw1-Vlanif3]vrrp vrid 2 virtual-ip 172.16.0.126
[sw2]int v 2
[sw2-Vlanif2]vrrp vrid 1 virtual-ip 172.16.0.62
[sw2-Vlanif2]int v 3
[sw2-Vlanif3]vrrp vrid 2 virtual-ip 172.16.0.126
[sw2-Vlanif3]vrrp vrid 2 priority 120
[sw2-Vlanif3]vrrp vrid 2 track interface Vlanif 20 reduced 30
dis vrrp brief


ospf配置
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]a 0
[r1-ospf-1-area-0.0.0.0]ne 172.16.0.128 0.0.0.63
[r1-ospf-1-area-0.0.0.0]ne 172.16.0.192 0.0.0.63
[sw1]ospf 1 router-id 2.2.2.2
[sw1-ospf-1]a 0
[sw1-ospf-1-area-0.0.0.0]ne 172.16.0.128 0.0.0.63
[sw1-ospf-1-area-0.0.0.0]ne 172.16.0.0 0.0.0.63
[sw1-ospf-1-area-0.0.0.0]ne 172.16.0.64 0.0.0.63
[sw2]ospf 1 router-id 3.3.3.3
[sw2-ospf-1]a 0
[sw2-ospf-1-area-0.0.0.0]ne 172.16.0.192 0.0.0.63
[sw2-ospf-1-area-0.0.0.0]ne 172.16.0.0 0.0.0.63
[sw2-ospf-1-area-0.0.0.0]ne 172.16.0.64 0.0.0.63
dis ospf peer brief



PC可访问ISP
[r1]ip route-static 0.0.0.0 12.0.0.2
[r1-acl-basic-2000]rule permit source 172.16.0.0 0.0.0.255
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]nat outbound 2000
[r1-ospf-1]default-route-advertise




HCIP作业:网络实验配置与实现
1015

被折叠的 条评论
为什么被折叠?



