how can I route based on src IP address/mask ?

Discussion in 'Cisco' started by Rick, Dec 24, 2003.

  1. Rick

    Rick Guest

    Hello,
    I have catalyst 3750.
    I can set static routes with

    ip route a.b.c.d A.B.C.D forward_interface

    but what if I need to route based also on the source IP address/mask ?
    for example I want x.y.z.t to be routed to a interface/destination
    and x.y.v.u to another interface/destination.
    How can I use route-map to do that ??
    thank you very much

    Rick
     
    Rick, Dec 24, 2003
    #1
    1. Advertising

  2. You need to use policy routing>

    JR
    --
    Johnny Routin

    ©¿©
    -




    "Rick" <> wrote in message
    news:...
    >
    > Hello,
    > I have catalyst 3750.
    > I can set static routes with
    >
    > ip route a.b.c.d A.B.C.D forward_interface
    >
    > but what if I need to route based also on the source IP address/mask ?
    > for example I want x.y.z.t to be routed to a interface/destination
    > and x.y.v.u to another interface/destination.
    > How can I use route-map to do that ??
    > thank you very much
    >
    > Rick
    >
     
    Johnny Routin, Dec 24, 2003
    #2
    1. Advertising

  3. Rick

    Sean Guest

    On Wed, 24 Dec 2003 07:42:19 +0000, Rick wrote:

    >
    > Hello,
    > I have catalyst 3750.
    > I can set static routes with
    >
    > ip route a.b.c.d A.B.C.D forward_interface
    >
    > but what if I need to route based also on the source IP address/mask ?
    > for example I want x.y.z.t to be routed to a interface/destination
    > and x.y.v.u to another interface/destination.
    > How can I use route-map to do that ??
    > thank you very much


    Use a route map:
    route-map NAME permit 100
    match ip address 101
    set ip next-hop 10.0.0.1

    access-list 101 permit ip any 192.168.10.0 0.0.0.255

    Interface Ethernet 0 (or whatever)
    ip policy route-map NAME

    This will route all traffic matching access-list 101, incoming on
    interface "Ethernet 0" to be routed to 10.0.0.1 next.
     
    Sean, Dec 24, 2003
    #3
  4. Rick

    hktco Guest

    Try policy routing. It can support routing decision based on source IP
    or source+destination IP.

    http://www.cisco.com/en/US/products...figuration_guide_chapter09186a00800c75d2.html

    =============
    access-list 1 permit x.y.z.t 0.0.0.255

    route-map Example permit 10
    match ip address 1
    set ip next-hop x.y.z.u
    interface fa0/1
    no switchport
    ip address x.y.z.v
    ip policy route-map Example

    hktco

    Rick <> wrote in message news:<>...
    > Hello,
    > I have catalyst 3750.
    > I can set static routes with
    >
    > ip route a.b.c.d A.B.C.D forward_interface
    >
    > but what if I need to route based also on the source IP address/mask ?
    > for example I want x.y.z.t to be routed to a interface/destination
    > and x.y.v.u to another interface/destination.
    > How can I use route-map to do that ??
    > thank you very much
    >
    > Rick
     
    hktco, Dec 24, 2003
    #4
  5. Rick

    Rick Guest

    thank you very much.
    anyway it looks like it does not work applied on vlan interfaces, isn't it ?
    thank you

    Rick

    In article <>, Sean wrote:
    > On Wed, 24 Dec 2003 07:42:19 +0000, Rick wrote:
    >
    >>
    >> Hello,
    >> I have catalyst 3750.
    >> I can set static routes with
    >>
    >> ip route a.b.c.d A.B.C.D forward_interface
    >>
    >> but what if I need to route based also on the source IP address/mask ?
    >> for example I want x.y.z.t to be routed to a interface/destination
    >> and x.y.v.u to another interface/destination.
    >> How can I use route-map to do that ??
    >> thank you very much

    >
    > Use a route map:
    > route-map NAME permit 100
    > match ip address 101
    > set ip next-hop 10.0.0.1
    >
    > access-list 101 permit ip any 192.168.10.0 0.0.0.255
    >
    > Interface Ethernet 0 (or whatever)
    > ip policy route-map NAME
    >
    > This will route all traffic matching access-list 101, incoming on
    > interface "Ethernet 0" to be routed to 10.0.0.1 next.
    >
     
    Rick, Dec 26, 2003
    #5
  6. Rick

    Rick Guest

    Actually when I set

    ip policy route-map NAME
    on the vlan interface I got this error:

    %PLATFORM_PBR-4-SDM_MISMATCH: PBR requires sdm template routing

    any hint ?

    thank you

    Rick

    In article <>, Sean wrote:
    > On Wed, 24 Dec 2003 07:42:19 +0000, Rick wrote:
    >
    >>
    >> Hello,
    >> I have catalyst 3750.
    >> I can set static routes with
    >>
    >> ip route a.b.c.d A.B.C.D forward_interface
    >>
    >> but what if I need to route based also on the source IP address/mask ?
    >> for example I want x.y.z.t to be routed to a interface/destination
    >> and x.y.v.u to another interface/destination.
    >> How can I use route-map to do that ??
    >> thank you very much

    >
    > Use a route map:
    > route-map NAME permit 100
    > match ip address 101
    > set ip next-hop 10.0.0.1
    >
    > access-list 101 permit ip any 192.168.10.0 0.0.0.255
    >
    > Interface Ethernet 0 (or whatever)
    > ip policy route-map NAME
    >
    > This will route all traffic matching access-list 101, incoming on
    > interface "Ethernet 0" to be routed to 10.0.0.1 next.
    >
     
    Rick, Dec 26, 2003
    #6
  7. Rick

    Rick Guest

    I found the solution simply sdm needs a routing preference and reload of
    the switch

    thanks

    Rick

    In article <>, Rick wrote:
    >
    > Hello,
    > I have catalyst 3750.
    > I can set static routes with
    >
    > ip route a.b.c.d A.B.C.D forward_interface
    >
    > but what if I need to route based also on the source IP address/mask ?
    > for example I want x.y.z.t to be routed to a interface/destination
    > and x.y.v.u to another interface/destination.
    > How can I use route-map to do that ??
    > thank you very much
    >
    > Rick
    >
     
    Rick, Dec 26, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    27,323
    rex.mbr
    Mar 25, 2009
  2. Bruce Cao
    Replies:
    3
    Views:
    4,504
    Barry Margolin
    Dec 6, 2005
  3. our
    Replies:
    4
    Views:
    716
    Egghead
    May 10, 2005
  4. Scooty
    Replies:
    1
    Views:
    6,447
    Walter Roberson
    Mar 2, 2007
  5. Replies:
    9
    Views:
    5,132
    Scott Perry
    Aug 7, 2008
Loading...

Share This Page