cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
727
Views
5
Helpful
3
Replies

VLan IP on 2960 Switch and 1921 Router

fbeye
Level 4
Level 4

Hello

 

I know I should know this... I was wondering how this works. 

My 1921 GE 0/0 has a 10.0.0.68 IP address from the Internet. The GE 0/1 is assigned 192.168.0.1 with a DHCP Server vlan 1.

 

My 2960 is connected to the GE 0/1 and have it set to be 192.168.0.68. I am to know that all 24 ports (as long as on vlan 1)with also grab a 192.168.0.X address automatically or manually if I specify.

 

My question is this, based on if I am right to this point, is if I create a vlan 2 how would that get its own subnet, such as 192.168.2.1. Is that done on the 2960 manually or would vlan 2 grab that subnet if the there is also a vlan 2 on the Router with that DHCP pool (192.168.2.x)

 

I am asking because in so many examples of vlan and switch config I am seeing that each vlan has its own subnet but WHERE is it getting that subnet cause the Switch configs aren’t showing ANY IP specifics being programmed other than the vlan activations themselves so I’m assuming a Switch VLAN will grab its relative IP subnet from the corresponding vlan on the router?

 

Any guidance  would be appreciated. 

1 Accepted Solution

Accepted Solutions

Hello,

 

you need to create a subinterface on the main interface that is connecting the router to the switch. The entire thing would look something like below:

 

Router

 

ip dhcp excluded-address 192.168.0.1
ip dhcp excluded-address 192.168.2.1
!
ip dhcp pool VLAN1
network 192.168.0.0 255.255.255.0
default-router 192.168.0.1
dns-server 8.8.8.8 8.8.4.4
!
ip dhcp pool VLAN2
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
dns-server 8.8.8.8 8.8.4.4
!
interface GigabitEthernet0/0
description Link to Internet
ip address 10.0.0.68 255.255.255.252
!
interface GigabitEthernet0/1
ip address 192.168.0.1 255.255.255.0
!
interface GigabitEthernet0/1.2
encapsulation dot1q 2
ip address 192.168.0.1 255.255.255.0

 

Switch

 

interface GigabitEthernet0/1
description Uplink to Router GigabitEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport mode access
switchport access vlan 2
spanning-tree portfast

 

View solution in original post

3 Replies 3

Hello,

 

you need to create a subinterface on the main interface that is connecting the router to the switch. The entire thing would look something like below:

 

Router

 

ip dhcp excluded-address 192.168.0.1
ip dhcp excluded-address 192.168.2.1
!
ip dhcp pool VLAN1
network 192.168.0.0 255.255.255.0
default-router 192.168.0.1
dns-server 8.8.8.8 8.8.4.4
!
ip dhcp pool VLAN2
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
dns-server 8.8.8.8 8.8.4.4
!
interface GigabitEthernet0/0
description Link to Internet
ip address 10.0.0.68 255.255.255.252
!
interface GigabitEthernet0/1
ip address 192.168.0.1 255.255.255.0
!
interface GigabitEthernet0/1.2
encapsulation dot1q 2
ip address 192.168.0.1 255.255.255.0

 

Switch

 

interface GigabitEthernet0/1
description Uplink to Router GigabitEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport mode access
switchport access vlan 2
spanning-tree portfast

 

Ahhh! I see exactly what you mean. That answered my question. I thank you. 

Just to verify, the last line of the Router config you posted ip address 192.168.0.1 255.255.255.0, Was that supposed to be ip address 192.168.2.1 255.255.255.0?

Review Cisco Networking for a $25 gift card