目录
一、实验拓扑
二、实验要求
三、实验步骤
1、链路聚合(配置Eth-trunk)
2、配置vlan(创建划分vlan,配置trunk干道)
3、MSTP配置
4、VRRP配置
5、DHCP配置
6、vlan互通
7、NAT配置(做ACL,内网访问公网)
一、实验拓扑
二、实验要求
1、内网IP地址使用172.16.0.0/16分配
2、sw1和sW2之间互为备份
3、VRRP/STP/VLAN/Eth-trunk均使用
4、所有PC均通过DHCP获取IP地址
5、ISP只能配置IP地址
6、所有电脑可以正常访问ISP路由器环回
三、实验步骤
1、链路聚合(配置Eth-trunk)
[SW1]interface Eth-Trunk 0
[SW1-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 0/0/2
[SW2]interface Eth-Trunk 0
[SW2-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 0/0/2
2、配置vlan(创建划分vlan,配置trunk干道)
[SW1]vlan batch 2 to 3
[SW1]int Eth-Trunk 0
[SW1-Eth-Trunk0]port link-type trunk
[SW1-Eth-Trunk0]port trunk allow-pass vlan 2 3
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[SW1-GigabitEthernet0/0/4]port link-type trunk
[SW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3[SW2]vlan batch 2 3
[SW2]port-group group-member g0/0/4 g0/0/3 Eth-Trunk 0
[SW2-port-group]port link-type trunk
[SW2-port-group]port trunk allow-pass vlan 2 3[SW3]vlan batch 2 3
[SW3-GigabitEthernet0/0/1]p l a
[SW3-GigabitEthernet0/0/1]p d v 2
[SW3-GigabitEthernet0/0/2]p l a
[SW3-GigabitEthernet0/0/2]p d v 3
[SW3-GigabitEthernet0/0/3]p l t
[SW3-GigabitEthernet0/0/3]p t a v 2 3
[SW3-GigabitEthernet0/0/4]p l t
[SW3-GigabitEthernet0/0/4]p t a v 2 3[SW4]vlan batch 2 3
[SW4-GigabitEthernet0/0/1]p l a
[SW4-GigabitEthernet0/0/1]p d v 2
[SW4-GigabitEthernet0/0/2]p l a
[SW4-GigabitEthernet0/0/2]p d v 3
[SW4-GigabitEthernet0/0/3]p l t
[SW4-GigabitEthernet0/0/3]p t a v 2 3
[SW4-GigabitEthernet0/0/4]p l t
[SW4-GigabitEthernet0/0/4]p t a v 2 3
3、MSTP配置
[SW1]stp region-configuration
[SW1-mst-region]region-name aa
[SW1-mst-region]revision-level 1
[SW1-mst-region]instance 1 vlan 2
[SW1-mst-region]instance 2 vlan 3
[SW1-mst-region]active region-configuration [SW2]stp region-configuration
[SW2-mst-region]region-name aa
[SW2-mst-region] revision-level 1
[SW2-mst-region] instance 1 vlan 2
[SW2-mst-region] instance 2 vlan 3
[SW2-mst-region] active region-configuration[SW3]stp region-configuration
[SW3-mst-region]region-name aa
[SW3-mst-region] revision-level 1
[SW3-mst-region] instance 1 vlan 2
[SW3-mst-region] instance 2 vlan 3
[SW3-mst-region] active region-configuration[SW4]stp region-configuration
[SW4-mst-region]region-name aa
[SW4-mst-region] revision-level 1
[SW4-mst-region] instance 1 vlan 2
[SW4-mst-region] instance 2 vlan 3
[SW4-mst-region] active region-configuration
[SW1]stp instance 1 root primary
[SW1]stp instance 2 root secondary [SW2]stp instance 1 root secondary
[SW2]stp instance 2 root primary
4、VRRP配置
[SW1]interface Vlanif 2
[SW1-Vlanif2]ip address 172.16.2.1 24
[SW2]interface Vlanif 2
[SW2-Vlanif2]ip add 172.16.2.2 24[SW2]interface Vlanif 3
[SW2-Vlanif3]ip address 172.16.3.1 24
[SW1]int Vlanif 3
[SW1-Vlanif3]ip add 172.16.3.2 24[SW1]int v 2
[SW1-Vlanif2]vrrp vrid 2 virtual-ip 172.16.2.254
[SW1-Vlanif2]vrrp vrid 2 priority 110
[SW2]int v 2
[SW2-Vlanif2]vrrp vrid 2 virtual-ip 172.16.2.254[SW2-Vlanif3]vrrp vrid 3 virtual-ip 172.16.3.254
[SW2-Vlanif3]vrrp vrid 3 priority 110
[SW1-Vlanif3]vrrp vrid 3 virtual-ip 172.16.3.254
5、DHCP配置
[SW1]dhcp enable
[SW1]ip pool v2
[SW1-ip-pool-v2]network 172.16.2.0 mask 24
[SW1-ip-pool-v2]gateway-list 172.16.2.254
[SW1]ip pool v3
[SW1-ip-pool-v3]network 172.16.3.0 mask 24
[SW1-ip-pool-v3]gateway-list 172.16.3.254[SW1]int v 2
[SW1-Vlanif2]dhcp select global
[SW1]int v 3
[SW1-Vlanif3]dhcp select global [SW2]dhcp enable
[SW2]ip pool v2
[SW2-ip-pool-v2]network 172.16.2.0 mask 24
[SW2-ip-pool-v2]gateway-list 172.16.2.254
[SW2]ip pool v3
[SW2-ip-pool-v3]network 172.16.3.0 mask 24
[SW2-ip-pool-v3]gateway-list 172.16.3.254[SW2]int v 2
[SW2-Vlanif2]dhcp select global
[SW2]int v 3
[SW2-Vlanif3]dhcp select global
6、vlan互通
[SW1]vlan 1000
[SW1]interface vlanif 1000
[SW1-Vlanif1000]ip add 172.16.0.1 30[SW1]int g0/0/5
[SW1-GigabitEthernet0/0/5]port link-type access
[SW1-GigabitEthernet0/0/5]port default vlan 1000[SW2]vlan 1000
[SW2]int v 1000
[SW2-Vlanif1000]ip add 172.16.1.1 30
[SW2-GigabitEthernet0/0/5]p d v 10
[SW2-GigabitEthernet0/0/5]p d v 1000
[AR1]int g0/0/1
[AR1-GigabitEthernet0/0/1]ip add 172.16.0.2 30
[AR1-GigabitEthernet0/0/1]int g0/0/2
[AR1-GigabitEthernet0/0/2]ip add 172.168.1.2 30
[AR1-GigabitEthernet0/0/2]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip add 12.0.0.1 24[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[ISP-GigabitEthernet0/0/0]int l0
[ISP-LoopBack0]ip add 1.1.1.1 24
[AR1]ip route-static 0.0.0.0 0 12.0.0.2[AR1]ospf 1 router-id 1.1.1.1
[AR1-ospf-1]a 0
[AR1-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[AR1-ospf-1-area-0.0.0.0]network 172.16.1.2 0.0.0.0[SW1]ospf 1 router-id 2.2.2.2
[SW1-ospf-1]a 0
[SW1-ospf-1-area-0.0.0.0]network 172.16.2.1 0.0.0.0
[SW1-ospf-1-area-0.0.0.0]network 172.16.3.2 0.0.0.0
[SW1-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0[SW2]ospf 1 router-id 3.3.3.3
[SW2-ospf-1]a 0
[SW2-ospf-1-area-0.0.0.0]network 172.16.2.2 0.0.0.0
[SW2-ospf-1-area-0.0.0.0]network 172.16.3.1 0.0.0.0
[SW2-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0# 下发缺省
[AR1-ospf-1]default-route-advertise
7、NAT配置(做ACL,内网访问公网)
[AR1]acl 2000
[AR1-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]nat outbound 2000