cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1159
Views
0
Helpful
5
Replies

PBR - Configure only for Internet, ignore all other subnets

InTheJuniverse
Level 1
Level 1

Hello

 

I want to configure a PBR such that traffic going from a particular host to internet must match PBR, everything else should route via routing table.

 

How can I achieve this?

1 Accepted Solution

Accepted Solutions

Hello,

 

below is a sample config, assuming your host is 192.168.10.2. Important parts are marked in bold:

 

interface GigabitEthernet0/1
ip address 1.1.1.1 255.255.255.252
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/2
ip address 192.168.10.1 255.255.255.0
ip policy route-map PBR
duplex auto
speed auto
media-type rj45
!
router eigrp 1
network 0.0.0.0
!
route-map PBR permit 10
match ip address 101
set interface GigabitEthernet0/0
!
access-list 101 deny ip host 192.168.10.2 host 10.10.10.20
access-list 101 deny ip host 192.168.10.2 host 10.20.20.20
access-list 101 permit ip host 192.168.10.2 any

View solution in original post

5 Replies 5

pieterh
VIP
VIP

if you use the the keyword "PBR" you will find many answers to your question; like in:

IP Routing: Protocol-Independent Configuration Guide, Cisco IOS Release 15M&T - Policy-Based Routing [Cisco IOS 15.4M&T] - Cisco

 

in short:
- define the desired traffic (host/subnet and protocol) using an ACL (access-list) that matches this traffic
- for traffic matching this ACL define rules that define the different treatment like routing via another path
- for all other networks do nothing special, so normal routing will occur.

Thank you.

 

I am new to this and I configured a PBR using the document already, it works for one source to one destination, but what I am unable to configure is 

 

If source is x.x.x.x/32 and destination is 10.10.10.0/24 - ignore (use routing table)

if source is x.x.x.x/32 and destination is 10.20.20.0/24 - ignore (use routing table)

if source is x.x.x.x/32 and destination is any - use PBR

 

Thank you in advance for your prompt response.

Hello,

 

below is a sample config, assuming your host is 192.168.10.2. Important parts are marked in bold:

 

interface GigabitEthernet0/1
ip address 1.1.1.1 255.255.255.252
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/2
ip address 192.168.10.1 255.255.255.0
ip policy route-map PBR
duplex auto
speed auto
media-type rj45
!
router eigrp 1
network 0.0.0.0
!
route-map PBR permit 10
match ip address 101
set interface GigabitEthernet0/0
!
access-list 101 deny ip host 192.168.10.2 host 10.10.10.20
access-list 101 deny ip host 192.168.10.2 host 10.20.20.20
access-list 101 permit ip host 192.168.10.2 any

Thank you so much! I configured and this works like expected! Thanks again.

InTheJuniverse
Level 1
Level 1

.