VLan与ospf基本配置实验


作者:Lambda
时间:2020年4月12日

Vlan与ospf基本配置实验

1、实验拓扑

VLan与ospf基本配置实验_第1张图片

2、实验目的

全网互通并且PC1和PC4可以ping通AR4的环回地址4.4.4.4,但是AR3与AR4之间不配置ospf

3、实验步骤

1、安照如图所示配置ip地址

2、在LSW1和LSW2上配置vlan及各个接口类型

LSW1:

sys
[Huawei]sysname LSW1
[LSW1]vlan batch 10 20
[LSW1]int g0/0/1
[LSW1-GigabitEthernet0/0/1]port link-type access 
[LSW1-GigabitEthernet0/0/1]port default vlan 10
[LSW1]int g0/0/2
[LSW1-GigabitEthernet0/0/2]port link-type access 
[LSW1-GigabitEthernet0/0/2]port default vlan 20
[LSW1-GigabitEthernet0/0/2]int g0/0/3
[LSW1-GigabitEthernet0/0/3]port link-type trunk 
[LSW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20
[LSW1-GigabitEthernet0/0/3]int g0/0/4
[LSW1-GigabitEthernet0/0/4]port link-type trunk 
[LSW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 10 20

LSW2:

sys
[Huawei]sysname LSW2
[LSW2]vlan batch 10 20
[LSW2]int g0/0/1
[LSW2-GigabitEthernet0/0/1]port link-type access 
[LSW2-GigabitEthernet0/0/1]port default vlan 10
[LSW2]int g0/0/2
[LSW2-GigabitEthernet0/0/2]port link-type access 
[LSW2-GigabitEthernet0/0/2]port default vlan 20
[LSW2-GigabitEthernet0/0/2]int g0/0/3
[LSW2-GigabitEthernet0/0/3]port link-type trunk 
[LSW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20

3、在AR1上配置单臂路由,使vlan间能通信

sys
[Huawei]sysname AR1
[AR1]int g0/0/1.1
[AR1-GigabitEthernet0/0/1.1]ip add 192.168.10.254 24
[AR1-GigabitEthernet0/0/1.1]dot1q termination vid 10	
[AR1-GigabitEthernet0/0/1.1]arp broadcast enable
[AR1]int g0/0/1.2
[AR1-GigabitEthernet0/0/1.1]ip add 192.168.20.254 24
[AR1-GigabitEthernet0/0/1.1]dot1q termination vid 20	
[AR1-GigabitEthernet0/0/1.1]arp broadcast enable

4、在AR1、AR2、AR3上配置OSPF使他们互通

AR1

[AR1]int g0/0/0 
[AR1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[AR1]int l0
[AR1-LoopBack0]ip add 1.1.1.1 32
[AR1-LoopBack0]quit
[AR1]ospf 1 router-id 1.1.1.1
[AR1-ospf-1]area 0	
[AR1-ospf-1-area-0.0.0.0]network 192.168.10.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0

AR2:

sys
[Huawei]sysname AR2
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[AR2-GigabitEthernet0/0/0]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip add 23.1.1.2 24
[AR2-GigabitEthernet0/0/1]quit
[AR2]int l0
[AR2-LoopBack0]ip add 2.2.2.2 32
[AR2-LoopBack0]quit
[AR2]ospf 1 router-id 2.2.2.2
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

AR3:

sys
[Huawei]sysname AR3
[AR3]int g0/0/0
[AR3-GigabitEthernet0/0/0]ip add 23.1.1.3 24
[AR3-GigabitEthernet0/0/0]int g0/0/1
[AR3-GigabitEthernet0/0/1]ip add 34.1.1.3 24
[AR3-GigabitEthernet0/0/1]quit
[AR3]int l0
[AR3-LoopBack0]ip add 3.3.3.3 32
[AR3-LoopBack0]quit
[AR3]ospf 1 router-id 3.3.3.3
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]
[AR3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

5、在AR3和AR4上配置静态路由,并且在AR3上引入静态

AR4:

[AR4]int g0/0/0
[AR4-GigabitEthernet0/0/0]ip add 34.1.1.4 24
[AR4-LoopBack0]ip add 4.4.4.4 32
[AR4]ip route-static 0.0.0.0 0.0.0.0 34.1.1.3

AR3:

[AR3]ip route-static 4.4.4.4 255.255.255.255 34.1.1.4
[AR3]ospf 1
[AR3-ospf-1]import-route static 

4、实验结果

1、PC1pingPC4

VLan与ospf基本配置实验_第2张图片

2、PC1ping4.4.4.4

VLan与ospf基本配置实验_第3张图片

3、PC4ping4.4.4.4
VLan与ospf基本配置实验_第4张图片

你可能感兴趣的:(数通)