cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1732
Views
0
Helpful
13
Replies

Really stupid Q, re: Routing one IP away from a connected subnet..

graham smart
Level 1
Level 1

Hi guys,

Got an odd issue that I just cant seem to get fixed.

I have lets say a /24 directly connected via a vlan on a C6500 in the network.

I'm trying to migrate some servers/devices away from it , however I need to move parts of it away bit by bit ( For example a /32 or a /30  that make up the /24 )

Ive tried a direct ip route x.x.x.x 255.255.255.255 y.y.y.y     and even a ip route x.x.x.x 255.255.255.255 y.y.y.y 1

Yet it still prefers the directly connected range ( as I pretty much expected. )

Is there any way I get it to prefer a static route over a directly connected?

As what I try doesnt work.

Thanks

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?
Live chat software for websites. Increase sales.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

1 Accepted Solution

Accepted Solutions

Exactly!

So the directly connected /27  beats the BGP /19 as expected.

You need to get /32 (or /28 at least) either via BGP or statically configured.

HTH,

Milan

View solution in original post

13 Replies 13

cadet alain
VIP Alumni
VIP Alumni

Hi,

there is no way to make a static route prefered over a directly connected route.

I don't really understand what you mean by move parts bit by bit. Can you be more precise about what you want to achieve.

Regards.

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

I have a network on a Vlan (/24) that contains a lot of devices / servers.

I'm moving these to another part of my network ( Servers have new addresses but with a secondary IP of the one on the old network )

Ideally, I would like to move each IP bit by bit to the new network..

Ie:

ip route currentIP 255.255.255.255 newserverIPsomewhereElse

This would then mean that trafic for the specific IP would go to the new place while traffic for the rest of the connected /24 would carry on going where ity is currently..

I was hopeing because the /32 is more specific it would hold weight ( It does on the rest of the network ) but if you are on a device connected to the same switch as the directly connected range, It ignores the static and still routes to the connected range.

Ideally I want to set the /32 to have a better AD than the same IP in the connected range. ( if that makes sense? lol )

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?
Live chat software for websites. Increase sales.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

milan.kulik
Level 10
Level 10

Hi,

as "longest match wins" within the routing table, I guess the host static route might work?

I even think I was using something similar several years ago but can't remember details.

I belive there was some trick - the next-hop needs to be in a different subnet or something like that...

What does "show ip route x.x.x.x" command display when you enter your

ip route x.x.x.x 255.255.255.255 y.y.y.y command?

There might also be a problem with  routing the packets back, as the moved server still keeps the original mask and default gateway configured, so you need another device configured with the same IP address as your original router?

HTH,

Milan

Hmm..

Routing outside of the switch holding the /24 is ok.. The rest of the network gets the /32 update via BGP and routes fine ( So from the internet, Access to the new server is ok. )

Its simply the routing on the local router thats a pain and takes the connected over the static.

Ie:

even if I put the static on the C6500 that has the connected range, A show ip route shows the IP is via connected ( rather than out via the static )

Im wondering if a static pointing to the switches egress interface might fix it .. This would mean a smaller prefix is via a psudo interface.. Hmm...

May give that a try.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?
Live chat software for websites. Increase sales.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

Damn,

Doesnt work.

Ive found out what needs to be done to fix it though!

If I add the /32 to the next hope of the device holding the IP ( in the other location ) BGP updates the network fine.

The issue is that the /24 is directly connected on the old switch.

So,

To fix it.

I need to get the old switch to follow the route in BGP rather than the route for the cirectly connected /24

Any ideas how I can get the switch to prefer the ./32 in the BGP table over the /24 directly connected?

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?
Live chat software for websites. Increase sales.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

Hi,

a host static should work on the old L3 switch.

At least if it behaves the same way as routers.

I tested in my lab (no L3 switch available) on a  Cisco 1812 router:

interface FastEthernet0

ip address 10.1.1.1 255.255.255.0

...

interface FastEthernet1

ip address 169.254.185.210 255.255.255.0

...

ip route 10.1.1.3 255.255.255.255 169.254.185.212

1812#sh ip route

...

S       10.1.1.3/32 [1/0] via 169.254.185.212

C       10.1.1.0/24 is directly connected, FastEthernet0

1812#sh ip cef 10.1.1.3

10.1.1.3/32, version 43, epoch 0, cached adjacency 169.254.185.212

0 packets, 0 bytes

via 169.254.185.212, 0 dependencies, recursive

next hop 169.254.185.212, FastEthernet1 via 169.254.185.212/32

valid cached adjacency

BR,

Milan

This is the problem I get on the "Old switch"

Switch#sh ip cef xxx.125.94.168

xxx.125.94.160/27, version 813430, epoch 0, attached, connected

0 packets, 0 bytes

  tag information set, all rewrites inheritted

    local tag: implicit-null

  via Vlan504, 2 dependencies

    valid glean adjacency

The issue that its taking the Connected route rather than the more specific route that is in BGP...

I know this is normal behaviour.. Just cant figure out how to force it to follow the route learned via BGP

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?
Live chat software for websites. Increase sales.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

Hi,

what does sh ip bgp xxx.125.94.168

display exactly on the Switch?

BR,

Milan

IIts got the supernet from its RR's

Switch#sh ip bgp xxx.125.94.168

BGP routing table entry for xxx.125.64.0/19, version 47919259

Paths: (2 available, best #2, table Default-IP-Routing-Table)

  Not advertised to any peer

  Local

   xxx.125.95.10 (metric 21) from xxx.125.76.135 xxx.125.76.135)

      Origin IGP, metric 0, localpref 100, valid, internal

      Originator: xxx.125.95.10, Cluster list: xxx.125.76.135

  Local

    xxx.125.95.10 (metric 21) from xxx.125.76.131 (xxx.125.76.131)

      Origin IGP, metric 0, localpref 100, valid, internal, best

      Originator: xxx.125.95.10, Cluster list:xxx.125.76.131

Hmmm. Must mean that its summerizing the /32 from the rest of the network somehwere..

interesting.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?
Live chat software for websites. Increase sales.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

Exactly!

So the directly connected /27  beats the BGP /19 as expected.

You need to get /32 (or /28 at least) either via BGP or statically configured.

HTH,

Milan

Sorry if I'm not understanding correctly but I believe you mentioned that the device you are moving is getting a new primary ip while maintaining the original ip as a secondary address? If so, why not just configure a NAT from the old IP to the new and allow routing to behave normally? I've never done it but it seems like it would work.

Sent from Cisco Technical Support iPad App

The command would be:

ip NAT inside source static [oldip] [newip]

Sent from Cisco Technical Support iPad App

Hi Josh,

NAT isnt really an option in this scenario. We are working with internet IP's across multiple router(C6500) switches across a large OSPF & BGP core.

The problem is that I have servers attached to one vlan hanging off one 6500, These are being migrated to new servers on a different 6500 thats geographically diverse to the other and ar eon "new" addresses.

The reason for the thread was to see how plausable it is to route a /32 out of the /27 or whatever and have traffic on the local device take the specific /32 over the locally connected /27.

As Milan has mentioned. The problem is essentially that BGP simply isnt handing the /32 to the local device as its being summarised somewhere on my network.

As the fix probably requires more effort compared to the risks and goals. I probably wont bother re-routing and just update everything for the new addresses.

Ty for your ideas.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?
Live chat software for websites. Increase sales.

-Graham
Please note: My comments are simply suggestions. I cannot be held liable for any loss of data, life or marbles due to following my instructions.

Got a website? Need some live chat software?

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