Policy Routing H3C Switch & router configuration

Policy Routing H3C Switch & router configuration

Method One: Use PBR to achieve, PBR is policy-based routing (usually exist on the router)

As shown, interconnect SWA and SWB, the two devices Ge1 / 0/1 belongs 192.168.2.0/24,SWA apparatus Ge1 / 0/2 addresses belong 192.168.1.0/24,PCA 192.168.1.2/24,PCB address 192.168. 3.2 / 24, SWA does not configure routing 192.168.3.0, but to achieve the SWA route 192.168.3.0 whereabouts SWB, SWB configured to route packets back to host interoperability can be achieved through the PBR next hop.
Here Insert Picture Description
SWA Basic Configuration:
[SWA] VLAN 2
[SWA-VLAN2] quit
[SWA] interface of Vlan-interface 2
[SWA-of Vlan-interface2] IP address 192.168.2.1 24
[SWA-of Vlan-interface2] quit
[SWA] interface vlan- . 1 interface
[SWA-of Vlan-interface1] IP address 192.168.1.1 24
[SWA-of Vlan-interface1] quit

[SWA]interface GigabitEthernet 1/0/1
[SWA-GigabitEthernet1/0/1]port link-type access
[SWA-GigabitEthernet1/0/1]port access vlan 2
[SWA-GigabitEthernet1/0/1]quit
[SWA]interface GigabitEthernet 1/0/2
[SWA-GigabitEthernet1/0/2]port link-type access
[SWA-GigabitEthernet1/0/2]port access vlan 1
[SWA-GigabitEthernet1/0/2]quit

SWB基础配置:
[SWB]vlan 2
[SWB-vlan2]quit
[SWB]interface Vlan-interface 2
[SWB-Vlan-interface2]ip address 192.168.2.2 24
[SWB-Vlan-interface2]quit
[SWB]interface Vlan-interface 1
[SWB-Vlan-interface1]ip address 192.168.3.1 24
[SWB-Vlan-interface1]quit

[SWB]interface GigabitEthernet 1/0/1
[SWB-GigabitEthernet1/0/1]port link-type access
[SWB-GigabitEthernet1/0/1]port access vlan 2
[SWB-GigabitEthernet1/0/1]quit

[SWB] interface of GigabitEthernet 1/0/2
[SWB-GigabitEthernet / 0/2] Port Access Link-type
[SWB-GigabitEthernet / 0/2] Access Port VLAN. 1
[SWB-GigabitEthernet / 0/2] quit
[SWB] ip route-static 192.168.1.0 24 192.168.2.1 # configure packet routing back
---------- basis of the above configured will address both ends of the PC configured, PCA can not communicate with the PCB, the following configuration PBR

SWA PBR routing policy configuration:
[SWA]acl advanced 3000
[SWA-acl-ipv4-adv-3000]rule 5 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.3.0 0.0.0.255
[SWA-acl-ipv4-adv-3000]rule 10 deny ip
[SWA-acl-ipv4-adv-3000]quit

[SWA] policy-based-route pbr permit node 5 # Create a policy named pbr pbr action to allow nodes to 5
[SWA-pbr-pbr-5] IF-match acl 3000 # Configure acl 3000 in the source and destination
[SWA -pbr-pbr-5] apply next -hop 192.168.2.2 # configured next hop
[SWA-pbr-pbr-5 ] quit

[SWA] interface Vlan-interface 1 # I have here is vlan environment, the configuration on the vlan interface if the routing port is configured in Layer 3 pc side interface
[SWA-Implementation Methods of Vlan-interface1] ip Policy-based-route PBR
[ SWA-Vlan-interface1] quit




Method Two: Use Qos policy implementation
Just in the first vlan1 strategies delete
[SWA-Vlan-interface1] undo ip policy-based-route
basis configuration are the same, not in the configuration

[SWA] traffic classifier c1 # Create Qos Class
[SWA-classifier-C1] IF-match ACL 3000
[SWA-classifier-C1] quit
[SWA] the traffic behavior B1 # Create Qos behavior actions
[SWA-behavior-b1] redirect 192.168.2.2-Hop the Next
[SWA-behavior-b1] quit
[SWA] qos policy p1 # create a class qos policy and action binding
[SWA-qospolicy-p1] classifier c1 behavior b1
[SWA-qospolicy-p1] quit
[ SWA] qos vlan-policy p1 vlan 1 inbound # vlan can bind

----------------------------------------------------------------------------------------------------

Published 57 original articles · won praise 8 · views 5542

Guess you like

Origin blog.csdn.net/zdl244/article/details/103516814
Recommended