- Table of Contents
-
- 02-Configuration Examples
- 01-H3C_AAA_Configuration_Examples
- 02-H3C_ACL_Configuration_Examples
- 03-H3C_IGMP_Configuration_Examples
- 04-H3C_IP_Source_Guard_Configuration_Examples
- 05-H3C_Ethernet_OAM_Configuration_Examples
- 06-H3C_NQA_Configuration_Examples
- 07-H3C_QinQ_Configuration_Examples
- 08-H3C_OSPF_Configuration_Examples
- 09-H3C_MPLS_TE_Configuration_Examples
- 10-H3C_OpenFlow_Configuration_Examples
- 11-H3C_NAT_Configuration_Examples
- 12-H3C_RBAC_Configuration_Examples
- 13-H3C_DHCP_Relay_Redundancy_Configuration_Examples
- 14-H3C_DLDP_Configuration_Examples
- 15-H3C_IS-IS_Configuration_Examples
- 16-H3C_MPLS_L3VPN_Configuration_Examples
- 17-H3C_SSH_Configuration_Examples
- 18-H3C_Login_Management_Configuration_Examples
- 19-H3C_SNMP_Configuration_Examples
- 20-H3C_Priority_Marking_and_Queue_Scheduling_Configuration_Examples
- 21-H3C_Multicast_VPN_Configuration_Examples
- 22-H3C_BGP_Configuration_Examples
- 23-H3C_HoVPN_Configuration_Examples
- 24-H3C_L2TP_Configuration_Examples
- 25-H3C_VRRP_Configuration_Examples
- 26-H3C_Traffic_Filtering_Configuration_Examples
- 27-H3C_Samplers_and_IPv4_NetStream_Configuration_Examples
- 28-H3C_MPLS_L2VPN_Configuration_Examples
- 29-H3C_NetStream_Configuration_Examples
- 30-H3C_Policy-Based_Routing_Configuration_Examples
- 31-H3C_Traffic_Policing_Configuration_Examples
- 32-H3C_BFD_Configuration_Examples
- 33-H3C_OSPFv3_Configuration_Examples
- 34-H3C_VPLS_Configuration_Examples
- 35-H3C_GTS_and_Rate_Limiting_Configuration_Examples
- 36-H3C_IPv6_IS-IS_Configuration_Examples
- 37-H3C_MPLS OAM_Configuration_Examples
- 38-H3C_BGP_Route_Selection_Configuration_Examples
- 39-H3C_IS-IS_Route_Summarization_Configuration_Examples
- 40-H3C_SRv6 Configuration Examples
- 41-H3C_Attack_Protection_Configuration_Examples
- 42-H3C_OSPF_Multi-Process_Configuration_Examples
- 43-H3C_OSPF_with_Multi-Instance_Configuration_Examples
- 44-H3C_ARP_Attack_Protection_Configuration_Examples
- 45-H3C_DHCPv6_Server_and_DHCPv6_Prefix_Client_Configuration_Examples
- 46-General QoS Configuration Examples
- 47-GRE Tunnel Establishment Using OSPF Configuration Examples
- 48-GRE Tunnel Establishment Using Static Routes Configuration Examples
- 49-QoS Configuration Examples for the Financial Industry
- Related Documents
-
Title | Size | Download |
---|---|---|
33-H3C_OSPFv3_Configuration_Examples | 127.06 KB |
Example: Configuring OSPFv3 route filtering
Configuring route redistribution
Configuring OSPFv3 route filtering
Introduction
This document provides OSPFv3 route filtering configuration examples.
Prerequisites
The configuration examples in this document were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.
This document assumes that you have basic knowledge of OSPFv3 route filtering.
Example: Configuring OSPFv3 route filtering
Network configuration
As shown in Figure 1, the devices of an enterprise reside in OSPFv3 and RIPng domains.
Configure route redistribution between OSPFv3 and RIPng to interconnect the devices.
Configure route filtering on Device E, Device C, and Device D to meet the following requirements:
· The route destined for R&D department 2 is not redistributed to OSPFv3.
· Marketing department 1 cannot reach R&D department 1.
· R&D department 1 and the After-sale service department cannot reach Marketing department 2.
Table 1 Interface and IP address assignment
Device |
Interface |
IP address |
Device |
Interface |
IP address |
Device A |
XGE0/0/15 |
1::1/64 |
Device B |
XGE0/0/15 |
1::2/64 |
|
XGE0/0/16 |
2::1/64 |
|
XGE0/0/16 |
3::1/64 |
|
XGE0/0/17 |
4::1/64 |
|
|
|
Device C |
XGE0/0/15 |
2::2/64 |
Device D |
XGE0/0/15 |
3::2/64 |
|
Loop0 |
13::1/64 |
|
Loop0 |
11::1/64 |
|
|
|
|
Loop1 |
12::1/64 |
Device E |
XGE0/0/15 |
4::2/64 |
Device F |
XGE0/0/15 |
5::2/64 |
|
XGE0/0/16 |
5::1/64 |
|
Loop0 |
14::1/64 |
|
|
|
|
Loop1 |
15::1/64 |
Restrictions and guidelines
· When you configure OSPFv3 route filtering, follow these restrictions and guidelines:
· The filter-policy export command that filters redistributed routes takes effect only on an ASBR.
· OSPFv3 filters routes calculated using received LSAs. It does not filter LSAs.
· IP communication is bidirectional. If a router filters a route destined for Network A, the subnets attached to the router cannot reach Network A, and Network A cannot reach the subnets.
· When you configure route filtering by referencing an ACL, configure the rule permit source any item following multiple rule deny source items to allow unmatched routes to pass.
· Specify a Router ID when you configure OSPFv3.
Procedures
Configuring IPv6 addresses
# Configure an IPv6 address for Ten-GigabitEthernet 0/0/15.
<DeviceA> system-view
[DeviceA] interface ten-gigabitethernet 0/0/15
[DeviceA-Ten-GigabitEthernet0/0/15] ipv6 address 1::1 64
# Configure IPv6 addresses for other interfaces, as shown in Figure 1. (Details not shown.)
Configuring OSPFv3
# Enable OSPFv3 on Device A.
<DeviceA> system-view
[DeviceA] ospfv3
[DeviceA-ospfv3-1] router-id 6.6.6.6
[DeviceA-ospfv3-1] quit
[DeviceA] interface ten-gigabitethernet 0/0/15
[DeviceA-Ten-GigabitEthernet0/0/15] ospfv3 1 area 0
[DeviceA-Ten-GigabitEthernet0/0/15] quit
[DeviceA] interface ten-gigabitethernet 0/0/16
[DeviceA-Ten-GigabitEthernet0/0/16] ospfv3 1 area 2
[DeviceA-Ten-GigabitEthernet0/0/16] quit
[DeviceA] interface ten-gigabitethernet 0/0/17
[DeviceA-Ten-GigabitEthernet0/0/17] ospfv3 1 area 1
[DeviceA-Ten-GigabitEthernet0/0/17] quit
# Enable OSPFv3 on Device B.
<DeviceB> system-view
[DeviceB] ospfv3
[DeviceB-ospfv3-1] router-id 5.5.5.5
[DeviceB-ospfv3-1] quit
[DeviceB] interface ten-gigabitethernet 0/0/15
[DeviceB-Ten-GigabitEthernet0/0/15] ospfv3 1 area 0
[DeviceB-Ten-GigabitEthernet0/0/15] quit
[DeviceB] interface ten-gigabitethernet 0/0/16
[DeviceB-Ten-GigabitEthernet0/0/16] ospfv3 1 area 3
[DeviceB-Ten-GigabitEthernet0/0/16] quit
# Enable OSPFv3 on Device C.
<DeviceC> system-view
[DeviceC] ospfv3
[DeviceC-ospfv3-1] router-id 4.4.4.4
[DeviceC-ospfv3-1] quit
[DeviceC] interface ten-gigabitethernet 0/0/15
[DeviceC-Ten-GigabitEthernet0/0/15] ospfv3 1 area 2
[DeviceC-Ten-GigabitEthernet0/0/15] quit
[DeviceC]interface LoopBack 0
[DeviceC-LoopBack0] ospfv3 1 area 2
[DeviceC-LoopBack0] quit
# Enable OSPFv3 on Device D.
<DeviceD> system-view
[DeviceD] ospfv3
[DeviceD-ospfv3-1] router-id 3.3.3.3
[DeviceD-ospfv3-1] quit
[DeviceD] interface ten-gigabitethernet 0/0/15
[DeviceD-Ten-GigabitEthernet0/0/15] ospfv3 1 area 3
[DeviceD-Ten-GigabitEthernet0/0/15] quit
[DeviceD]interface LoopBack 0
[DeviceD-LoopBack0] ospfv3 1 area 3
[DeviceD-LoopBack0] quit
[DeviceD]interface LoopBack 1
[DeviceD-LoopBack1] ospfv3 1 area 3
[DeviceD-LoopBack1] quit
# Enable OSPFv3 on Device E.
<DeviceE> system-view
[DeviceE] ospfv3
[DeviceE-ospfv3-1] router-id 2.2.2.2
[DeviceE-ospfv3-1] quit
[DeviceE] interface ten-gigabitethernet 0/0/15
[DeviceE-Ten-GigabitEthernet0/0/15] ospfv3 1 area 1
[DeviceE-Ten-GigabitEthernet0/0/15] quit
Configuring RIPng
# Enable RIPng on Device E.
<DeviceE> system-view
[DeviceE] ripng
[DeviceE-ripng-1] quit
[DeviceE] interface ten-gigabitethernet 0/0/16
[DeviceE-Ten-GigabitEthernet0/0/16] ripng 1 enable
[DeviceE-Ten-GigabitEthernet0/0/16] quit
# Enable RIPng on Device F.
<DeviceF> system-view
[DeviceF] ripng
[DeviceF-ripng-1] quit
[DeviceF] interface ten-gigabitethernet 0/0/15
[DeviceF-Ten-GigabitEthernet0/0/15] ripng 1 enable
[DeviceF-Ten-GigabitEthernet0/0/15] quit
[DeviceF]interface LoopBack 0
[DeviceF-LoopBack0] ripng 1 enable
[DeviceF-LoopBack0] quit
[DeviceF]interface LoopBack 1
[DeviceF-LoopBack1] ripng 1 enable
[DeviceF-LoopBack1] quit
Configuring route redistribution
# Configure Device E to redistribute OSPFv3 and direct routes to RIPng.
<DeviceE> system-view
[DeviceE] ripng
[DeviceE-ripng-1] import-route direct
[DeviceE-ripng-1] import-route ospfv3
[DeviceE-ripng-1] quit
# Configure Device E to redistribute RIPng and direct routes to OSPFv3.
[DeviceE] ospfv3
[DeviceE-ospfv3-1] import-route direct
[DeviceE-ospfv3-1] import-route ripng
[DeviceE-ospfv3-1] quit
# Verify that Device E has routes to all networks.
[Device E]display ipv6 routing-table
Destinations : 15 Routes : 15
Destination: ::1/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 1::/64 Protocol : O_INTER
NextHop : FE80::2E0:FCFF:FE58:124D Preference: 10
Interface : XGE0/0/15 Cost : 2
Destination: 2::/64 Protocol : O_INTER
NextHop : FE80::2E0:FCFF:FE58:124D Preference: 10
Interface : XGE0/0/15 Cost : 2
Destination: 3::/64 Protocol : O_INTER
NextHop : FE80::2E0:FCFF:FE58:124D Preference: 10
Interface : XGE0/0/15 Cost : 3
Destination: 4::/64 Protocol : Direct
NextHop : :: Preference: 0
Interface : XGE0/0/15 Cost : 0
Destination: 4::2/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 5::/64 Protocol : Direct
NextHop : :: Preference: 0
Interface : XGE0/0/16 Cost : 0
Destination: 5::1/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 11::1/128 Protocol : O_INTER
NextHop : FE80::2E0:FCFF:FE58:124D Preference: 10
Interface : XGE0/0/15 Cost : 3
Destination: 12::1/128 Protocol : O_INTER
NextHop : FE80::2E0:FCFF:FE58:124D Preference: 10
Interface : XGE0/0/15 Cost : 3
Destination: 13::1/128 Protocol : O_INTER
NextHop : FE80::2E0:FCFF:FE58:124D Preference: 10
Interface : XGE0/0/15 Cost : 2
Destination: 14::/64 Protocol : RIPng
NextHop : FE80::2E0:FCFF:FE11:19B5 Preference: 100
Interface : XGE0/0/16 Cost : 1
Destination: 15::/64 Protocol : RIPng
NextHop : FE80::2E0:FCFF:FE11:19B5 Preference: 100
Interface : XGE0/0/16 Cost : 1
Destination: FE80::/10 Protocol : Direct
NextHop : :: Preference: 0
Interface : InLoop0 Cost : 0
Destination: FF00::/8 Protocol : Direct
NextHop : :: Preference: 0
Interface : NULL0
# Verify that other devices have routes to all networks. (Details not shown.)
Configuring OSPFv3 route filtering
# On Device C, configure IPv6 basic ACL 2000 to deny 12::1/64.
<DeviceC> system-view
[DeviceC] acl ipv6 basic 2000
[DeviceC-acl-ipv6-basic-2000] rule 0 deny source 12::1 64
[DeviceC-acl-ipv6-basic-2000] rule permit source any
[DeviceC-acl-ipv6-basic-2000] quit
# On Device C, use IPv6 ACL 2000 to filter received routes.
[DeviceC] ospfv3
[DeviceC-ospfv3-1] filter-policy 2000 import
[DeviceC-ospfv3-1] quit
# On Device D, configure IPv6 basic ACL 2000 to deny 15::1/64.
<DeviceD> system-view
[DeviceD] acl ipv6 basic 2000
[DeviceD-acl-ipv6-basic-2000] rule 0 deny source 15::1 64
[DeviceD-acl-ipv6-basic-2000] rule permit source any
[DeviceD-acl-ipv6-basic-2000] quit
# On Device D, use IPv6 ACL 2000 to filter received routes.
[DeviceD] ospfv3
[DeviceD-ospfv3-1] filter-policy 2000 import
[DeviceD-ospfv3-1] quit
# On Device E, configure IPv6 basic ACL 2000 to deny 14::1/64.
<DeviceE> system-view
[DeviceE] acl ipv6 basic 2000
[DeviceE-acl-ipv6-basic-2000] rule 0 deny source 14::1 64
[DeviceE-acl-ipv6-basic-2000] rule permit source any
[DeviceE-acl-ipv6-basic-2000] quit
# On Device E, use IPv6 ACL 2000 to filter routes redistributed from RIPng.
[DeviceE] ospfv3
[DeviceE-ospfv3-1] filter-policy 2000 export ripng 1
[DeviceE-ospfv3-1] quit
Verifying the configuration
# Verify that Device C does not have a route to 12::/64.
[DeviceC]display ipv6 routing-table
Destinations : 13 Routes : 13
Destination: ::1/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 1::/64 Protocol : O_INTER
NextHop : FE80::2E0:FCFF:FE58:1245 Preference: 10
Interface : XGE0/0/15 Cost : 2
Destination: 2::/64 Protocol : Direct
NextHop : :: Preference: 0
Interface : XGE0/0/15 Cost : 0
Destination: 2::2/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 3::/64 Protocol : O_INTER
NextHop : FE80::2E0:FCFF:FE58:1245 Preference: 10
Interface : XGE0/0/15 Cost : 3
Destination: 4::/64 Protocol : O_INTER
NextHop : FE80::2E0:FCFF:FE58:1245 Preference: 10
Interface : XGE0/0/15 Cost : 2
Destination: 5::/64 Protocol : O_ASE2
NextHop : FE80::2E0:FCFF:FE58:1245 Preference: 150
Interface : XGE0/0/15 Cost : 1
Destination: 11::1/128 Protocol : O_INTER
NextHop : FE80::2E0:FCFF:FE58:1245 Preference: 10
Interface : XGE0/0/15 Cost : 3
Destination: 13::/64 Protocol : Direct
NextHop : :: Preference: 0
Interface : Loop0 Cost : 0
Destination: 13::1/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 15::/64 Protocol : O_ASE2
NextHop : FE80::2E0:FCFF:FE58:1245 Preference: 150
Interface : XGE0/0/15 Cost : 1
Destination: FE80::/10 Protocol : Direct
NextHop : :: Preference: 0
Interface : InLoop0 Cost : 0
Destination: FF00::/8 Protocol : Direct
NextHop : :: Preference: 0
Interface : NULL0
# Verify that Marketing department 1 cannot reach R&D department 1.
[DeviceC] ping ipv6 -a 13::1 12::1
Ping6(56 data bytes) 13::1 --> 12::1, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- Ping6 statistics for 12::1 ---
5 packet(s) transmitted, 0 packet(s) received, 100.0% packet loss
# Verify that Device D does not have a route to 15::/64.
[DeviceD]display ipv6 routing-table
Destinations : 14 Routes : 14
Destination: ::1/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 1::/64 Protocol : O_INTER
NextHop : FE80::2A0:FCFF:FE00:5815 Preference: 10
Interface : XGE0/0/15 Cost : 2
Destination: 2::/64 Protocol : O_INTER
NextHop : FE80::2A0:FCFF:FE00:5815 Preference: 10
Interface : XGE0/0/15 Cost : 3
Destination: 3::/64 Protocol : Direct
NextHop : :: Preference: 0
Interface : XGE0/0/15 Cost : 0
Destination: 3::2/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 4::/64 Protocol : O_INTER
NextHop : FE80::2A0:FCFF:FE00:5815 Preference: 10
Interface : XGE0/0/15 Cost : 3
Destination: 5::/64 Protocol : O_ASE2
NextHop : FE80::2A0:FCFF:FE00:5815 Preference: 150
Interface : XGE0/0/15 Cost : 1
Destination: 11::/64 Protocol : Direct
NextHop : :: Preference: 0
Interface : Loop0 Cost : 0
Destination: 11::1/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 12::/64 Protocol : Direct
NextHop : :: Preference: 0
Interface : Loop1 Cost : 0
Destination: 12::1/128 Protocol : Direct
NextHop : ::1 Preference: 0
Interface : InLoop0 Cost : 0
Destination: 13::1/128 Protocol : O_INTER
NextHop : FE80::2A0:FCFF:FE00:5815 Preference: 10
Interface : XGE0/0/15 Cost : 3
Destination: FE80::/10 Protocol : Direct
NextHop : :: Preference: 0
Interface : NULL0 Cost : 0
Destination: FF00::/8 Protocol : Direct
NextHop : :: Preference: 0
Interface : NULL0
# Verify that the After-sale service department cannot reach Marketing department 2.
[DeviceD] ping ipv6 -a 11::1 15::1
Ping6(56 data bytes) 11::1 --> 15::1, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- Ping6 statistics for 15::1 ---
5 packet(s) transmitted, 0 packet(s) received, 100.0% packet loss
# Verify that R&D department 1 cannot reach Marketing department 2.
[DeviceD] ping ipv6 -a 12::1 15::1
Ping6(56 data bytes) 12::1 --> 15::1, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- Ping6 statistics for 15::1 ---
5 packet(s) transmitted, 0 packet(s) received, 100.0% packet loss
The output on Device C and Device D shows that Device E has filtered the route destined for R&D development 2.
Configuration files
Device A
#
ospfv3 1
router-id 6.6.6.6
area 0.0.0.0
area 0.0.0.1
area 0.0.0.2
#
interface ten-gigabitethernet 0/0/15
ospfv3 1 area 0.0.0.0
ipv6 address 1::1/64
#
interface ten-gigabitethernet 0/0/16
ospfv3 1 area 0.0.0.2
ipv6 address 2::1/64
#
interface ten-gigabitethernet 0/0/17
ospfv3 1 area 0.0.0.1
ipv6 address 4::1/64
#
Device B
#
ospfv3 1
router-id 5.5.5.5
area 0.0.0.0
area 0.0.0.3
#
interface ten-gigabitethernet 0/0/15
ospfv3 1 area 0.0.0.0
ipv6 address 1::2/64
#
interface ten-gigabitethernet 0/0/16
ospfv3 1 area 0.0.0.3
ipv6 address 3::1/64
#
Device C
#
ospfv3 1
router-id 4.4.4.4
filter-policy 2000 import
area 0.0.0.2
#
interface LoopBack0
ospfv3 1 area 0.0.0.2
ipv6 address 13::1/64
#
interface ten-gigabitethernet 0/0/15
ospfv3 1 area 0.0.0.2
ipv6 address 2::2/64
#
acl ipv6 basic 2000
rule 0 deny source 12::/64
rule 5 permit
#
Device D
#
ospfv3 1
router-id 3.3.3.3
filter-policy 2000 import
area 0.0.0.3
#
interface LoopBack0
ospfv3 1 area 0.0.0.3
ipv6 address 11::1/64
#
interface LoopBack1
ospfv3 1 area 0.0.0.3
ipv6 address 12::1/64
#
interface ten-gigabitethernet 0/0/15
ospfv3 1 area 0.0.0.3
ipv6 address 3::2/64
#
acl ipv6 basic 2000
rule 0 deny source 15::/64
rule 5 permit
#
Device E
#
ospfv3 1
router-id 2.2.2.2
import-route direct
import-route ripng 1
filter-policy 2000 export ripng 1
area 0.0.0.1
#
ripng 1
import-route direct
import-route ospfv3 1
#
interface ten-gigabitethernet 0/0/15
ospfv3 1 area 0.0.0.1
ipv6 address 4::2/64
#
interface ten-gigabitethernet 0/0/16
ipv6 address 5::1/64
ripng 1 enable
#
acl ipv6 basic 2000
rule 0 deny source 14::/64
rule 5 permit
#
Device F
#
ripng 1
#
interface LoopBack0
ipv6 address 14::1/64
ripng 1 enable
#
interface LoopBack1
ipv6 address 15::1/64
ripng 1 enable
#
interface ten-gigabitethernet 0/0/15
ipv6 address 5::2/64
ripng 1 enable
#
Related documentation
· H3C CR16000-M1A Routers Layer—3 IP Routing Configuration Guide
· H3C CR16000-M1A Routers Layer—3 IP Routing Command Reference