cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
927
Views
10
Helpful
4
Replies

Routing based on source subnet

jwilder01
Level 1
Level 1

I need to route 2 networks through 4431 out separate interfaces.

I currently have a default route - 

ip route 0.0.0.0 0.0.0.0 10.50.0.9 (G0/0/0)

Now, I need VLAN 50 traffic to route to G0/0/2 specifically.

!
interface GigabitEthernet0/0/0
ip address 10.50.0.10 255.255.255.252
negotiation auto
!
interface GigabitEthernet0/0/1
description >>Link To SWX<<
mac-address 50f7.22e6.7111
no ip address
negotiation auto
!
interface GigabitEthernet0/0/1.10
description DATA Vlan
encapsulation dot1Q 10 native
ip address 10.10.32.1 255.255.252.0
no ip unreachables
service-policy input PM_CLASSIFY_IN
!
interface GigabitEthernet0/0/1.50
description Student VLAN
encapsulation dot1Q 50
ip address dhcp
no ip unreachables
!
interface GigabitEthernet0/0/1.200
description Voice Vlan
encapsulation dot1Q 200
ip address 10.10.36.1 255.255.255.0
no ip unreachables
service-policy input PM_CLASSIFY_IN
!
interface GigabitEthernet0/0/1.250
encapsulation dot1Q 250
ip address 10.250.32.1 255.255.255.0
service-policy input PM_CLASSIFY_IN
!
interface GigabitEthernet0/0/2
ip address A.A.A.A 255.255.255.248
negotiation auto
!

 

1 Accepted Solution
4 Replies 4

balaji.bandi
Hall of Fame
Hall of Fame

Not sure what VLAN 50 IP address range :

below example - i use for many places works as expected.

- configure an access list to identify the traffic to be forwarded by PBR

 

access-list 101 permit ip 192.168.50.0 00.0.255 any  (this is your VLAN IP address range)

 

- configure a route map to use the acl and set the next hop address

 

route-map PBR permit 1

match ip address 101

set ip next-hop <next hop address>  (your Gig 0/0/2 next hop IP)

- apply the route map to the interface

interface x/x  ( apply to interface, where required)

ip policy route-map PBR

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Hello
So you would possibly first want to make your static default route conditional
The apply some with Policy Base routing (PBR) for your vlan 50 traffic,

However when you do PBR vlan 50 this will ONLY be based on egress traffic, it will have not any bearing on the return path for vlan 50, as such you may incur asymmetric routing, which any ingress traffic for vlan 50 could come in via the primary wan interface.

Example:1 - conditional static default routes

ip sla 1
icmp-echo 8.8.8.8 source-interface gig0/0
timeout 1000
frequency 15

ip sla schedule 1 start now life forever

track 10 rtr1 reachability

access-list 100 permit icmp host 10.50.0.10 host 8.8.8.8 echo

route-map ipsla
match ip address 100
set ip next-hop 10.50.0.9
set interface Null0

ip local policy route-map ipsla





ip route 0.0.0.0 0.0.0.0 gig0/0 10.50.0.9 track 10 name primary link
ip route 0.0.0.0 0.0.0.0 gig0/2 <nexthop ip> 2 name backup link





Example:2 - conditional PBR  (if gig0./2 fails vlan 50 traffic will take the normal routing path specified by routing table



track 11 interface gig0/2 line-protocol

route-map pbr permit 10
set ip next-hop verify-availability <gig0/2 next-hop ip> 1 track 11

Interface GigabitEthernet0/0/1.50
ip policy route-map pbr




Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

khorram1998
Level 1
Level 1
 

To route VLAN 50 traffic through G0/0/2, you can create a static route with the destination network being the VLAN 50 subnet and the next hop being the IP address of G0/0/2.

For example, if the subnet for VLAN 50 is 10.10.32.0/22, you would use the following command:

ip route 10.10.32.0 255.255.252.0 G0/0/2

 

This tells the router that any traffic destined for the 10.10.32.0/22 subnet should be sent out of the G0/0/2 interface.

Additionally, you can also use a route-map to match the source IP address of the traffic and set the next hop IP address to G0/0/2.

It is also good practice to verify the routing table with command

show ip route

to confirm that the correct routes are in place.

Please rate this and mark as solution/answer, if this resolved your issue
All the best,
AK

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card