IP课:stp、vrrp实验

在这里插入图片描述
一、 交换机的二层接口配置。
SW1:
[sw1]int g0/0/5
[sw1-GigabitEthernet0/0/5]port link-type trunk
[sw1-GigabitEthernet0/0/5]port trunk allow-pass vlan all
[sw1]int g0/0/6
[sw1-GigabitEthernet0/0/6]port link-type trunk
[sw1-GigabitEthernet0/0/6]port trunk allow-pass vlan all
[sw1]int g0/0/7
[sw1-GigabitEthernet0/0/7]port link-type trunk
[sw1-GigabitEthernet0/0/7]port trunk allow-pass vlan all

SW2:
[sw2]int g0/0/5
[sw2-GigabitEthernet0/0/5]port link-type trun
[sw2-GigabitEthernet0/0/5]port trunk allow-pass vlan all
[sw2]int g0/0/6
[sw2-GigabitEthernet0/0/6]port link-type trunk
[sw2-GigabitEthernet0/0/6]port trunk allow-pass vlan all
[sw2]int g0/0/7
[sw2-GigabitEthernet0/0/7]port link-type trunk
[sw2-GigabitEthernet0/0/7]port trunk allow-pass vlan all

SW3:
[sw3]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw3]int e0/0/1
[sw3-Ethernet0/0/1]port link-type access
[sw3-Ethernet0/0/1]port default vlan 2
[sw3]int e0/0/2
[sw3-Ethernet0/0/2]port link-type access
[sw3-Ethernet0/0/2]port default vlan 3
[sw3]int e0/0/3
[sw3-Ethernet0/0/3]port link-type trunk
[sw3-Ethernet0/0/3]port trunk allow-pass vlan all
[sw3]int e0/0/4
[sw3-Ethernet0/0/4]port link-type trunk
[sw3-Ethernet0/0/4]port trunk allow-pass vlan all

SW4:
[sw4]int e0/0/1
[sw4-Ethernet0/0/1]port link-type access
[sw4-Ethernet0/0/1]port default vlan 3
[sw4]int e0/0/2
[sw4-Ethernet0/0/2]port link-type access
[sw4-Ethernet0/0/2]port default vlan 3
[sw4]int e0/0/3
[sw4-Ethernet0/0/3]port link-type trunk
[sw4-Ethernet0/0/3]port trunk allow-pass vlan all
[sw4]int e0/0/4
[sw4-Ethernet0/0/4]port link-type trunk
[sw4-Ethernet0/0/4]port trunk allow-pass vlan all

SW5:
[sw5]int e0/0/1
[sw5-Ethernet0/0/1]port link-type access
[sw5-Ethernet0/0/1]port default vlan 2
[sw5]int e0/0/2
[sw5-Ethernet0/0/2]port link-type access
[sw5-Ethernet0/0/2]port default vlan 3
[sw5]int e0/0/3
[sw5-Ethernet0/0/3]port link-type trunk
[sw5-Ethernet0/0/3]port trunk allow-pass vlan all
[sw5]int e0/0/4
[sw5-Ethernet0/0/4]port link-type trunk
[sw5-Ethernet0/0/4]port trunk allow-pass vlan all

二、 eth-trunk
SW1:
[sw1]int Eth-Trunk 0
[sw1-Eth-Trunk0]q
[sw1]int g0/0/3
[sw1-GigabitEthernet0/0/3]eth-trunk 0
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw1]int g0/0/4
[sw1-GigabitEthernet0/0/4]eth-trunk 0
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw1]int Eth-Trunk 0
[sw1-Eth-Trunk0]port link-type trunk
[sw1-Eth-Trunk0]port trunk allow-pass vlan all
SW2:
[sw2]int Eth-Trunk 0
[sw2-Eth-Trunk0]q
[sw2]int g0/0/3
[sw2-GigabitEthernet0/0/3]eth-trunk 0
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw2]int g0/0/4
[sw2-GigabitEthernet0/0/4]eth-trunk 0
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw2]int Eth-Trunk 0
[sw2-Eth-Trunk0]port link-type trunk
[sw2-Eth-Trunk0]port trunk allow-pass vlan all

三、生成树MSTP
SW1:
[sw1]stp mode mstp
[sw1]stp enable
[sw1]stp region-configuration
[sw1-mst-region]region-name huawei
[sw1-mst-region]instance 1 vlan 2
[sw1-mst-region]instance 2 vlan 3
[sw1-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw1]stp instance 1 root primary
[sw1]stp instance 2 root secondary

SW2:
[sw2]stp mode mstp
[sw2]stp enable
[sw2]stp region-configuration
[sw2-mst-region]region-name huawei
[sw2-mst-region]instance 1 vlan 2
[sw2-mst-region]instance 2 vlan 3
[sw2-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw2]stp instance 1 root secondary
[sw2]stp instance 2 root primary

SW3:
[sw3]stp mode mstp
[sw3]stp enable
[sw3]stp re
[sw3]stp region-configuration
[sw3-mst-region]reg
[sw3-mst-region]region-name huawei
[sw3-mst-region]int
[sw3-mst-region]ins
[sw3-mst-region]instance 1 vlan 2
[sw3-mst-region]instance 2 vlan 3
[sw3-mst-region]ac
[sw3-mst-region]active re
[sw3-mst-region]active region-configuration

SW4:
[sw4]stp mode mstp
[sw4]stp enable
[sw4]stp region-configuration
[sw4-mst-region]region-name huawei
[sw4-mst-region]instance 1 vlan 2
[sw4-mst-region]instance 2 vlan 3
[sw4-mst-region]active region-configuration

SW5:
[sw5]stp mode mstp
[sw5]stp enable
[sw5]stp region-configuration
[sw5-mst-region]region-name huawei
[sw5-mst-region]instance 1 vlan 2
[sw5-mst-region]instance 2 vlan 3
[sw5-mst-region]active region-configuration

四、网关冗余VRRP
SW1:
[sw1]int Vlanif 2
[sw1-Vlanif2]ip add 12.1.1.1 24
[sw1-Vlanif2]vrrp vrid 1 virtual-ip 12.1.1.1
[sw1]int Vlanif 3
[sw1-Vlanif3]ip add 23.1.1.2 24
[sw1-Vlanif3]vrrp vrid 2 virtual-ip 23.1.1.1

SW2:
[sw2]int Vlanif 2
[sw2-Vlanif2]ip add 12.1.1.2 24
[sw2-Vlanif2]vrrp vrid 1 virtual-ip 12.1.1.1
[sw2]int Vlanif 3
[sw2-Vlanif3]ip add 23.1.1.1 24
[sw2-Vlanif3]vrrp vrid 2 virtual-ip 23.1.1.1

五、DHCP
SW1:
[sw1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[sw1]ip pool 1
Info:It’s successful to create an IP address pool.
[sw1-ip-pool-1]net
[sw1-ip-pool-1]network 12.1.1.0 mask 255.255.255.0
[sw1-ip-pool-1]gateway-list 12.1.1.1
[sw1-ip-pool-1]dns-list 8.8.8.8
[sw1]ip pool 2
Info:It’s successful to create an IP address pool.
[sw1-ip-pool-2]network 23.1.1.0 mask 255.255.255.0
[sw1-ip-pool-2]gateway-list 23.1.1.2
[sw1-ip-pool-2]dns-list 8.8.8.8
[sw1]int vlanif 2
[sw1-Vlanif2]dhcp select global
[sw1]int vlanif 3
[sw1-Vlanif3]dhcp select global

SW2:
[sw2]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[sw2]ip pool 1
Info:It’s successful to create an IP address pool.
[sw2-ip-pool-1]network 12.1.1.0 mask 255.255.255.0
[sw2-ip-pool-1]gateway-list 12.1.1.1
[sw2-ip-pool-1]dns-list 8.8.8.8
[sw2]ip pool 2
Info:It’s successful to create an IP address pool.
[sw2-ip-pool-2]network 23.1.1.0 mask 255.255.255.0
[sw2-ip-pool-2]gateway-list 23.1.1.1
[sw2-ip-pool-2]dns-list 8.8.8.8
[sw2]int vlanif 2
[sw2-Vlanif2]dhcp select global
[sw2]int vlanif 3
[sw2-Vlanif3]dhcp select global
在这里插入图片描述

六、三层配置
vLanif 100 接口配ip、 上行接口access default vlan 100
SW1:
[sw1]vlan batch 100
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw1]int vlanif 100
[sw1-Vlanif100]ip add 192.168.1.2 24
[sw1]int g0/0/1
[sw1-GigabitEthernet0/0/1]port link-type access
[sw1-GigabitEthernet0/0/1]port default vlan 100

SW2:
[sw2]vlan batch 100
Info: This operation may take a few seconds. Please wait for a moment…done.
[sw2]int vlanif 100
[sw2-Vlanif200]ip add 192.168.2.2 24
[sw2]int g0/0/2
[sw2-GigabitEthernet0/0/2]port link-type access
[sw2-GigabitEthernet0/0/2]port default vlan 200
R1:
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.1 24
[r1]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 192.168.2.1 24
ISP:
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 10.1.1.2 24

七、OSPF
R1:
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.2.1 0.0.0.0

SW1:
[sw1]ospf 1 router-id 2.2.2.2
[sw1-ospf-1]area 0
[sw1-ospf-1-area-0.0.0.0]network 12.1.1.1 0.0.0.0
[sw1-ospf-1-area-0.0.0.0]network 23.1.1.2 0.0.0.0
[sw1-ospf-1-area-0.0.0.0]network 192.168.1.2 0.0.0.0

SW2:
[sw2]ospf 1 router-id 3.3.3.3
[sw2-ospf-1]area 0
[sw2-ospf-1-area-0.0.0.0]network 12.1.1.2 0.0.0.0
[sw2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0
[sw2-ospf-1-area-0.0.0.0]network 192.168.2.2 0.0.0.0
在这里插入图片描述

八、通外网
[r1]ip route-static 0.0.0.0 0 10.1.1.2 缺省路由
[r1]ospf 1
[r1-ospf-1]default-route-advertise always ospf下放缺省
[r1]acl 2000
[r1-acl-basic-2000]rule 5 permit source any
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]nat outbound 2000 Esay-IP (NAT)
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值