实验目的:
1.RIP和OSPF的理论基础知识点
2.华为的大实验:
知识点1:RIP–R3、R4、R5
知识点2:单臂路由–R4 LSW7
知识点3:二层交换机的access trunk--------sw 34567
知识点4:三层交换机的vlanif互联口
知识点5:OSPF————R2、R3、S1、S2
知识点6:路由重分发————ospf与rip之间的相互学习
知识点7:rip ospf向邻居发送一条缺省路由default-route originate default-route-advertise
知识点8:NAT–easyip 端口映射
R5:
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R5
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 10.1.100.1 24
Feb 8 2020 15:03:30-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R5-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R5-GigabitEthernet0/0/0]int g 0/0/2
[R5-GigabitEthernet0/0/2]ip add 10.1.135.5 24
Feb 8 2020 15:04:19-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R5-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[R5-GigabitEthernet0/0/2]q
[R5]rip 1
[R5-rip-1]v 2
[R5-rip-1]network 10.1.100.0
Error: The network address is invalid, and the specified address must be major-n
et address without any subnets.
[R5-rip-1]dis this
[V200R003C00]
#
rip 1
version 2
#
return
[R5-rip-1]undo summary
[R5-rip-1]network 10.0.0.0
[R5-rip-1]dis this
[V200R003C00]
#
rip 1
undo summary
version 2
network 10.0.0.0
#
return
R4:
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R4
[R4]int g 0/0/2
[R4-GigabitEthernet0/0/2]ip add 10.1.135.4 24
[R4-GigabitEthernet0/0/2]
Feb 8 2020 15:10:31-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R4-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[R4-GigabitEthernet0/0/2]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 10.1.134.4 24
[R4-GigabitEthernet0/0/1]
Feb 8 2020 15:10:54-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R4-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R4]int g 0/0/0.21
[R4-GigabitEthernet0/0/0.21]ip add 10.1.21.1 24
[R4-GigabitEthernet0/0/0.21]dot1q termination vid 21
Feb 8 2020 15:25:25-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0.21 has entered the UP state.
[R4-GigabitEthernet0/0/0.21]a b e
[R4-GigabitEthernet0/0/0.21]int g 0/0/0.22
[R4-GigabitEthernet0/0/0.22]dot1q termination vid 22
[R4-GigabitEthernet0/0/0.22]ip add 10.1.22.1 24
[R4-GigabitEthernet0/0/0.22]arp broadcast enable
[R4-GigabitEthernet0/0/0.22]
Feb 8 2020 15:26:14-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0.22 has entered the UP state.
[R4-GigabitEthernet0/0/0.22]q
[R4]rip 1
[R4-rip-1]v 2
[R4-rip-1]undo su
[R4-rip-1]undo summary
[R4-rip-1]network 10.0.0.0
[R4-rip-1]q
[R4]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.21.0/24 Direct 0 0 D 10.1.21.1 GigabitEthernet
0/0/0.21
10.1.21.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.21
10.1.21.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.21
10.1.22.0/24 Direct 0 0 D 10.1.22.1 GigabitEthernet
0/0/0.22
10.1.22.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.22
10.1.22.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0.22
10.1.100.0/24 RIP 100 1 D 10.1.135.5 GigabitEthernet
0/0/2
10.1.134.0/24 Direct 0 0 D 10.1.134.4 GigabitEthernet
0/0/1
10.1.134.4/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.1.134.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.1.135.0/24 Direct 0 0 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.135.4/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
10.1.135.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
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
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
LSW7:
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW7
[LSW7]
Feb 8 2020 15:32:08-08:00 LSW7 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 4, the
change loop count is 0, and the maximum number of records is 4095.
[LSW7]v b 21 22
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW7]
[LSW7]int e 0/0/10
[LSW7-Ethernet0/0/10]p l t
[LSW7-Ethernet0/0/10]
Feb 8 2020 15:34:08-08:00 LSW7 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 6, the
change loop count is 0, and the maximum number of records is 4095.
[LSW7-Ethernet0/0/10]p t a v 21 22
[LSW7-Ethernet0/0/10]un sh
Info: Interface Ethernet0/0/10 is not shutdown.
[LSW7-Ethernet0/0/10]
Feb 8 2020 15:34:48-08:00 LSW7 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 7, the
change loop count is 0, and the maximum number of records is 4095.
[LSW7-Ethernet0/0/10]int e 0/0/1
[LSW7-Ethernet0/0/1]p l a
[LSW7-Ethernet0/0/1]p d v 21
[LSW7-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.
[LSW7-Ethernet0/0/1]
Feb 8 2020 15:35:08-08:00 LSW7 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 9, the
change loop count is 0, and the maximum number of records is 4095.
[LSW7-Ethernet0/0/1]int e 0/0/2
[LSW7-Ethernet0/0/2]p l a
[LSW7-Ethernet0/0/2]p d v 22
[LSW7-Ethernet0/0/2]un sh
Feb 8 2020 15:35:48-08:00 LSW7 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 11, the
change loop count is 0, and the maximum number of records is 4095.
Info: Interface Ethernet0/0/2 is not shutdown.
此时PC5验证(测试PC和Server1记得配置ip地址)
接下来配置R3
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 10.1.134.1 24
[R3-GigabitEthernet0/0/1]
Feb 8 2020 15:43:18-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R3-GigabitEthernet0/0/1]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 10.1.113.1 24
[R3-GigabitEthernet0/0/0]
Feb 8 2020 15:43:40-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R3-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R3-GigabitEthernet0/0/0]q
[R3]rip 1
[R3-rip-1]v 2
[R3-rip-1]un summary
[R3-rip-1]network 10.0.0.0
[R3-rip-1]q
[R3]int lo 0
[R3-LoopBack0]ip add 3.3.3.3 32
[R3-LoopBack0]q
[R3]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15
Destination/Mask Proto Pre Cost Flags NextHop Interface
3.3.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.1.21.0/24 RIP 100 1 D 10.1.134.4 GigabitEthernet
0/0/1
10.1.22.0/24 RIP 100 1 D 10.1.134.4 GigabitEthernet
0/0/1
10.1.100.0/24 RIP 100 2 D 10.1.134.4 GigabitEthernet
0/0/1
10.1.113.0/24 Direct 0 0 D 10.1.113.1 GigabitEthernet
0/0/0
10.1.113.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.113.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.134.0/24 Direct 0 0 D 10.1.134.1 GigabitEthernet
0/0/1
10.1.134.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.1.134.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.1.135.0/24 RIP 100 1 D 10.1.134.4 GigabitEthernet
0/0/1
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
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
此时学到了10.1.100.0 /24 说明rip 这边已经配置完成,只需要后面把ospf 注入即可
[R3]router id 3.3.3.3
Info: Router ID has been modified, please reset the relative protocols manually
to update the Router ID.
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.1.113.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]q
[R3-ospf-1]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 10.1.113.3 24
[R3-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R3-GigabitEthernet0/0/0]q
接下来配置R2:
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sys
[Huawei]sysname R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.1.113.1 24
Feb 8 2020 15:52:40-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R2-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R2-GigabitEthernet0/0/0]int g 0/0/2
[R2-GigabitEthernet0/0/2]ip add 10.1.112.11 24
Feb 8 2020 15:53:01-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R2-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[R2-GigabitEthernet0/0/2]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.1.111.11 24
[R2-GigabitEthernet0/0/1]
Feb 8 2020 15:53:55-08:00 R2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R2-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R2-GigabitEthernet0/0/1]
[R2-GigabitEthernet0/0/1]int g 0/0/3
[R2-GigabitEthernet0/0/3]ip add 202.2.12.12 24
[R2-GigabitEthernet0/0/3]
Feb 8 2020 16:25:44-08:00 R2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/3 has entered the UP state.
[R2-GigabitEthernet0/0/3]un sh
Info: Interface GigabitEthernet0/0/3 is not shutdown.
[R2]int LoopBack 0
[R2-LoopBack0]ip add 2.2.2.2 32
[R2-LoopBack0]q
[R2]router id 2.2.2.2
Info: Router ID has been modified, please reset the relative protocols manually
to update the Router ID.
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.1.113.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]dis this
[V200R003C00]
#
area 0.0.0.0
network 10.1.113.0 0.0.0.255
#
return
[R2-ospf-1-area-0.0.0.0]network 10.1.112.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.1.111.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
Feb 8 2020 15:58:56-08:00 R2 %%01OSPF/4/CONFLICT_ROUTERID_INTF(l)[14]:OSPF Rout
er id conflict is detected on interface. (ProcessId=256, RouterId=2.2.2.2, AreaI
d=0.0.0.0, InterfaceName=GigabitEthernet0/0/2, IpAddr=11.112.1.10, PacketSrcIp=
11.111.1.10)
[R2-ospf-1-area-0.0.0.0]q
[R2-ospf-1]dis ip
Feb 8 2020 15:59:06-08:00 R2 %%01OSPF/4/CONFLICT_ROUTERID_INTF(l)[15]:OSPF Rout
er id conflict is detected on interface. (ProcessId=256, RouterId=2.2.2.2, AreaI
d=0.0.0.0, InterfaceName=GigabitEthernet0/0/1, IpAddr=11.111.1.10, PacketSrcIp=
11.112.1.10)
[R2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0
3.3.3.3/32 OSPF 10 1 D 10.1.113.3 GigabitEthernet
0/0/0
10.1.111.0/24 Direct 0 0 D 10.1.111.11 GigabitEthernet
0/0/1
10.1.111.11/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
10.1.112.0/24 Direct 0 0 D 10.1.112.11 GigabitEthernet
0/0/2
10.1.112.11/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
10.1.113.0/24 Direct 0 0 D 10.1.113.1 GigabitEthernet
0/0/0
10.1.113.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
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
202.2.12.0/24 Direct 0 0 D 202.2.12.12 GigabitEthernet
0/0/3
202.2.12.12/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/3
[R2]
接下来配置S1
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname S1
[S1]v b 11 12 1000 1001
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]int g 0/0/1
[S1-GigabitEthernet0/0/1]
[S1-GigabitEthernet0/0/1]p l a
[S1-GigabitEthernet0/0/1]p d v 1001
[S1-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[S1-GigabitEthernet0/0/1]int eth-t 1
[S1-Eth-Trunk1]trunkport g 0/0/11 to 0/0/12
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-Eth-Trunk1]p l t
[S1-Eth-Trunk1]p t a v a
[S1-Eth-Trunk1]un sh
Info: Interface Eth-Trunk1 is not shutdown.
[S1-Eth-Trunk1]q
[S1]int g 0/0/21
[S1-GigabitEthernet0/0/21]p l t
[S1-GigabitEthernet0/0/21]p t a v a
[S1-GigabitEthernet0/0/21]un sh
Info: Interface GigabitEthernet0/0/21 is not shutdown.
[S1-GigabitEthernet0/0/21]int g 0/0/22
[S1-GigabitEthernet0/0/22]p l t
[S1-GigabitEthernet0/0/22]p t a v a
[S1-GigabitEthernet0/0/22]un sh
Info: Interface GigabitEthernet0/0/22 is not shutdown.
[S1-GigabitEthernet0/0/22]
LSW3:
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW3
[LSW3]un in en
Info: Information center is disabled.
[LSW3]v b 11
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW3]int g 0/0/1
[LSW3-GigabitEthernet0/0/1]p l t
[LSW3-GigabitEthernet0/0/1]p t a v a
[LSW3-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[LSW3-GigabitEthernet0/0/1]int e 0/0/1
[LSW3-Ethernet0/0/1]p l a
[LSW3-Ethernet0/0/1]p d v 11
[LSW3-Ethernet0/0/1]
LSW4:
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]v b 12
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int g 0/0/1
Feb 8 2020 16:42:48-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 4, th
e change loop count is 0, and the maximum number of records is 4095.
[Huawei-GigabitEthernet0/0/1]p l t
[Huawei-GigabitEthernet0/0/1]p t a v
Feb 8 2020 16:42:58-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 5, th
e change loop count is 0, and the maximum number of records is 4095.
[Huawei-GigabitEthernet0/0/1]p t a v a
[Huawei-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[Huawei-GigabitEthernet0/0/1]in
Feb 8 2020 16:43:08-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 6, th
e change loop count is 0, and the maximum number of records is 4095.t
[Huawei-GigabitEthernet0/0/1]int e 0/0/1
[Huawei-Ethernet0/0/1]p l a
[Huawei-Ethernet0/0/1]p d v 12
Feb 8 2020 16:43:18-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 7, th
e change loop count is 0, and the maximum number of records is 4095.
[Huawei-Ethernet0/0/1]
[Huawei-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.
接下来到S1中启用OSPF
[S1-GigabitEthernet0/0/22]int vlanif 11
[S1-Vlanif11]ip add 10.1.11.1 24
[S1-Vlanif11]in vlanif 12
[S1-Vlanif12]ip add 10.1.12.1 24
[S1-Vlanif12]int vlanif 1000
[S1-Vlanif1000]ip add 10.1.122.11 24
[S1-Vlanif1000]int vlanif 1001
[S1-Vlanif1001]ip add 10.1.111.12 24
[S1-Vlanif1001]int loo 0
[S1-LoopBack0]ip add 11.11.11.11 32
[S1-LoopBack0]q
[S1]router id 11.11.11.11
[S1]ospf 1
[S1-ospf-1]area 0
[S1-ospf-1-area-0.0.0.0]network 10.1.11.0 0.0.0.255
[S1-ospf-1-area-0.0.0.0]network 10.1.12.0 0.0.0.255
[S1-ospf-1-area-0.0.0.0]network 10.1.122.0 0.0.0.255
[S1-ospf-1-area-0.0.0.0]network 10.1.111.0 0.0.0.255
[S1-ospf-1-area-0.0.0.0]network 11.11.11.11 0.0.0.0
[S1-ospf-1-area-0.0.0.0]q
[S1-ospf-1]dis ip rou
[S1-ospf-1]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface
3.3.3.3/32 OSPF 10 2 D 10.1.111.11 Vlanif1001
10.1.11.0/24 Direct 0 0 D 10.1.11.1 Vlanif11
10.1.11.1/32 Direct 0 0 D 127.0.0.1 Vlanif11
10.1.12.0/24 Direct 0 0 D 10.1.12.1 Vlanif12
10.1.12.1/32 Direct 0 0 D 127.0.0.1 Vlanif12
10.1.111.0/24 Direct 0 0 D 10.1.111.12 Vlanif1001
10.1.111.12/32 Direct 0 0 D 127.0.0.1 Vlanif1001
10.1.112.0/24 OSPF 10 2 D 10.1.111.11 Vlanif1001
10.1.113.0/24 OSPF 10 2 D 10.1.111.11 Vlanif1001
10.1.122.0/24 Direct 0 0 D 10.1.122.11 Vlanif1000
10.1.122.11/32 Direct 0 0 D 127.0.0.1 Vlanif1000
11.11.11.11/32 Direct 0 0 D 127.0.0.1 LoopBack0
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
接下来进S2
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys
[Huawei]sysname S2
[S2]v b 13 14 1000 1002
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2]int g 0/0/2
[S2-GigabitEthernet0/0/2]p l a
[S2-GigabitEthernet0/0/2]p d v 1002
[S2-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[S2-GigabitEthernet0/0/2]int eth-t 1
[S2-Eth-Trunk1]trunkport g 0/0/11 to 0/0/12
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-Eth-Trunk1]p l t
[S2-Eth-Trunk1]p t a v a
[S2-Eth-Trunk1]un sh
Info: Interface Eth-Trunk1 is not shutdown.
[S2-Eth-Trunk1]int g 0/0/23
[S2-GigabitEthernet0/0/23]p l t
[S2-GigabitEthernet0/0/23]p t a v a
[S2-GigabitEthernet0/0/23]un sh
Info: Interface GigabitEthernet0/0/23 is not shutdown.
[S2-GigabitEthernet0/0/23]int g 0/0/24
[S2-GigabitEthernet0/0/24]p l t
[S2-GigabitEthernet0/0/24]p t a v a
[S2-GigabitEthernet0/0/24]un sh
Info: Interface GigabitEthernet0/0/24 is not shutdown.
[S2-GigabitEthernet0/0/24]q
[S2]int loo 0
[S2-LoopBack0]ip add 22.22.22.22 32
[S2-LoopBack0]q
[S2]int vlan
[S2]int Vlanif 13
[S2-Vlanif13]ip add 10.1.13.1 24
[S2-Vlanif13]int vlan 14
[S2-Vlanif14]ip add 10.1.14.1 24
[S2-Vlanif14]int vlan 1000
[S2-Vlanif1000]ip add 10.1.122.12 24
[S2-Vlanif1000]q
[S2]ping 10.1.122.11
PING 10.1.122.11: 56 data bytes, press CTRL_C to break
Reply from 10.1.122.11: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 10.1.122.11: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 10.1.122.11: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 10.1.122.11: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.1.122.11: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 10.1.122.11 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/38/50 ms
[S2]int vlan 1002
[S2-Vlanif1002]ip add 10.1.112.12 24
[S2-Vlanif1002]q
[S2]ping 10.1.112.11
PING 10.1.112.11: 56 data bytes, press CTRL_C to break
Reply from 10.1.112.11: bytes=56 Sequence=1 ttl=255 time=80 ms
Reply from 10.1.112.11: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 10.1.112.11: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 10.1.112.11: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.1.112.11: bytes=56 Sequence=5 ttl=255 time=10 ms
--- 10.1.112.11 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/40/80 ms
[S2]router id 22.22.22.22
[S2]ospf 1
[S2-ospf-1]area 0
[S2-ospf-1-area-0.0.0.0]network 10.1.13.0 0.0.0.255
[S2-ospf-1-area-0.0.0.0]network 10.1.14.0 0.0.0.255
[S2-ospf-1-area-0.0.0.0]network 10.1.122.0 0.0.0.255
[S2-ospf-1-area-0.0.0.0]network 10.1.112.0 0.0.0.255
[S2-ospf-1-area-0.0.0.0]network 22.22.22.22 0.0.0.0
[S2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 18 Routes : 19
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 OSPF 10 1 D 10.1.112.11 Vlanif1002
3.3.3.3/32 OSPF 10 2 D 10.1.112.11 Vlanif1002
10.1.11.0/24 OSPF 10 2 D 10.1.122.11 Vlanif1000
10.1.12.0/24 OSPF 10 2 D 10.1.122.11 Vlanif1000
10.1.13.0/24 Direct 0 0 D 10.1.13.1 Vlanif13
10.1.13.1/32 Direct 0 0 D 127.0.0.1 Vlanif13
10.1.14.0/24 Direct 0 0 D 10.1.14.1 Vlanif14
10.1.14.1/32 Direct 0 0 D 127.0.0.1 Vlanif14
10.1.111.0/24 OSPF 10 2 D 10.1.122.11 Vlanif1000
OSPF 10 2 D 10.1.112.11 Vlanif1002
10.1.112.0/24 Direct 0 0 D 10.1.112.12 Vlanif1002
10.1.112.12/32 Direct 0 0 D 127.0.0.1 Vlanif1002
10.1.113.0/24 OSPF 10 2 D 10.1.112.11 Vlanif1002
10.1.122.0/24 Direct 0 0 D 10.1.122.12 Vlanif1000
10.1.122.12/32 Direct 0 0 D 127.0.0.1 Vlanif1000
11.11.11.11/32 OSPF 10 1 D 10.1.122.11 Vlanif1000
22.22.22.22/32 Direct 0 0 D 127.0.0.1 LoopBack0
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
[S2]
LSW5:
Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sys
[Huawei]sysname
^
Error:Incomplete command found at '^' position.
[Huawei]sys
[Huawei]sysname LSW5
[LSW5]un in en
Info: Information center is disabled.
[LSW5]int g 0/0/1
[LSW5-GigabitEthernet0/0/1]p l t
[LSW5-GigabitEthernet0/0/1]p t a v a
[LSW5-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[LSW5-GigabitEthernet0/0/1]int e 0/0/1
[LSW5-Ethernet0/0/1]p l a
[LSW5-Ethernet0/0/1]p d v 13
Error: The VLAN does not exist.
[LSW5-Ethernet0/0/1]q
[LSW5]v b 13
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW5]int e 0/0/1
[LSW5-Ethernet0/0/1]dis this
#
interface Ethernet0/0/1
port link-type access
#
return
[LSW5-Ethernet0/0/1]p d v 13
[LSW5-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.
[LSW5-Ethernet0/0/1]q
[LSW5]
LSW6:
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys
[Huawei]sysname LSW6
[LSW6]v b 14
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW6]int g 0/0/1
[LSW6-GigabitEthernet0/0/1]p l t
[LSW6-GigabitEthernet0/0/1]p t a v a
[LSW6-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[LSW6-GigabitEthernet0/0/1]int e 0/0/1
[LSW6-Ethernet0/0/1]p l a
[LSW6-Ethernet0/0/1]p d v 14
[LSW6-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.
[LSW6-Ethernet0/0/1]
接下来ASBR相互注入
R3:把rip 注入到ospf中
system-view
Enter system view, return user view with Ctrl+Z.
[R3]un in en
Info: Information center is disabled.
[R3]ospf 1
[R3-ospf-1]im
[R3-ospf-1]import-route rip 1 t
[R3-ospf-1]import-route rip 1 ty
[R3-ospf-1]import-route rip 1 type 1
[R3-ospf-1]import-route rip 1 cost 5 type 1
[R3-ospf-1]dis this
[V200R003C00]
#
ospf 1
import-route rip 1 cost 5 type 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 10.1.113.0 0.0.0.255
#
return
[R3-ospf-1]q
查看S1的路由条目
[S1]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 23 Routes : 24
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 OSPF 10 1 D 10.1.111.11 Vlanif1001
3.3.3.3/32 OSPF 10 2 D 10.1.111.11 Vlanif1001
10.1.11.0/24 Direct 0 0 D 10.1.11.1 Vlanif11
10.1.11.1/32 Direct 0 0 D 127.0.0.1 Vlanif11
10.1.12.0/24 Direct 0 0 D 10.1.12.1 Vlanif12
10.1.12.1/32 Direct 0 0 D 127.0.0.1 Vlanif12
10.1.13.0/24 OSPF 10 2 D 10.1.122.12 Vlanif1000
10.1.14.0/24 OSPF 10 2 D 10.1.122.12 Vlanif1000
10.1.21.0/24 O_ASE 150 7 D 10.1.111.11 Vlanif1001
10.1.22.0/24 O_ASE 150 7 D 10.1.111.11 Vlanif1001
10.1.100.0/24 O_ASE 150 7 D 10.1.111.11 Vlanif1001
10.1.111.0/24 Direct 0 0 D 10.1.111.12 Vlanif1001
10.1.111.12/32 Direct 0 0 D 127.0.0.1 Vlanif1001
10.1.112.0/24 OSPF 10 2 D 10.1.111.11 Vlanif1001
OSPF 10 2 D 10.1.122.12 Vlanif1000
10.1.113.0/24 OSPF 10 2 D 10.1.111.11 Vlanif1001
10.1.122.0/24 Direct 0 0 D 10.1.122.11 Vlanif1000
10.1.122.11/32 Direct 0 0 D 127.0.0.1 Vlanif1000
10.1.134.0/24 O_ASE 150 7 D 10.1.111.11 Vlanif1001
10.1.135.0/24 O_ASE 150 7 D 10.1.111.11 Vlanif1001
11.11.11.11/32 Direct 0 0 D 127.0.0.1 LoopBack0
22.22.22.22/32 OSPF 10 1 D 10.1.122.12 Vlanif1000
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
[S1]
R3:把ospf注入到rip中
[R3]rip 1
[R3-rip-1]im
[R3-rip-1]import-route ?
bgp Border Gateway Protocol (BGP) routes
direct Direct routes
isis Intermediate System to Intermediate System (ISIS) routes
ospf Open Shortest Path First (OSPF) routes
rip Routing Information Protocol (RIP) routes
static Static routes
unr User Network Route
[R3-rip-1]import-route ospf 1 cost 5
[R3-rip-1]q
查看AR5的路由
[R5]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.21.0/24 RIP 100 1 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.22.0/24 RIP 100 1 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.100.0/24 Direct 0 0 D 10.1.100.1 GigabitEthernet
0/0/0
10.1.100.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.100.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.134.0/24 RIP 100 1 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.135.0/24 Direct 0 0 D 10.1.135.5 GigabitEthernet
0/0/2
10.1.135.5/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
10.1.135.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
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
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
排查后发现,AR3的rip版本并没有设置,是rip的默认版本,只会接受rip1和rip2的消息,发送rip1信息,而之前的AR4和AR5是rip2,所以不能学习到,在AR3的rip1中声明version 2 即可
[R5]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 25 Routes : 25
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
3.3.3.3/32 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.11.0/24 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.12.0/24 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.13.0/24 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.14.0/24 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.21.0/24 RIP 100 1 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.22.0/24 RIP 100 1 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.100.0/24 Direct 0 0 D 10.1.100.1 GigabitEthernet
0/0/0
10.1.100.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.100.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.111.0/24 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.112.0/24 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.113.0/24 RIP 100 2 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.122.0/24 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.134.0/24 RIP 100 1 D 10.1.135.4 GigabitEthernet
0/0/2
10.1.135.0/24 Direct 0 0 D 10.1.135.5 GigabitEthernet
0/0/2
10.1.135.5/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
10.1.135.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
11.11.11.11/32 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
22.22.22.22/32 RIP 100 7 D 10.1.135.4 GigabitEthernet
0/0/2
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
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
接下来是公司网络如何与互联网进行互联互通的配置
在R2中配置一条默认路由,指向R1,然后在ospf1中注入默认路由,default-route-advertise即可
在R3的rip 1中也注入默认路由 default-route originate,使rip中的R4和R5可以学到
接下来便是作nat地址映射
R2
[R2]acl 2000
[R2-acl-basic-2000] rule 5 permit source 10.1.0.0 0.0.255.255
[R2-acl-basic-2000] q
[R2]int g 0/0/3
[R2-GigabitEthernet0/0/3]nat outbound 2000
[R2-GigabitEthernet0/0/3]nat server protocol tcp global 202.2.12.3 www inside 10.1.100.100 www
R1
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys
[Huawei]sysname R1
[R1]int g 0/0/1
[R1-GigabitEthernet0/0/3]ip add 202.2.12.1 24
[R1-GigabitEthernet0/0/3]un sh
[R1-GigabitEthernet0/0/3]q
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 202.2.2.1 24
[R1-GigabitEthernet0/0/0]un sh
若是PC7使用的是虚拟机的话,便可以访问202.2.12.3,去查看server服务