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

how assign a 2 vlans in cisco 2960 switch

MSKUMAR
Level 1
Level 1

hi, 

 

I need to create 2 vlans 192.168.25.1 and 192.168,26,1 

ans assign these vlan to the switch port port 1 and port 3 

I'm using CISCO 2960 Catlyst. 

 

Pls. guide the commands thru console . 

 

 

 

4 Replies 4

Hello

ypu dont say if you need to allow communication between the two subnet so I will assume you do

 

Config t

ip routing

 

int vlan 25

IP address 192.168.25.1 255.255.255.0

ip route-cache 

exit

 

 

int vlan 26

IP address 192.168.26.1 255.255.255.0

ip route-cache 

exit

 

 

int x/x 1

description access-port 1

switchport host

no shut

switchport access vlan 25

exit

 

 

int x/x 3

description access-port 3

switchport host

no shut

switchport access vlan 26

end

 

wr

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Please breaf : int x/x 1

Hello,

 

below is a sample. IP routing has been enabled, if you use a router linked to the switch to do the routing, you need to configure a trunk link to the router and create subinterfaces (Router-on-a-stick)...

 

ip routing
!
interface GigabitEthernet1/0/1
switchport mode access
switchport access vlan 2
spanning-tree portfast
!
interface GigabitEthernet1/0/2
switchport mode access
switchport access vlan 3
spanning-tree portfast
!
interface Vlan2
ip address 192.168.25.1 255.255.255.0
!
interface Vlan3
ip address 192.168.26.1 255.255.255.0

You can also name the vlan

Example:

vlan 2

name data

 

vlan 3

name voice

Review Cisco Networking for a $25 gift card