Got it

Policy-based Routing

Created: Sep 11, 2020 09:25:37Latest reply: Sep 11, 2020 09:26:07 557 1 0 0 0
  Rewarded HiCoins: 0 (problem resolved)

Hello,

1

#

acl number 3001

 rule 5 permit ip source 192.168.1.0 0.0.0.255

acl number 3002

 rule 5 permit ip source 192.168.2.0 0.0.0.255

#

traffic classifier c1 operator or

if-match acl 3001

traffic classifier c2 operator or

 if-match acl 3002

#

traffic behavior b1

 redirect ip-nexthop 10.1.20.1

traffic behavior b2

 redirect ip-nexthop 10.1.30.1

#

traffic policy p1 match-order config

 classifier c1 behavior b1

 classifier c2 behavior b2

#

interface GigabitEthernet0/0/3

 traffic-policy p1 inbound

#


The Policy-based Routing configuration is as above, now I want to the traffic of the 192.168.1.100 to be redirected to 10.1.30.1, is there any easy method?

I tried to add rule deny 192.168.1.100 to ACL number 3001, but it didn't work.

Featured Answers

Recommended answer

Popeye_Wang
Admin Created Sep 11, 2020 09:26:07

Hello,

You can use either of the following methods:

Method 1: configure the priority of the traffic behaviors. Give C2 a higher priority.. (This method is supported by some devices.)

#

acl number 3001

rule 5 permit ip source 192.168.1.0 0.0.0.255

acl number 3002

rule 1 permit ip source 192.168.1.100 0.0.0.0    //Add the required IP address.

rule 5 permit ip source 192.168.2.0 0.0.0.255

#

traffic classifier c1 precedence 2     //Configure the priority of the traffic behavior. 

if-match acl 3001

#

traffic classifier c2 precedence 1     //A smaller value indicates a higher priority.

if-match acl 3002

#

traffic policy p1 match-order config

classifier c1 behavior b1

classifier c2 behavior b2

#


Method 2: Switch the sequence of C1 and C2 in the traffic policy. 


#

acl number 3001

rule 5 permit ip source 192.168.1.0 0.0.0.255

acl number 3002

rule 1 permit ip source 192.168.1.100 0.0.0.0      //Add the required IP address.

rule 5 permit ip source 192.168.2.0 0.0.0.255

#

traffic classifier c1 operator or

if-match acl 3001

traffic classifier c2 operator or

if-match acl 3002

#

traffic behavior b1

redirect ip-nexthop 10.1.20.1

traffic behavior b2

redirect ip-nexthop 10.1.30.1

#

traffic policy p1 match-order config

classifier c2 behavior b2    //Change This command is before the classifier c1 behavior b1 command.

classifier c1 behavior b1

#

View more
  • x
  • convention:

All Answers

Hello,

You can use either of the following methods:

Method 1: configure the priority of the traffic behaviors. Give C2 a higher priority.. (This method is supported by some devices.)

#

acl number 3001

rule 5 permit ip source 192.168.1.0 0.0.0.255

acl number 3002

rule 1 permit ip source 192.168.1.100 0.0.0.0    //Add the required IP address.

rule 5 permit ip source 192.168.2.0 0.0.0.255

#

traffic classifier c1 precedence 2     //Configure the priority of the traffic behavior. 

if-match acl 3001

#

traffic classifier c2 precedence 1     //A smaller value indicates a higher priority.

if-match acl 3002

#

traffic policy p1 match-order config

classifier c1 behavior b1

classifier c2 behavior b2

#


Method 2: Switch the sequence of C1 and C2 in the traffic policy. 


#

acl number 3001

rule 5 permit ip source 192.168.1.0 0.0.0.255

acl number 3002

rule 1 permit ip source 192.168.1.100 0.0.0.0      //Add the required IP address.

rule 5 permit ip source 192.168.2.0 0.0.0.255

#

traffic classifier c1 operator or

if-match acl 3001

traffic classifier c2 operator or

if-match acl 3002

#

traffic behavior b1

redirect ip-nexthop 10.1.20.1

traffic behavior b2

redirect ip-nexthop 10.1.30.1

#

traffic policy p1 match-order config

classifier c2 behavior b2    //Change This command is before the classifier c1 behavior b1 command.

classifier c1 behavior b1

#

View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.