路由过滤练习

一.实验要求

二.实验材料

        AR2240路由器4台

三.实验思路

1.IP配置

2.单区域通

3.路由引入

4.路由策略

四.实验配置

AR1
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]syaname AR1
        ^
Error: Unrecognized command found at '^' position.
[Huawei]sysname AR1
[AR1]int g 0/0/0
[AR1-GigabitEthernet0/0/0]ip add 100.1.1.1 24
Apr 22 2024 19:26:53-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR1-GigabitEthernet0/0/0]int l0
[AR1-LoopBack0]ip add 192.168.0.1 32
[AR1-LoopBack0]int l1
[AR1-LoopBack1]ip add 192.168.1.1 32
[AR1-LoopBack1]q
[AR1]rip 1
[AR1-rip-1]v 2
[AR1-rip-1]undo summary
[AR1-rip-1]net 100.0.0.0
[AR1-rip-1]net 192.168.0.0
[AR1-rip-1]net 192.168.1.0
[AR1-rip-1]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<AR1>sys
Enter system view, return user view with Ctrl+Z.
[AR1]rip 1
[AR1-rip-1]im	
[AR1-rip-1]import-route ospf 1
[AR1-rip-1]q
[AR1]dis ip ro	
[AR1]dis ip routing-table p	
[AR1]dis ip routing-table protocol rip
[AR1]
[AR1]dis ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 6        Routes : 6        

RIP routing table status : <Active>
         Destinations : 6        Routes : 6

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      100.2.2.0/24  RIP     100  1           D   100.1.1.2       GigabitEthernet
0/0/0
      100.3.3.0/24  RIP     100  1           D   100.1.1.2       GigabitEthernet
0/0/0
    192.168.2.1/32  RIP     100  1           D   100.1.1.2       GigabitEthernet
0/0/0
    192.168.3.1/32  RIP     100  1           D   100.1.1.2       GigabitEthernet
0/0/0
    192.168.4.1/32  RIP     100  1           D   100.1.1.2       GigabitEthernet
0/0/0
    192.168.5.1/32  RIP     100  1           D   100.1.1.2       GigabitEthernet
0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

[AR1]dis ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 4        Routes : 4        

RIP routing table status : <Active>
         Destinations : 4        Routes : 4

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      100.2.2.0/24  RIP     100  1           D   100.1.1.2       GigabitEthernet
0/0/0
      100.3.3.0/24  RIP     100  1           D   100.1.1.2       GigabitEthernet
0/0/0
    192.168.2.1/32  RIP     100  1           D   100.1.1.2       GigabitEthernet
0/0/0
    192.168.3.1/32  RIP     100  1           D   100.1.1.2       GigabitEthernet
0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

AR2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR2
[AR2]int g 0/0/0
[AR2-GigabitEthernet0/0/0]ip add 100.1.1.2 24
Apr 22 2024 19:27:55-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR2-GigabitEthernet0/0/0]q
[AR2]rip 1
[AR2-rip-1]v 2
[AR2-rip-1]undo summary
[AR2-rip-1]net 100.0.0.0
[AR2-rip-1]q
[AR2]ospf 1 r	
[AR2]ospf 1 router-id 2.2.2.2
[AR2-ospf-1] a 0
[AR2-ospf-1-area-0.0.0.0]net 100.2.2.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]q
[AR2-ospf-1]q
[AR2]dis ospf peer b

	 OSPF Process 1 with Router ID 2.2.2.2
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 ----------------------------------------------------------------------------
[AR2]ospf 1
[AR2-ospf-1]dis this
[V200R003C00]
#
ospf 1 router-id 2.2.2.2 
 area 0.0.0.0 
  network 100.2.2.0 0.0.0.255 
#
return
[AR2-ospf-1]im	
[AR2-ospf-1]import-route rip
[AR2-ospf-1]q
[AR2]dis ip ro	
[AR2]dis ip routing-table p	
[AR2]dis ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 2        Routes : 2        

RIP routing table status : <Active>
         Destinations : 2        Routes : 2

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

    192.168.0.1/32  RIP     100  1           D   100.1.1.1       GigabitEthernet
0/0/0
    192.168.1.1/32  RIP     100  1           D   100.1.1.1       GigabitEthernet
0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

[AR2]ospf 1
[AR2-ospf-1]dis this
[V200R003C00]
#
ospf 1 router-id 2.2.2.2 
 import-route rip 1
 area 0.0.0.0 
  network 100.2.2.0 0.0.0.255 
#
return
[AR2-ospf-1]q
[AR2]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.1.1.2/24         up         up        
GigabitEthernet0/0/1              unassigned           up         down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[AR2]int g 0/0/1
[AR2-GigabitEthernet0/0/1]ip add 100.2.2.2 24
[AR2]dis ospf peer b

	 OSPF Process 1 with Router ID 2.2.2.2
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/1             3.3.3.3          Full        
 ----------------------------------------------------------------------------
[AR2-rip-1]import-route ospf
<AR2>sys
Enter system view, return user view with Ctrl+Z.
[AR2]rip 1
[AR2-rip-1]im	
[AR2-rip-1]import-route ospf
[AR2-rip-1]q
[AR2]acl 2000
[AR2-acl-basic-2000]rul	
[AR2-acl-basic-2000]rule d	
[AR2-acl-basic-2000]rule deny s	
[AR2-acl-basic-2000]rule deny source 192.168.4.0 0.0.1.255
[AR2-acl-basic-2000]rule p	
[AR2-acl-basic-2000]rule permit s	
[AR2-acl-basic-2000]rule permit source 0.0.0.0 255.255.255.255
[AR2-acl-basic-2000]q
[AR2]ro	
[AR2]route-	
[AR2]route-policy-change
[AR2]route-policy xsl p	
[AR2]route-policy xsl permit n	
[AR2]route-policy xsl permit node 10
Info: New Sequence of this List.
[AR2-route-policy]if-m	
[AR2-route-policy]if-match acl 2000
[AR2-route-policy]q
[AR2]rip 1
[AR2-rip-1]pre	
[AR2-rip-1]preference ro	
[AR2-rip-1]preference route-policy xsl
[AR2-rip-1]im	
[AR2-rip-1]import-route ospf ro	
[AR2-rip-1]import-route ospf route-policy xsl
[AR2-rip-1]
[AR2-rip-1]silent-interface 0/0/1
                            ^
Error: Wrong parameter found at '^' position.
[AR2-rip-1]silent-interface g 0/0/1
AR3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR3
[AR3]int g 0/0/0
[AR3-GigabitEthernet0/0/0]ip add 100.2.2.3 24
Apr 22 2024 19:28:28-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR3-GigabitEthernet0/0/0]int g 0/0/1
[AR3-GigabitEthernet0/0/1]ip add 100.3.3.3 24
Apr 22 2024 19:28:45-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR3-GigabitEthernet0/0/1]int l0
[AR3-LoopBack0]ip add 192.168.2.1 32
[AR3-LoopBack0]int l1
[AR3-LoopBack1]ip add 192.168.3.1 32
[AR3-LoopBack1]q
[AR3]ospf 1 r	
[AR3]ospf 1 router-id 3.3.3.3
[AR3-ospf-1]a 0
[AR3-ospf-1-area-0.0.0.0]net 100.2.2.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]net 192.168.2.1 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]net 192.168.3.1 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]q
[AR3-ospf-1]a 1
[AR3-ospf-1-area-0.0.0.1]net 100.3.3.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:51-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=4.3.3.100, Neighbo
rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[AR3-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:51-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=4.3.3.100, Neighbo
rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart) 
[AR3-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:51-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=4.3.3.100, Neighbo
rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch
ange) 
[AR3-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:51-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=4.3.3.100, Neighbo
rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin
g) 
[AR3-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:51-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[8]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=4.3.3.100, Neighbo
rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[AR3-ospf-1-area-0.0.0.1]q
[AR3-ospf-1]q
[AR3]dis ospf peer b

	 OSPF Process 1 with Router ID 3.3.3.3
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.1          GigabitEthernet0/0/1             4.4.4.4          Full        
 ----------------------------------------------------------------------------
[AR3]ospf 1
[AR3-ospf-1]dis this
[V200R003C00]
#
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 100.2.2.0 0.0.0.255 
  network 192.168.2.1 0.0.0.0 
  network 192.168.3.1 0.0.0.0 
 area 0.0.0.1 
  network 100.3.3.0 0.0.0.255 
#
return
[AR3-ospf-1]dis this 
[V200R003C00]
#
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 100.2.2.0 0.0.0.255 
  network 192.168.2.1 0.0.0.0 
  network 192.168.3.1 0.0.0.0 
 area 0.0.0.1 
  network 100.3.3.0 0.0.0.255 
#
return
[AR3]dis ospf peer b

	 OSPF Process 1 with Router ID 3.3.3.3
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/0             2.2.2.2          Full        
 0.0.0.1          GigabitEthernet0/0/1             4.4.4.4          Full        
 ----------------------------------------------------------------------------
AR4
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]syaname AR4
        ^
Error: Unrecognized command found at '^' position.
[Huawei]sysname AR4
[AR4]int g 0/0/0
[AR4-GigabitEthernet0/0/0]ip add 100.3.3.4 24
Apr 22 2024 19:29:59-08:00 AR4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR4-GigabitEthernet0/0/0]int l0
[AR4-LoopBack0]ip add 192.168.4.1 32
[AR4-LoopBack0]int l1
[AR4-LoopBack1]ip add 192.168.5.1 32
[AR4-LoopBack1]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<AR4>sys
Enter system view, return user view with Ctrl+Z.
[AR4]ospf 1 r	
[AR4]ospf 1 router-id 4.4.4.4
[AR4-ospf-1]a 1
[AR4-ospf-1-area-0.0.0.1]net 100.3.3.0 0.0.0.255
[AR4-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:50-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.3.3.100, Neighbo
rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[AR4-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:50-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.3.3.100, Neighbo
rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) 
[AR4-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:50-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.3.3.100, Neighbo
rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) 
[AR4-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:51-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.3.3.100, Neighbo
rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch
ange) 
[AR4-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:51-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.3.3.100, Neighbo
rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin
g) 
[AR4-ospf-1-area-0.0.0.1]
Apr 22 2024 19:36:51-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.3.3.100, Neighbo
rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[AR4-ospf-1-area-0.0.0.1]net 192.168.4.1 0.0.0.0
[AR4-ospf-1-area-0.0.0.1]net 192.168.5.1 0.0.0.0
[AR4-ospf-1-area-0.0.0.1]q
[AR4-ospf-1]q
[AR4]dis ospf peer b

	 OSPF Process 1 with Router ID 4.4.4.4
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.1          GigabitEthernet0/0/0             3.3.3.3          Full        
 ----------------------------------------------------------------------------
[AR4]dis ospf peer b

	 OSPF Process 1 with Router ID 4.4.4.4
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.1          GigabitEthernet0/0/0             3.3.3.3          Full        
 ----------------------------------------------------------------------------
[AR4]ip ip-prefix bbb in	
[AR4]ip ip-prefix bbb index 100 deny 192.168.0.0 23 l	
[AR4]ip ip-prefix bbb index 100 deny 192.168.0.0 23 less-equal 32
[AR4]ip ip-prefix bbb index 110 p	
[AR4]ip ip-prefix bbb index 110 permit 0.0.0.0 0 l	
[AR4]ip ip-prefix bbb index 110 permit 0.0.0.0 0 less-equal 32
[AR4]ospf 1
[AR4-ospf-1]f	
[AR4-ospf-1]filter-lsa-out
[AR4-ospf-1]filter-policy ip	
[AR4-ospf-1]filter-policy ip-prefix bbb im	
[AR4-ospf-1]filter-policy ip-prefix bbb import 
[AR4-ospf-1]q
[AR4]dis ip ro	
[AR4]dis ip routing-table p	
[AR4]dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 4        Routes : 4        

OSPF routing table status : <Active>
         Destinations : 4        Routes : 4

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      100.1.1.0/24  O_ASE   150  1           D   100.3.3.3       GigabitEthernet
0/0/0
      100.2.2.0/24  OSPF    10   2           D   100.3.3.3       GigabitEthernet
0/0/0
    192.168.2.1/32  OSPF    10   1           D   100.3.3.3       GigabitEthernet
0/0/0
    192.168.3.1/32  OSPF    10   1           D   100.3.3.3       GigabitEthernet
0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

五.实验结论

        注意事项,在书写地址前缀列表时,写的名字代表这条策略,而index号代表里面不同的规则,如果用的index一样会覆盖掉前面的.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值