cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1047
Views
0
Helpful
4
Replies

Router and Switch communicating with Different Vlans

Cisco10956
Level 1
Level 1

Unfortunately I don’t have a router configuration to show everyone because that’s what I would like the kind people on this site to send to me one.

 

I have a dhcp scope on my Windows 2019 server and its going to give the following computers these addresses. And these are the switches and vlan’s they are connected into.

Desktop 1     -  VLAN 2 – SWITCH 1

192.168.2.5 

Desktop 2     -  VLAN 3 – SWITCH 2

192.168.3.6

 

Router is connected to switch 1. Also switch 1 is connected to switch 2.

 

The problem:

Desktop 1 can’t communicate with Desktop 2 and vis versa.

 

What is the configuration of the router and switches going to look like. ??

1 Accepted Solution

Accepted Solutions

Hello @Cisco10956 ,

I have made some assumptions on how the different network devices are connected .

 

>> But I must say, you are not answering the question as posted. Yes I do realize and understand what the previous person answered as correct.

 

Yes because you haven't provided the level of detail.

There is one point I have missed and it is how to deliver DHCP addresses on multiple subnets.

Let us suppose the DHCP server has IP address 192.168.2.10

 

All hosts in Vlan 2 can get an IP address directly from the DHCP server that is able to listen to their DHCP requests that are sent as broadcasts.

What happens for hosts in VLAN 3 ?

They send out DHCP request as non routable broadcast frames.

 

The router can help on this translating the 255.255.255.255 destination to server address 192.168.2.10

All you need is to use the ip helper-address feature

 

int gi0/0.3

enc dot1q 3

ip address 192.168.3.1 255.255.255.0

ip helper-address 192.168.2.10

 

This feature has made the use of centralized DHCP servers possible in enteprise networks.

In preparing the packet to be sent to the server the gi address field is populated with 192.168.3.1 so that the DHCP server is able to pick the right DHCP pool and to choice a free address in that pool for the answer that is sent to 192.168.3.1.

Then the router sends as a broadcast or unicast to the client the DHCP offer and this allows hosts in vlan 3 to be able to get an IP address.

 

Hope to help

Giuseppe

 

View solution in original post

4 Replies 4

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @Cisco10956 ,

you have already a good example of configuration provided by Paul Driver in your other thread

 

we make the following assumption inter VLAN routing is made by the router using the so called Router on a stick ROAS

 

the router connects to switch1: port gi0/1

 

switch 1:  needs to have defined both VLANs 2 and 3

 

vlan 2

name DATA2

exit

vlan 3

name DATA3

 

 

int gi0/1

desc to Router gi0/0

switchport

switchport mode trunk

 

 

on router side

int gi0/0

desc to switch1:g0/1

no ip address

int gi0/0.2

enc dot1q 2

ip address 192.168.2.1 255.255.255.0

int gi0/0.3

enc dot1q 3

ip address 192.168.3.1 255.255.255.0

 

 

switch1 gi0/24 connects to switch 2 gi0/24 both interfaces are configured as trunk carrying all VLANs

 

int gi0/24

desc to switch2:gi0/24

switchport

switchport mode trunk

 

on switch1 we use port gi0/5 to connect DEsktop1

 

int gi0/5

descr  to desktop 1

switchport

switchport mode access

switchport access  vlan 2

 

on switch 2

You need to be sure that Vlan 2 and Vlan 3 exists

so after connecting gi0/24 to gi0/24 wait a few minutes then issue

 

show vlan and see if vlan 2 and 3 appear

 

if they do not create them locally

conf t

vlan 2

name DATA2

vlan 3

name DATA3

 

int gi0/5

descr  to desktop 2

switchport

switchport mode access

switchport access  vlan 3

 

Edit:

to have and end to end communication correct default gateways have to be set on desktop 1 it must be 192.168.2.1 on desktop2 must be 192.168.3.1.

 

Hope to help

Giuseppe

 

Hello Giuseppe - I am also Joseph

But I must say, you are not answering the question as posted. Yes I do realize and understand what the previous person answered as correct.

I didn't give enough of a description in the first post, that's why I thought it would help give more information in this one.

Thanks

Hello @Cisco10956 ,

I have made some assumptions on how the different network devices are connected .

 

>> But I must say, you are not answering the question as posted. Yes I do realize and understand what the previous person answered as correct.

 

Yes because you haven't provided the level of detail.

There is one point I have missed and it is how to deliver DHCP addresses on multiple subnets.

Let us suppose the DHCP server has IP address 192.168.2.10

 

All hosts in Vlan 2 can get an IP address directly from the DHCP server that is able to listen to their DHCP requests that are sent as broadcasts.

What happens for hosts in VLAN 3 ?

They send out DHCP request as non routable broadcast frames.

 

The router can help on this translating the 255.255.255.255 destination to server address 192.168.2.10

All you need is to use the ip helper-address feature

 

int gi0/0.3

enc dot1q 3

ip address 192.168.3.1 255.255.255.0

ip helper-address 192.168.2.10

 

This feature has made the use of centralized DHCP servers possible in enteprise networks.

In preparing the packet to be sent to the server the gi address field is populated with 192.168.3.1 so that the DHCP server is able to pick the right DHCP pool and to choice a free address in that pool for the answer that is sent to 192.168.3.1.

Then the router sends as a broadcast or unicast to the client the DHCP offer and this allows hosts in vlan 3 to be able to get an IP address.

 

Hope to help

Giuseppe

 

balaji.bandi
Hall of Fame
Hall of Fame

PC ---Switch 2---Switch 1--Router

 

if this is the Config

 

Switch 2 should have access VLAN configured to port VLAN3 (if this acting as layer 2)

Switch2- Switch1 should have a trunk port that allowed VLAN 2 and 3 on your case.

 

Switch 1 to Router ( should be Trunk port)  - if the switch 1 also acting as Layer 2 device

 

The router should have  dot1q sub-interface which have vlan2 and Vlan 3 IP address

 

router config looks like below :

 

interface gigabitethernet0/1
no ip address
!
interface gigabitethernet0/1.2
encapsulation dot1q 2 native
ip address 192.168.2.1 255.255.255.0

!

interface gigabitethernet0/1.3
encapsulation dot1q 3
ip address 192.168.3.1 255.255.255.0

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help