工具:ensp
一、实验拓扑图
二、实验需求
1、如上图所示,网络拓扑是某食品公司内部网络结构。公司采用三层网络层次,;其中SW3与SW4为接入交换机,SW1和SW2为汇聚交换机,AR1和AR2为核心路由器。
2、全网使用动态路由协议OSPF,SW1和AR1运行Area 1, AR1和AR2运行Area 0,AR2和SW2运行Area 2。
3、AR1的RID是1.1.1.1,AR2的RID是2.2.2.2,SW1的RID是3.3.3.3,SW2的RID是4.4.4.4。
截图:
1、 PC机能够ping通
2、 R1和R2执行display ospf peer的截图
3、 S1和S2的路由表
三、操作步骤
R1:
<Huawei>sys
[Huawei]undo info enable
[Huawei]sysn r1
[r1]int e0/0/0
[r1-Ethernet0/0/0]ip address 192.168.0.5 30
[r1-Ethernet0/0/0]int e0/0/1
[r1-Ethernet0/0/1]ip address 192.168.0.1 30
[r1]ospf router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.0.4 0.0.0.3
[r1-ospf-1-area-0.0.0.0]area 1
[r1-ospf-1-area-0.0.0.1]network 192.168.0.0 0.0.0.3
R2:
<Huawei>sys
[Huawei]undo info enable
[Huawei]sysn r2
[r2]int e0/0/0
[r2-Ethernet0/0/0]ip address 192.168.0.6 30
[r2-Ethernet0/0/0]int e0/0/1
[r2-Ethernet0/0/1]ip address 192.168.0.9 30
[r2]ospf router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.0.4 0.0.0.3
[r2-ospf-1-area-0.0.0.0]area 2
[r2-ospf-1-area-0.0.0.2]network 192.168.0.8 0.0.0.3
S1:
<Huawei>sys
[Huawei]undo info e
[Huawei]vlan batch 10 20
[Huawei]int vlanif 10
[Huawei-Vlanif10]ip address 192.10.1.1 24
[Huawei-Vlanif10]int vlanif 20
[Huawei-Vlanif20]ip address 192.10.2.1 24
[Huawei]vlan batch 100
[Huawei]int vlanif 100
[Huawei-Vlanif100]ip address 192.168.0.2 30
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vlan 100
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 100
[
<s1>sys
[s1]ospf router-id 3.3.3.3
[s1-ospf-1]area 1
[s1-ospf-1-area-0.0.0.1]network 192.168.0.0 0.0.0.3
[s1-ospf-1-area-0.0.0.1]network 192.10.1.0 0.0.0.255
[s1-ospf-1-area-0.0.0.1]network 192.10.2.0 0.0.0.255
S2:
<Huawei>sys
[Huawei]undo info enable
[Huawei]sys s2
[s2]vlan batch 30 40 200
[s2]int vlanif 200
[s2-Vlanif200]ip address 192.168.0.10 30
[s2-Vlanif200]int vlanif 30
[s2-Vlanif30]ip address 192.10.3.1 24
[s2-Vlanif30]int vlanif 40
[s2-Vlanif40]ip address 192.10.4.1 24
[s2]int g0/0/1
[s2-GigabitEthernet0/0/1]port link-type access
[s2-GigabitEthernet0/0/1]port default vlan 200
[s2-GigabitEthernet0/0/1]int g0/0/2
[s2-GigabitEthernet0/0/2]port link-type trunk
[s2-GigabitEthernet0/0/2]port trunk allow-pass vlan 30 40 200
[s2]ospf router-id 4.4.4.4
[s2-ospf-1]area 2
[s2-ospf-1-area-0.0.0.2]network 192.168.0.8 0.0.0.3
[s2-ospf-1-area-0.0.0.2]network 192.10.3.0 0.0.0.255
[s2-ospf-1-area-0.0.0.2]network 192.10.4.0 0.0.0.255
[s2-ospf-1]q
S3:
<Huawei>sys
[Huawei]undo info enable
[Huawei]sysn s3
[s3]vlan batch 10 20
[s3]int e0/0/1
[s3-Ethernet0/0/1]port link-type trunk
[s3-Ethernet0/0/1]port trunk allow-pass vlan 10 20
[s3-Ethernet0/0/1]int e0/0/2
[s3-Ethernet0/0/2]port link-type access
[s3-Ethernet0/0/2]port default vlan 10
[s3-Ethernet0/0/2]int e0/0/3
[s3-Ethernet0/0/3]port link-type access
[s3-Ethernet0/0/3]port default vlan 20
S4:
<Huawei>sys
[Huawei]undo info enable
[Huawei]sysn s4
[s4]vlan batch 30 40
[s4]int e0/0/1
[s4-Ethernet0/0/1]port link-type trunk
[s4-Ethernet0/0/1]port trunk allow-pass vlan 30 40
[s4-Ethernet0/0/1]int e0/0/2
[s4-Ethernet0/0/2]port link-type access
[s4-Ethernet0/0/2]port default vlan 30
[s4-Ethernet0/0/2]int e0/0/3
[s4-Ethernet0/0/3]port link-type access
[s4-Ethernet0/0/3]port default vlan 40