cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
368
Views
0
Helpful
1
Replies

2 separated networks from 1 switch that needs internet access too.

Malling
Level 1
Level 1

Hello forum.

 

I want to make a network for my private house and my company. both are in same building.

I only have 1 switch and i want to make two separated networks that connects to it. Lets call the private house "Section A" and my company area "Section B". So i have a /26 subnet on both Section A and B. They are on 2 different Vlans, because they are connected to the same switch. 

A few things confuses me.

 

1. When i have two Vlans, should i then also have 2 default gateways from the switch leading to the router for internet access? or should it just be the ip that the router is sending to the switch?

 

2. Do i need a trunkport connecting from router to switch, to send the two vlans to the router?

 

3. In the future i might want to add a towerServer, that has to be connectable from both Vlans (Section A and B), but the router should make this possible right?

 

im using a layer 2 switch.

 

I hope to get some help because i think i have confused myself even by by thinking about all this over and over.

 

/malling

1 Reply 1

Reza Sharifi
Hall of Fame
Hall of Fame

Hi,

Since the switch is layer-2 only then all you need is to create 2 vlans on the switch and assign the proper ports to each vlan that is facing the end devices. You also need to trunk the uplink port to the router and add both vlans to it.

example: 

switch

config t

vlan 10 

name if section-a

exit

interface g1/1

switchport mode access

 switchport access vlan 10

and so on..

vlan 20 

name if section-b

exit

interface g1/2

switchport mode access

 switchport access vlan 20

and so on..

now say port g1/24 is the one connecting to the router.  You need to make that a trunk port and add both vlan 10 and 20 to it

config t

inter g1/24

 switchport mode trunk

 switchport trunk allowed vlan 10,20

exit

and on the router, you need 2 subnets, one for each vlan.

HTH