cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8101
Views
0
Helpful
38
Replies

how to redistribute static route into ospf

rfuentes1111
Level 1
Level 1

HI Guys,

I need some help on this I want to redistribute static route into ospf, but i want to  do it on a layer 3 switch which is connected to another cisco switch which is the vendor switch but i don't want them to see all  my routes just the one that I want to distribut. I'm new on the routing but i.m familiar with the commands. I don't know if this can be possible to do on layer 3 switch.

here is my example.

interface Vlan2

ip address 192.168.193.1 255.255.255.0

!

interface Vlan3

ip address 192.168.100.1 255.255.255.0

!

router ospf 2

log-adjacency-changes

redistribute static subnets

network 192.168.193.0 0.0.0.255 area 0

network 192.168.100.0 0.0.0.255 area 0

network 150.150.150.0 0.0.0.0 area 0

!

ip classless

ip route 10.10.10.0 255.255.255.255 192.168.100.2

38 Replies 38

Richard Burts
Hall of Fame
Hall of Fame

There are things about your environment that we do not know and which might change our advice. But based on the limited information provided this might work. You might create a second OSPF process and in that second process you could put a network statement for the interface that connects to the vendor switch and then redistribute static into that second process. That way the vendor switch would see the redistributed switch but not the other OSPF routes.

HTH

Rick

HTH

Rick

Here is my company sw config but I'm not able to see the 0 E2 on the company switch or the vendor pc,

this is a project that working on and I don't want to share my routes but they need to be on our network.

also they will be doing inter vlan routing so we have to provide them with a subnet mask that meets that requirements to create 4 subnets any help I will a preciates.

Company sw

interface Vlan2

ip address 192.168.193.1 255.255.255.0

!

interface Vlan3

ip address 192.168.100.1 255.255.255.0

!

router ospf 2

log-adjacency-changes

redistribute static subnets

network 192.168.193.0 0.0.0.255 area 0

network 192.168.100.0 0.0.0.255 area 0

network 150.150.150.0 0.0.0.0 area 0

!

ip classless

ip route 10.10.10.0 255.255.255.255 192.168.100.2

Vendor SW

interface Vlan150
ip address 150.150.150.1 255.255.255.0
!
interface Vlan217
ip address 172.25.217.2 255.255.255.0
!
router ospf 2
log-adjacency-changes
network 10.10.10.0 0.0.0.0 area 0
!
ip classless
ip route 192.168.193.0 255.255.255.0 192.168.100.1

Rick's suggestion is the right one.

You need another OSPF process on your switch so the vendor only sees the static route.

Do you have any clients in the 192.168.100.0/24 subnet or is that just used to connect to the vendor switch ? 

The vendor switch configuration does not show an interface in the 192.168.100.x subnet, did you just not include it ?

Not sure what you are asking about the subnet mask ?

Please answer all of the above.

Jon

We are trying to do a point to point connection sorry I'm new into the routing portion trying to be detail as much as i can. The vendor is using a 3750x switch and need to connect to our network but we don't now where to do the termination if into our Core switch or to one of our IDF closets. We need to provide them with one sunbet mask then they will be doing inter vlan switching inside their own switches. I don't knof if i been help full on this.

interface Vlan2
ip address 192.168.193.1 255.255.255.0
!
interface Vlan3
ip address 192.168.100.1 255.255.255.0
!
router ospf 2
log-adjacency-changes
redistribute static subnets
network 172.25.193.0 0.0.0.255 area 0
network 172.25.217.0 0.0.0.255 area 0
network 10.10.10.0 0.0.0.0 area 0
!
ip classless
ip route 10.10.10.0 255.255.255.255 192.193.100.2

vendor sw

interface Vlan50
ip address 10.10.10.1 255.255.255.0
!
interface Vlan3
ip address 192.168.100.2 255.255.255.0
!
router ospf 2
log-adjacency-changes
network 150.150.150.0 0.0.0.0 area 0
!
ip classless

So is the P2P link going to use 192.168.100.0/24 ?

If so are there no end clients in that IP subnet ?

That is the key question really and if you can answer it we can provide a configuration for you.

Jon

Yes there is clients on 192.168.100.0/24 but when I do the test on a built lab which I have 3 cisco switch 3750 one the switches does not redistribute the static it will only show O not O E2.

Okay, well you need to use a new IP subnet for the P2P connection because you are going to use another OSPF process on your L3 switch and so you cannot have the 192.168.100.0/24 subnet in both processes.

If the link from the vendor switch is going to connect directly into your L3 switch then you just need a /30 IP subnet for the link.

As an example using 192.168.3.0 255.255.255.252 (but you can use anything), on your L3 switch -

int <x/y>    <--- this connects to vendor switch
no switchport
ip address 192.168.3.1 255.255.255.252

router ospf 3  <-- this is in addition to your other OSPF process ie. it is not a replacement
network 192.168.3.0 0.0.0.3 area 0
redistribute static subnets

then give the vendor the IP address 192.168.3.2 with the correct subnet mask.

Jon

Can this be done if they use a layer 3 switch as well on they need to do it on a router. We need to get this done on a switchport not on a router port because they need to be on a specific vlan.

Why do they need to be on a vlan ?

If it is a Cisco switch you can simply use L3 routed ports.

Before you do anything can you read the thread again especially the recent posts because it is not clear what you are trying to do.

You want to advertise a static route into OSPF for the vendor.

What is that static route and where does it point to ?

What subnet is the vendor using and how are you going to advertise that subnet in your network ?

Jon

They need to be on a specific vlan that is for critical data.

I think this is where the confusion is coming in.

You say they need to be on a vlan but you are asking about routing between your switch and theirs which suggests you want to route between vlans instead.

Like we have said, if you can produce full details for the lab setup it may make more sense.

Jon

Jon,

Here something that i want to do but don't know if this is the best practice see my config.  and thank you guys.

interface Vlan2
ip address 192.168.10.1 255.255.255.0 Management Vlan
!
interface Vlan4
ip address 192.168.40.1 255.255.255.0
!
router ospf 2
log-adjacency-changes
redistribute static subnets
network 192.168.40.0 0.0.0.255 area 20
network 192.168.30.0 0.0.0.255 area 20
network 192.168.10.0 0.0.0.255 area 20
!
ip classless
ip route 192.168.30.0 255.255.255.255 192.168.10.2
!
ip flow-export version 9
!
Switch#sh ip route

C 192.168.10.0/24 is directly connected, Vlan2
192.168.30.0/24 is variably subnetted, 2 subnets, 2 masks
O 192.168.30.0/24 [110/2] via 192.168.10.2, 00:12:57, Vlan2
S 192.168.30.0/32 [1/0] via 192.168.10.2
C 192.168.40.0/24 is directly connected, Vlan4
Switch#

Vendorsw#
interface Vlan2
ip address 192.168.10.2 255.255.255.0
!
interface Vlan10
ip address 192.168.30.1 255.255.255.0
!
router ospf 2
log-adjacency-changes
network 192.168.30.0 0.0.0.255 area 20
network 192.168.10.0 0.0.0.255 area 20 Managment Vlan
!
ip classless
ip route 192.168.40.0 255.255.255.0 192.168.10.1
!
ip flow-export version 9
!

vendor#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

C 192.168.10.0/24 is directly connected, Vlan2
192.168.30.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.30.0/24 is directly connected, Vlan10
O E2 192.168.30.0/32 [110/20] via 192.168.10.1, 00:16:29, Vlan2
S 192.168.40.0/24 [1/0] via 192.168.10.1
vendor#

What you are doing here is not limiting OSPF routes.

You have configured a static route to 192.168.40.0/24 on the vendor switch but it is still receiving an OSPF route for that subnet, it is just not used because the static has a better AD.

In addition you have 192.168.30.0/24 under your OSPF configuration on your switch but it belongs to the vendor switch.

Does the vendor switch need to be in the same OSPF area as your switches ?

We can help you with a configuration but we still do not know what you are trying to do at the moment.

We need to know what it is you are trying to achieve otherwise we cannot really help.

Jon

Hi Jon,

Thank you for taking the time and we are doing a P2P Connection and they don't need to see any of my routes but i need to redistribute the static route into my network so my LAN  can see there network in be able to communicate.

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