cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1425
Views
0
Helpful
11
Replies

Static Routing with C2960G Switch Issues

Alvin Chung
Level 1
Level 1

Scenario

  • Two Cisco C2960G Switches connected with each other using an EtherChannel Trunk Ports.
  • IOS Image has been upgraded to c2960-lanbasek9-mz.122-58.SE2.bin.
  • The global command "sdm prefer lanbase-routing" has been executed to set the default template to "lanbase-routing".
  • The global command "ip routing" has been executed to enable the ip routing.
  • An IP route has been configured in each switch to point to each other for the static routing purpose (Please see the 2 attached configuration files)

Problem

The hosts in VLAN 111 and VLAN 110 are not able to see each other even the ip static routes have been configured.

Can anyone help to solve this issue ? May be I have misconfigured some settings but not sure what's the actual problem.

Regards,

Alvin

11 Replies 11

Reuben Farrelly
Level 3
Level 3

Most likely because you haven't defined VLAN 110 on switch-1 and you haven't defined VLAN 111 on switch-2.

The presence of Layer-3 Vlan interfaces does not automatically mean the layer 2 VLANs exist on the switch.

Create those layer 2 VLANs and try again...

Hi Reuben,

I have defined the VLAN 110 and VLAN 111 as below:

Switch1(Config)#vlan 110

Switch1(Config)#name 192.168.1.0/24

Switch2(Config)#vlan 111

Switch2(Config)#name 192.168.3.0/24

Do I need to do anything else ? It still does not work properly.

What I need to do is to allow some hosts connected to VLAN 111 which is created in Switch 1, to access some other hosts connected to VLAN 110 which is created in Switch 2, with the help of static routing.

In this stage, I have a host with IP address 192.168.3.1 connected to Switch 1 which can ping to 192.168.3.254, but it cannot ping to 192.168.1.254, which is the IP address of the VLAN 110 SVI in Switch 2.

Regards,

Alvin

Hi Alvin,

The best way to acheive this is to modify your configuration as below

Switch 1

Switch1(Config)#vlan 110

Switch1(Config)#name 192.168.1.0/24

interface Vlan110

ip address 192.168.1.250 255.255.255.0

Switch 2

Switch2(Config)#vlan 111

Switch2(Config)#name 192.168.3.0/24

interface Vlan111

ip address 192.168.3.250 255.255.255.0

You dont need any static routes then as communication will happen over L2.

Hope that helps.

Regards

Najaf

Please rate when applicable or helpful !!!

Hi Najaf,

Do you mean I need to define both VLAN 110 and VLAN 111 in all 2 switches and assign the IP addresses to all 4 VLAN interfaces (Switch 1 - VLAN 110 & VLAN 111, Switch 2 - VLAN 110 & VLAN 111) ?

Regards,

Alvin

This is what I would recommend, Alvin:

1. Make sure Vlans 110 and Vlans 111 are created on both switches:

vlan 110

name XYZ

!

vlan 111

name ABC

2. Remove interface Vlan interfaces 110 and 111 on the second switch (no interface vlan110 and no interface vlan111)

3. Have Vlan interfaces 110 and 111 ONLY on the first switch

Note: the vlan commands we added in step 1 above just are for enabling Layer 2 connectivity within the VLAN, the commands in step 2 remove the routed (layer 3) interfaces.

The fact that you have an etherchannel between the two switches is not relevant in this case.   To keep things simple, just do your inter-vlan routing on one switch, and leave the other as a layer 2 switch.

You won't need any static routes except a default route, as the two subnets will be directly connected to the switch so will automatically be populated in the routing table as routes of type 'C'.

For a host in VLAN 10 make sure it uses the IP address of VLAN10 on the switch as it's default gateway, and likewise for a host on VLAN 11.

If it still doesn't work then please post your latest configs with above changes, and also the result of pings from a host on VLAN 10 pinging the VLAN10 IP on the switch (as well as the same for VLAN 11).

This is a very simple setup so it should be very easy to get to work.

Reuben

Hi Reuben,

I have followed what you have suggested and everything seems to be working now.  Really appreciate your great help.

Just curious, you approach is actually just enable the Layer 3 Routing (ip routing command) in one of the two C2960G Switches and leave the other one as a normal Layer 2 Switch, is it right ? If so, it seems that the Inter-VLAN Routing can only work in a single switch rather than 2 different switches.

Not sure why it's not working of what I have expected initially, since I have used this document as a reference :

Configuring Static IP Unicast Routing

Thanks for all the buddies who have given me various suggestions.

Regards,

Alvin

Hi Alvin

It gets messy if you try and do routing on both.  It is certainly do-able, but you then need to run what is called a "routing protocol" between the two switches so that each knows what subnets are on which one.  Routing protocols aren't available on the 2960s - you need a 3560 or better to do this.  To do this properly and in a highly available setup, you really need a routing protocol (such as OSPF, EIGRP) and likely something like VRRP or HSRP as well to "virtualise" the default gateway IPs.

Just do your routing on one device and keep it simple.  You're better to keep it simple and understand it well than try and make it more complicated and not really know what is going on.

The document you hyperlinked to is 100% correct, but it doesn't seem to state one of the key assumptions that you need to get right prior to starting out, which was that you need to have the layer 2 VLANs exist on the switch first.  I think that's what your original problem was.

Reuben

Totally agree with you.

Thanks, Reuben.

Regards,

Alvin

Hello Alvin,

No sure what you are trying to so here, you have trunks setup between the switches, so in that case switching will be performed between them, resulting in  the static routes pointing each other will have no meaning.

also looking at your static routes, Switch2 is pointing 192.168.2.0/24 instead of 192.168.3.0/24

If you want L3 routing instead of L2 switching then i purpose:

  1. The interconnect between the two switches should be an access port in vlan 101
  2. vlan111 ( switch1) & vlan 110 (switch2) should have live access ports assigned to them to bring the relative vlans into a up/up state
  3. Change the static on switch 2 to point to switch 1 vlan 101

Otherwise for L2 switching:

  • set either switch as a l3 switch and the other as a host switch
  • enable ip routing on the L3 switch and disable it on the host switch
  • trunk the interconnects between these switches
  • Set the L3 switch as the vtp server and create the L2 vlans so they can be propagated to the host switch
  • on the host switch assign a default-gateway for managment purposes

res

Paul

Please don't forget to rate any posts that have been helpful.

Thanks.


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hi Alvin,

That is correct.

Hope that helps.

Regards

Najaf

Please rate when applicable or helpful !!!

parvinder.s
Level 1
Level 1

A Layer 3 Vlan(an SVI, which will be routing vlan) on both switches can be created. make is traveled in the trunk between switch1 & 2.

Give this vlan ip addresses on both switches. for example.......vlan is 100.......ip on switch1 is 10.100.100.1/30.............10.100.100.2/30 on switch2.

static routes.

switch1(config)#ip route 192.168.1.0 255.255.255.0 10.100.100.2                  toward the vlan 110 in switch2

switch2(config)#ip route 192.168.3.0 255.255.255.0 10.100.100.1                    toward the vlan 111 in switch1

thanks

Review Cisco Networking for a $25 gift card