cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

679
Views
0
Helpful
16
Replies
Beginner

The cisco switch routing challenge.

I would like to know if any one can device a solution for this challenge.

Rules of the game:  It must be solved using IOS configuration parameters.

Here is the challenge:

On any given CISCO IOS switches, make the switch send back the exact packet you have just sent, to and from the same physical port

Some people believe it is impossible to do that, but I would like to know if there are any one out there that can prove this theory wrong, can a Cisco switch be flexible enough to do that?

Mark

Everyone's tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Guru

Re: The cisco switch routing challenge.

Mark

I wasn't trying to win anything, simply answer your question

A 3560 is a L3 switch. However to run PBR (Policy Based Routing) you would need the IP Services feature set. Yes you could apply it on a fast ethernet port.

However i just chose PBR because it was the first thing that came to mind. You don't actually need PBR ie.

int fa0/1

ip address 192.168.5.1 255.255.255.0

no ip redirects

ip route 0.0.0.0 0.0.0.0 192.168.5.20

then from client 192.168.5.10 simply send a packet to the 3560 with a destination address that the 3560 knows nothing about. The packet will be received on the fa0/1 interface and then sent back out to 192.168.5.20 because that is the default route.

Note that both scenarios assume you have a switch connected to fa0/1 with a client attached to that switch with the IP address 192.168.5.10 and a default-gateway of 192.168.5.1.  And that there is another device connected to the same switch as 192.168.5.10 with an IP of 192.168.5.20.

Edit - no it does not modify the src or dst IP of the packet.

Jon

16 REPLIES 16
Hall of Fame Guru

Re: The cisco switch routing challenge.

Mark

You don't say which type of switch it is. If it a L3 switch then that is fairly easy ie.

int gi0/1

no switchport

ip address 192.168.5.1 255.255.255.0

ip policy route-map RETURN

no ip redirects

access-list 101 permit ip host 192.168.5.10 host 195.20.1.1

route-map RETURN permit 10

match ip address  101

set ip next-hop 192.168.5.20 

the above simply redirects any traffic received on gi0/1 from host 192.168.5.10 to 195.20.1.1 back out the same interface to 192.168.5.20

If it is a L2 switch then no as far i know because switches are designed explicitly not to do this.

Jon

Beginner

Re: The cisco switch routing challenge.

Hi Jon

Thanks for your anwser, I'll have test this out first to see if you are the winner of this challenge.

What if it is a Cisco 3560? Also, does it have to use gi0/1 or can it also use etherfast 0/1?  I do not have Gigibit port installed.

Also, does it modify the src and dest of the packet when it is returning it? It has to be the exact same.

Mark

Hall of Fame Guru

Re: The cisco switch routing challenge.

Mark

I wasn't trying to win anything, simply answer your question

A 3560 is a L3 switch. However to run PBR (Policy Based Routing) you would need the IP Services feature set. Yes you could apply it on a fast ethernet port.

However i just chose PBR because it was the first thing that came to mind. You don't actually need PBR ie.

int fa0/1

ip address 192.168.5.1 255.255.255.0

no ip redirects

ip route 0.0.0.0 0.0.0.0 192.168.5.20

then from client 192.168.5.10 simply send a packet to the 3560 with a destination address that the 3560 knows nothing about. The packet will be received on the fa0/1 interface and then sent back out to 192.168.5.20 because that is the default route.

Note that both scenarios assume you have a switch connected to fa0/1 with a client attached to that switch with the IP address 192.168.5.10 and a default-gateway of 192.168.5.1.  And that there is another device connected to the same switch as 192.168.5.10 with an IP of 192.168.5.20.

Edit - no it does not modify the src or dst IP of the packet.

Jon

Beginner

The cisco switch routing challenge.

Hi Jon,

I've finally got around to testing this out myself.  It turns out, to my surprise that the mac address is changed when the packet is routed back out the same port. 

For my situation, I also need the MAC to stay the same when the packet gets reversed back out.  The packet from MAC Layer to Data has to be the same.

Any idea or tricks you can apply to do this?

Thanks,

Mark

Beginner

Re: The cisco switch routing challenge.

Hi Jon,

Well at least you win my respect for being a hall of famer! Deservely so.

Still, I would like to test it fully so this solution will be cemeted on the web.

To add to the question. what if i want it to broadcast it to other ports as well as the one that is connected?

Will let you know how it all turns out.

Thanks,

Mark

Hall of Fame Guru

The cisco switch routing challenge.

Mark

I think when people say it is impossible they are referring to a L2 switch only and in that case i believe it is but you didn't specify which is why i used the example(s) i did.

Jon

Highlighted
VIP Advocate

The cisco switch routing challenge.

As for a L2 switch would it not be possible to use the ip default-gateway x.x.x.x command?  Ok you are dependent on that the destination address of the packet isn't on the L2 switch itself, but if it is an unknown network it should send the packet back out the interface it came in on.

--
Please remember to rate and select a correct answer
Hall of Fame Community Legend

The cisco switch routing challenge.

To add to the question. what if i want it to broadcast it to other ports as well as the one that is connected?

All the question and the challenge sounds fitting for a hub than a switch to me.

Beginner

The cisco switch routing challenge.

Except that it isn't a hub, and thats where the challenge is.

Hall of Fame Guru

The cisco switch routing challenge.

Mark

To add to the question. what if i want it to broadcast it to other ports as well as the one that is connected?

No, you can't do this because it is a routed port.

Jon

Beginner

The cisco switch routing challenge.

What about multicast, let say in want it to also route it to fa 0/2 fa 0/4 and fa 0/5?  Possible?

Thanks,

Mark

Hall of Fame Guru

The cisco switch routing challenge.

Mark

Why don't try testing it yourself. You would learn a lot about switches

Jon

Beginner

The cisco switch routing challenge.

You're right, I think I'm starting to go overboard.  I'll test it out. Thanks for the answer.

But can you answer this yes or no question.  for the above?  Possible to multi-cast yes or no?  And I'll test it out.

Thanks very much for you answer you really surprise me with your patence!!

Hall of Fame Guru

The cisco switch routing challenge.

Mark

Potentially yes, subject to the same conditions ie. the other ports could be routed ports and all ports connected to a L2 switch then yes it might work. I say might because i've never actually done it so it would need testing.

Jon

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards