cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1891
Views
0
Helpful
12
Replies

Vlans, subnets or subinterfaces

Malling
Level 1
Level 1

Hello.

 

I'm confused if it is possible to have 2 vlans on the same network where each vlan has multiple static ip addresses on 1 switch that Is connected to a router.

 

My setup:

 

Vlan 2 range 172.16.1.2-172.16.1.62 /26 |

Vlan 3 range 172.16.1.66-172.16.1.126 /26 |

 

Trunkport from switch to router that connects both vlans to the way internet.

 

I'm confused if I should create the ip addresses for each vlan on the switch or create subinterfaces from the router. I seem to be getting error when assigning more than one vlan ip address to the router interface.

 

Hope to get some inspiration and guiding.

 

I linked a pdf file to show how I want my setup. It's not 100p done because I haven't got the final topology on this computer.

 

/Malling

1 Accepted Solution

Accepted Solutions

Francesco Molino
VIP Alumni
VIP Alumni

Hi

 

Based on your design, you can create SVI (interface vlan Layer3) on switch or on the router.

In you create them on the switch, you'll need to define an interco subnet between the switch and router for routing purpose.

If you create them on the router, you have to create a trunk on the switch to the router and create subinterfaces ion the router for each vlan.

 

Your 2 subnets are /26 then you should be able to create the 2 SVI on the switch on 2 subinterfaces on the router.

 

Is that clear or tell me at which step you're stuck.

 


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

View solution in original post

12 Replies 12

Francesco Molino
VIP Alumni
VIP Alumni

Hi

 

Based on your design, you can create SVI (interface vlan Layer3) on switch or on the router.

In you create them on the switch, you'll need to define an interco subnet between the switch and router for routing purpose.

If you create them on the router, you have to create a trunk on the switch to the router and create subinterfaces ion the router for each vlan.

 

Your 2 subnets are /26 then you should be able to create the 2 SVI on the switch on 2 subinterfaces on the router.

 

Is that clear or tell me at which step you're stuck.

 


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

Yes I also wanted to make the trunk port because the switch is only layer 2.

I tried making the trunk port from switch to router but when I assigned a subinterface for vlan 2 and vlan3 I got a overwrite error.
I have to assign 3 static ip addresses on vlan 2. I did.

Vlan 2 --> interface fa0/1.2 -->ip address 172.16.1.1

Vlan 3 --> interface fa0/1.3 -->ip address 172.16.1.65

But here I got a 802.11Q error saying that the interface was already used.

Is this something you can relate to? I haven't the error code available now because I'm at some friends.

I can post more information tonight when I am home again including all my coding step by step in a file.

/Malling

Can you give us the command you're entering?
If you are configuring these interfaces with /26 mask it should work. the mask should be 255.255.255.192.


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

I upload a file with all my coding progress for switch and router when I get home.

I'm curious if the ip address I give the subinterfaces is where the vlan starts giving out ip addresses or if I have to do it for each static ip address I have on the vlan.

 

I am at home in a few hours.

 

/Malling

Hello again.

 

When i came home i tried to sit down and do it all over again from scratch and now i didn't get the error, and i can ping from Vlan 2 to vlan 3.

 

So now its for some wierd reason working :D

i think it might be because i assigned the default gateway ip addresses for each vlan on the switch and then tried to do subinterface on the router afterwards.

 

sorry for wasting your time!

 

now i just need a server with DHCP on vlan 3 and a management vlan. Is native vlan necessary?

Im sooo happy that it finally works!

I think i just got more confused by working with it again and again for hours, and a break would fix it!

 

I mark your answer as a solution :)

 

/Malling

Hi

No need of native vlan. vlan 2 is your management vlan?
Then install a DHCP sever (if you don't want to do dhcp on your router) and assign it and IP in what ever vlan you want. Afterwards, on your subinterfaces, you just need to do ip helper x.x.x.x which corresponds to your server IP

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

I think i create a vlan 10 for management and assign a ip on the switch. I want to connect a AccessPoint for my private network only, so vlan 2 shouldn't have wifi. Then i also connect a server on my vlan 3 where both vlans can connect to for filestorage. I use Windows 2012 IOS on the server and make it a DHCP server too.

That should work right?

then only the AccessPoint on vlan 3 gets IP addresses from the Server on vlan 3 and the vlan 2 clients cant get ip addreses from the server.

 

/Malling

Sorry I didn't understand what you said.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

I add a AccessPoint for wifi and a server for DHCP to vlan 3, so the Accesspoint gets ip addresses from the server and not the router. Then the PC's on vlan 2 won't be able to get ip addresses from the server because it's not on the same vlan and the server can still be accessed from both vlans.

 

Isn't that right?

 

/malling

Yes PC on vlan 2 can get IP from the DHCP server if you configured the subnet correctly on the serveur and if you added ip helper-address under SVI vlan 2

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

well... i wanted to make it so the PC's on vlan 2 couldn't get ip addresses from the server on vlan 3

If you don't want PC2 getting an IP from your dhcp server on vlan 3 then you can just remove ip helper command from vla 2 and also add an acl to filter access from vlan 2 to vlan 3 server ip.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question
Review Cisco Networking for a $25 gift card