Thursday, June 18, 2015

VLAN Configuration Commands




Topics:
  • Default VLAN (vlan 1)
  • Data VLAN (vlan 5, 10)
  • Management VLAN (vlan 99)
  • Voice VLAN (vlan 150)
----------------------------------------------------
Step 1: Create VLANs in the Switch (both switch)
Switch(config)#vlan 5
Switch(config-vlan)#name EEE

Switch(config)#vlan 10
Switch(config-vlan)#name CSE

Switch(config)#vlan 99
Switch(config-vlan)#name Management




Step 2: Assign ports to VLANs
Switch(config)#interface fa0/5
                   #switchport mode access
                   #switchport access vlan 5
                   #exit
 Switch(config)#interface fa0/10
                   #switchport mode access
                   #switchport access vlan 10
                   #exit
 Switch(config)#interface fa0/20
                   #switchport mode access
                   #switchport access vlan 99
                   #exit

Step 3: Assign IP address to Management VLAN and configure Telnet
Switch(config)#interface vlan 99
                   #ip address 10.10.99.2 255.255.255.0 
                   #no shutdown 
Switch(config)#line vty 0 15
                   #password 12345
                   #login
                   #exit
 Switch(config)#enable password 67890

Step 4:  Trunk Configuration (both swith)
Switch(config)#interface fa0/1
                   #switchport mode trunk
                   #switchport trunk allowed vlan 1-99

Step 5:  Router on a stick
Router(config)#int fa0/0.5
                   #encapsulation dot1q 5
                   #ip address 10.10.5.254 255.255.255.0
Router(config)#int fa0/0.10
                   #encapsulation dot1q 10
                   #ip address 10.10.5.254 255.255.255.0
Router(config)#int fa0/0.99
                   #encapsulation dot1q 99
                   #ip address 10.10.99.254 255.255.255.0
Router(config)#int fa0/0.150
                   #encapsulation dot1q 150
                   #ip address 10.10.5.254 255.255.255.0

Router(config)#int fa0/0
                   #no shutdown

All PCs should be able to communicate with each other at this point.

Step 6: VOIP
Add two IP Phones to the switch (fa0/21 and fa0/24)

Switch(config)#vlan 150
Switch(config-vlan)#name VoIP

Switch(config)#interface fa0/21
                      #switchport mode access 
                      #switchport voice vlan 150  

Switch(config)#interface fa0/24
                      #switchport mode access
                      #switchport voice vlan 150  

- (Go to Router now)-

Router(config)#ip dhcp pool VOIP
                     #network 10.10.150.0 255.255.255.0
                     #default-router 10.10.150.254
                     #option 150 ip 10.10.150.254

[Telephony Service for VoIP:  All Router models do not support this feature. Use 2811]

Router(config)#telephony-service                              
                   #max-ephones 10
                   #max-dn 10
                   #ip source-address 10.10.150.254 port 2000
                   #auto assign 1 to 10

Router(config)#ephone-dn 1
                   #number 2441139

Router(config)#ephone-dn 2
                   #number 2441140

-------------------Finish--------------------------

Now go to your IP phones and call a number!


No comments:

Post a Comment