Inter-VLAN routing doubts

Answered Question
Jun 7th, 2010
User Badges:

I'm trying to setup interVLAN routing in my 24 port 3560G switch.


I used the Cisco Network Assistant to create the VLANs and assign them IP addresses like this:


VLAN 1 (default) 192.168.131.254 (the switch address) 255.255.255.0
VLAN 100 192.168.100.1 255.255.255.0
VLAN 200 192.168.200.1 255.255.255.0


All of the hosts in the LAN have static IP addresses in the 131 subnet, this is why the switch has the 192.168.131.254 address. Do I have to change the IP address subnet of the hosts depending on wich subnet I want them to become right?


I used the Inter-VLAN Routing Wizard to set up the routing and I got the following:


I can ping from the router to any host in any VLAN
I can ping from any host to any VLAN interface ip but
I can not ping from any host to any other host in different VLANs


What I'm doing wrong?


Thank you very much for your help !


Jud

Correct Answer by Chetan Kumar Ress about 7 years 1 month ago

Hi Aster


On L3 Switch you no need to do any configuration fo inter0vlan routing.


1] In L3 Switch you can issue command ip routing in global config mode to enable IPv4 routing.

2] Configure L2 vlan on switch & Configure L3 vlan with ip address & configure gateway on every host.

    ( Gateway would be router IP address of respective vlan)


Issue "show ip routing command" to see routing table in L3 Switch.


Below is sample config.


ip routing


vlan 1

ip add 192.168.1.1 255.255.255.0



vlan 200

ip add 192.168.2.1 255.255.255.0



vlan 300

ip add 192.168.3.1 255.255.255.0



Host in vlan 200 will use gateway ip address  of "192.168.2.1"



Regards

Chetan Kumar

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (3 ratings)
Loading.
Reza Sharifi Mon, 06/07/2010 - 05:30
User Badges:
  • Super Bronze, 10000 points or more
  • Cisco Designated VIP,

    2017 LAN

Hi Jud,




Yes, if you want your host to be in a different vlan/subnet then you need to change the IPs on your host to be in that spesific subnet.


but


Check to make sure you have configured correct default gateway on your hosts.


HTH

Reza

Correct Answer
Chetan Kumar Ress Mon, 06/07/2010 - 05:57
User Badges:
  • Silver, 250 points or more

Hi Aster


On L3 Switch you no need to do any configuration fo inter0vlan routing.


1] In L3 Switch you can issue command ip routing in global config mode to enable IPv4 routing.

2] Configure L2 vlan on switch & Configure L3 vlan with ip address & configure gateway on every host.

    ( Gateway would be router IP address of respective vlan)


Issue "show ip routing command" to see routing table in L3 Switch.


Below is sample config.


ip routing


vlan 1

ip add 192.168.1.1 255.255.255.0



vlan 200

ip add 192.168.2.1 255.255.255.0



vlan 300

ip add 192.168.3.1 255.255.255.0



Host in vlan 200 will use gateway ip address  of "192.168.2.1"



Regards

Chetan Kumar

JudAster2010 Mon, 06/07/2010 - 07:36
User Badges:

Thank you vrey much for the answers.


This is the output of the "show ip route" command:




3560#show ip route

Codes: C - connected, S - static, 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

       i - IS-IS, su - IS-IS summary, 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 192.168.155.1 to network 0.0.0.0


C    192.168.131.0/24 is directly connected, Vlan1

C    192.168.100.0/24 is directly connected, Vlan154

S*   0.0.0.0/0 [1/0] via 192.168.131.1

Chetan Kumar Ress Mon, 06/07/2010 - 07:49
User Badges:
  • Silver, 250 points or more

Hi


In you given output you can see ...


C    192.168.131.0/24 is directly connected, Vlan1

C    192.168.100.0/24 is directly connected, Vlan154


You have two network that can communicate i.e. VLAN 1 & VLAN 154 & rest of request will use default route.


The host in VLAN 1  should use gateway 192.168.131.254 ( Router IP Address  for VLAN 1)

The Host in VLAN 154 should use gateway 192.168.100.(IP of router )


Regards

Chetan Kumar

Actions

This Discussion