实验名称:实现全网互通
实验拓扑:
所需设备:
1、两台路由器
2、两台三层交换机
3、5台PC
4、一台server (没用上面的功能其实也就是当PC使用)
地址规划:
设备 | IP地址子网 | 所属VLAN |
---|---|---|
PC1 | 192.168.10.1/24 | 10 |
PC3 | 192.168.20.1/24 | 20 |
PC5 | 192.168.30.1/24 | 30 |
PC4 | 192.168.40.1/24 | 40 |
PC2 | 192.168.50.1/24 | 50 |
server | 192.168.60.1/24 | 60 |
设备 | 接口 | 链路模式 |
---|---|---|
LSW1 | G0/0/1 | access |
LSW1 | G0/0/3 | access |
LSW1 | G0/0/2 | trunk |
LSW2 | E0/0/5 | access |
LSW2 | E0/0/4 | hybrid |
LSW2 | E0/0/1 | hybrid |
LSW2 | E0/0/22 | hybrid |
LSW2 | E0/0/2 | trunk |
实验目的:全网互通
实验步骤:
配置PC机地址:
配置 LSW1
The device is running!
<Huawei>undo t m
Info: Current terminal monitor is off.
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]q
[Huawei]vlan 10
[Huawei-vlan10]vlan 20
[Huawei-vlan20]vlan 88
[Huawei-vlan88]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p
[Huawei-GigabitEthernet0/0/1]port l
[Huawei-GigabitEthernet0/0/1]port link-t
[Huawei-GigabitEthernet0/0/1]port link-type a
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]p
[Huawei-GigabitEthernet0/0/1]port de
[Huawei-GigabitEthernet0/0/1]port default vlan 10
[Huawei-GigabitEthernet0/0/1]q
[Huawei]int g0/0/3
[Huawei-GigabitEthernet0/0/3]p
[Huawei-GigabitEthernet0/0/3]port l
[Huawei-GigabitEthernet0/0/3]port link-t
[Huawei-GigabitEthernet0/0/3]port link-type a
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]p
[Huawei-GigabitEthernet0/0/3]port de
[Huawei-GigabitEthernet0/0/3]port default vlan 30
Error: The VLAN does not exist.
[Huawei-GigabitEthernet0/0/3]port default vlan 20
[Huawei-GigabitEthernet0/0/3]q
[Huawei]int vlan 10
[Huawei-Vlanif10]undo shutdown
Info: Interface Vlanif10 is not shutdown.
[Huawei-Vlanif10]ip add 192.168.10.254 255.255.255.0
[Huawei-Vlanif10]q
[Huawei]int vlan 88
[Huawei-Vlanif88]undo shutdown
Info: Interface Vlanif88 is not shutdown.
[Huawei-Vlanif88]ip add 192.168.88.2 24
[Huawei-Vlanif88]q
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]p
[Huawei-GigabitEthernet0/0/2]port l
[Huawei-GigabitEthernet0/0/2]port link-t
[Huawei-GigabitEthernet0/0/2]port link-type t
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]p
[Huawei-GigabitEthernet0/0/2]port t
[Huawei-GigabitEthernet0/0/2]port trunk a
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/2]q
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net
[Huawei-ospf-1-area-0.0.0.0]network 192.168.10.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.88.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]q
配置AR1
<Huawei>undo t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]undo shutdown
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[Huawei-GigabitEthernet0/0/1]ip add 192.168.7.1 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]int g0/0/0.20
[Huawei-GigabitEthernet0/0/0.20]dot
[Huawei-GigabitEthernet0/0/0.20]dot1q t
[Huawei-GigabitEthernet0/0/0.20]dot1q termination vid 20
[Huawei-GigabitEthernet0/0/0.20]ip add 192.168.20.254 24
[Huawei-GigabitEthernet0/0/0.20]a
[Huawei-GigabitEthernet0/0/0.20]arp b
[Huawei-GigabitEthernet0/0/0.20]arp broadcast enable
[Huawei-GigabitEthernet0/0/0.20]q
[Huawei]int g0/0/0.88
[Huawei-GigabitEthernet0/0/0.88]do
[Huawei-GigabitEthernet0/0/0.88]dot1q t
[Huawei-GigabitEthernet0/0/0.88]dot1q termination vid 88
[Huawei-GigabitEthernet0/0/0.88]ip add 192.168.88.1 24
[Huawei-GigabitEthernet0/0/0.88]a
[Huawei-GigabitEthernet0/0/0.88]arp b
[Huawei-GigabitEthernet0/0/0.88]arp broadcast enable
[Huawei-GigabitEthernet0/0/0.88]q
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]ne
[Huawei-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.88.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]
配置AR2
<Huawei>undo t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.7.2 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]int g0/0/0.50
[Huawei-GigabitEthernet0/0/0.50]dot
[Huawei-GigabitEthernet0/0/0.50]dot1q t
[Huawei-GigabitEthernet0/0/0.50]dot1q termination vid 50
[Huawei-GigabitEthernet0/0/0.50]ip add 192.168.50.254 24
[Huawei-GigabitEthernet0/0/0.50]a
[Huawei-GigabitEthernet0/0/0.50]arp b
[Huawei-GigabitEthernet0/0/0.50]arp broadcast enable
[Huawei-GigabitEthernet0/0/0.50]q
[Huawei]int g0/0/0.60
[Huawei-GigabitEthernet0/0/0.60]do
[Huawei-GigabitEthernet0/0/0.60]dot1q t
[Huawei-GigabitEthernet0/0/0.60]dot1q termination vid 60
[Huawei-GigabitEthernet0/0/0.60]ip add 192.168.60.254 24
[Huawei-GigabitEthernet0/0/0.60]arp b
[Huawei-GigabitEthernet0/0/0.60]arp broadcast enable
[Huawei-GigabitEthernet0/0/0.60]q
[Huawei]int g0/0/0.66
[Huawei-GigabitEthernet0/0/0.66]dot
[Huawei-GigabitEthernet0/0/0.66]dot1q t
[Huawei-GigabitEthernet0/0/0.66]dot1q termination vid 66
[Huawei-GigabitEthernet0/0/0.66]ip add 192.168.66.1 24
[Huawei-GigabitEthernet0/0/0.66]arp b
[Huawei-GigabitEthernet0/0/0.66]arp broadcast enable
[Huawei-GigabitEthernet0/0/0.66]q
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net
[Huawei-ospf-1-area-0.0.0.0]network 192.168.50.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.60.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.66.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]q
[Huawei-ospf-1]area0
^
Error: Unrecognized command found at ‘^‘ position.
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]net
[Huawei-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]q
[Huawei-ospf-1]q
[Huawei]disp
[Huawei]display ip rou
[Huawei]display ip routing-table
Route Flags: R - relay, D - download to fib
Routing Tables: Public
Destinations : 19 Routes : 19
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.7.0/24 Direct 0 0 D 192.168.7.2 GigabitEthernet
0/0/1
192.168.7.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.7.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.10.0/24 OSPF 10 3 D 192.168.7.1 GigabitEthernet
0/0/1
192.168.20.0/24 OSPF 10 2 D 192.168.7.1 GigabitEthernet
0/0/1
192.168.50.0/24 Direct 0 0 D 192.168.50.254 GigabitEthernet
0/0/0.50
192.168.50.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.50
192.168.50.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.50
192.168.60.0/24 Direct 0 0 D 192.168.60.254 GigabitEthernet
0/0/0.60
192.168.60.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.60
192.168.60.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.60
192.168.66.0/24 Direct 0 0 D 192.168.66.1 GigabitEthernet
0/0/0.66
192.168.66.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.66
192.168.66.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.66
192.168.88.0/24 OSPF 10 2 D 192.168.7.1 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[Huawei]dis
[Huawei]display ospf p
[Huawei]display ospf peer b
[Huawei]display ospf peer brief
OSPF Process 1 with Router ID 192.168.7.2
Peer Statistic Information
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/1 192.168.7.1 Full
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]n
[Huawei-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.50.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.60.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.66.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]
配置 SW2
<Huawei>undo t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan 30
[Huawei-vlan30]vlan 40
[Huawei-vlan40]vlan 50
[Huawei-vlan50]vlan 60
[Huawei-vlan60]vlan 66
[Huawei-vlan66]q
[Huawei]int e0/0/5
[Huawei-Ethernet0/0/5]p
[Huawei-Ethernet0/0/5]port l
[Huawei-Ethernet0/0/5]port link-t
[Huawei-Ethernet0/0/5]port link-type a
[Huawei-Ethernet0/0/5]port link-type access
[Huawei-Ethernet0/0/5]p
[Huawei-Ethernet0/0/5]port de
[Huawei-Ethernet0/0/5]port default vlan 30
[Huawei-Ethernet0/0/5]q
[Huawei]int e0/0/4
[Huawei-Ethernet0/0/4]p
[Huawei-Ethernet0/0/4]port h
[Huawei-Ethernet0/0/4]port hybrid u
[Huawei-Ethernet0/0/4]port hybrid untagged vlan 40 60
[Huawei-Ethernet0/0/4]p
[Huawei-Ethernet0/0/4]port h
[Huawei-Ethernet0/0/4]port hybrid t
[Huawei-Ethernet0/0/4]port hybrid tagged vlan 40
[Huawei-Ethernet0/0/4]q
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p
[Huawei-Ethernet0/0/1]port h
[Huawei-Ethernet0/0/1]port hybrid u
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 50 60
[Huawei-Ethernet0/0/1]port hybrid tagged vlan 50
[Huawei-Ethernet0/0/1]q
[Huawei]int e0/0/22
[Huawei-Ethernet0/0/22] p
[Huawei-Ethernet0/0/22]port h
[Huawei-Ethernet0/0/22]port hybrid u
[Huawei-Ethernet0/0/22]port hybrid untagged vlan 40 50 60
[Huawei-Ethernet0/0/22]p
[Huawei-Ethernet0/0/22]port h
[Huawei-Ethernet0/0/22]port hybrid t
[Huawei-Ethernet0/0/22]port hybrid tagged vlan 60
[Huawei-Ethernet0/0/22]q
[Huawei]int e0/0/2
[Huawei-Ethernet0/0/2]p
[Huawei-Ethernet0/0/2]port
[Huawei-Ethernet0/0/2]port l
[Huawei-Ethernet0/0/2]port link-t
[Huawei-Ethernet0/0/2]port link-type t
[Huawei-Ethernet0/0/2]port link-type trunk
[Huawei-Ethernet0/0/2]p
[Huawei-Ethernet0/0/2]port tr
[Huawei-Ethernet0/0/2]port trunk a
[Huawei-Ethernet0/0/2]port trunk allow-pass vlan all
[Huawei-Ethernet0/0/2]q
[Huawei]int vlan 30
[Huawei-Vlanif30]ip add 192.168.30.254 24
[Huawei-Vlanif30]q
[Huawei]int vlan 40
[Huawei-Vlanif40]ip add 192.168.40.254 24
[Huawei-Vlanif40]q
[Huawei]int vlan 66
[Huawei-Vlanif66]ip add 192.168.66.2 24
[Huawei-Vlanif66]q
[Huawei]ospf
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]ne
[Huawei-ospf-1-area-0.0.0.0]network 192.168.30.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.40.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.66.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]
原文地址:http://blog.51cto.com/13467772/2064004