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

Static Route with excluded subnets

jennyjohn
Level 1
Level 1

How can I create a static route that points

10.0.0.0/8 to go via the gateway 192.168.1.1, but excludes the subnets 10.100.0.0/16 & 10.101.0.0/16 from this static route.

Thanks in advance.

5 Replies 5

Vaibhava Varma
Level 4
Level 4

Hi jennyjohn

If we have an alternate routing gateway for 10.100.0.0/16 and 10.101.0.0/16 we can create specific routes for above subnets pointing to different Next-Hops and the Routing Table will always prefer the most specfic route for above subnets under normal condtions as long as the alternate GW is available.

Regards

Varma

johnlloyd_13
Level 9
Level 9

hi,

you can achive this using an ACL.

interface Vlan10

ip address 192.168.100.1 255.255.255.0

!

interface Vlan20

ip address 10.100.0.1 255.255.0.0

!

interface Vlan30

ip address 10.101.0.1 255.255.0.0

ROUTER1(config)#ip route 10.0.0.0 255.0.0.0 192.168.1.1

ROUTER1(config)#access-list 100 deny ip 10.100.0.0 0.0.255.255 any

ROUTER1(config)#access-list 100 deny ip 10.101.0.0 0.0.255.255 any

ROUTER1(config)#access-list 100 permit ip any any

ROUTER1(config)#int f0/1

ROUTER1(config-if)#no switchport

ROUTER1(config-if)#ip address 192.168.1.2

ROUTER1(config-if)#ip access-group 100 out

----

ROUTER2#sh ip int bri

Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        192.168.1.1     YES manual up                    up

FastEthernet0/1        unassigned      YES unset  administratively down down

Loopback1              10.0.0.1        YES manual up                    up

Vlan1                  unassigned      YES unset  administratively down down

----

PC>ipconfig

IP Address......................: 192.168.100.50

Subnet Mask.....................: 255.255.255.0

Default Gateway.................: 192.168.100.1

PC1>ping 10.0.0.1

Pinging 10.0.0.1 with 32 bytes of data:

Reply from 10.0.0.1: bytes=32 time=63ms TTL=254

Reply from 10.0.0.1: bytes=32 time=32ms TTL=254

Reply from 10.0.0.1: bytes=32 time=47ms TTL=254

Reply from 10.0.0.1: bytes=32 time=31ms TTL=254

Ping statistics for 10.0.0.1:

    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

    Minimum = 31ms, Maximum = 63ms, Average = 43ms

-----

PC2>ipconfig

IP Address......................: 10.100.0.50

Subnet Mask.....................: 255.255.0.0

Default Gateway.................: 10.100.0.1

PC>ping 10.0.0.1

Pinging 10.0.0.1 with 32 bytes of data:

Reply from 10.100.0.1: Destination host unreachable.

Reply from 10.100.0.1: Destination host unreachable.

Reply from 10.100.0.1: Destination host unreachable.

Reply from 10.100.0.1: Destination host unreachable.

Ping statistics for 10.0.0.1:

    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

----

PC3>ipconfig

IP Address......................: 10.101.0.50

Subnet Mask.....................: 255.255.0.0

Default Gateway.................: 10.101.0.1

PC>ping 10.0.0.1

Pinging 10.0.0.1 with 32 bytes of data:

Reply from 10.101.0.1: Destination host unreachable.

Reply from 10.101.0.1: Destination host unreachable.

Reply from 10.101.0.1: Destination host unreachable.

Reply from 10.101.0.1: Destination host unreachable.

Ping statistics for 10.0.0.1:

    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

Jon Marshall
Hall of Fame
Hall of Fame

Can you be more specific ie.

do you want to route 10.100.0.0 & 10.101.0.0 to a different gateway ?

If so you may need to use PBR for this.

Jon

Thanks for the reply, Jon.

10.100.0.0/16 & 10.101.0.0/16 subnets are part of my network itself and I need to add a route on the gateway to send all other 10.0.0.0/8 networks out on to the MPLS. How can I use PBR for this?

Hi,

you can do something like that

ip prefix-list SUBNET100-101 permit 10.100.0.0/16

ip prefix-list SUBNET100-101 permit 10.101.0.0/16

route-map SUBNET100-101

match ip address prefix-list SUBNET100-101

set ip next-hop x.x.x.x

ont the interface where these subnets are connected:

ip policy route-map SUBNET100-101

Regards.

Alain.

Don't forget to rate helpful posts.
Review Cisco Networking for a $25 gift card