0% found this document useful (0 votes)
21 views5 pages

Vlan Config

The document provides a detailed guide on configuring VLANs, including creating VLANs, assigning IP addresses, and setting up trunking on switches. It also covers SSH login setup for routers and inter-VLAN routing using both Layer-2 and Layer-3 switches. Additionally, it includes commands for MAC binding and managing port security.

Uploaded by

devkush13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views5 pages

Vlan Config

The document provides a detailed guide on configuring VLANs, including creating VLANs, assigning IP addresses, and setting up trunking on switches. It also covers SSH login setup for routers and inter-VLAN routing using both Layer-2 and Layer-3 switches. Additionally, it includes commands for MAC binding and managing port security.

Uploaded by

devkush13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

VLAN Configuration

Switch>
Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname cyber
cyber(config)#vlan 10
cyber(config-vlan)#name acct
cyber(config-vlan)#exit
cyber(config)#vlan20
^
% Invalid input detected at '^' marker.

cyber(config)#vlan 20
cyber(config-vlan)#name qm
cyber(config-vlan)#exit
cyber(config)#int fa 0/1
cyber(config-if)#switchport mode access`
cyber(config-if)#switchport access vlan 10
cyber(config-if)#exit
cyber(config)#int fa 0/2
cyber(config-if)#switchport mode access
cyber(config-if)#switchport access vlan 20
cyber(config-if)#exit
cyber(config)#int vlan 10
cyber(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

cyber(config-if)#ip address 192.168.10.1 255.255.255.0


cyber(config-if)#no shutdown
cyber(config-if)#exit
cyber(config)#int vlan 20
cyber(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

cyber(config-if)#ip address 192.168.20.1 255.255.255.0


cyber(config-if)#no shutdown
cyber(config-if)#exit
cyber(config)#do wr
Building configuration...
[OK]
cyber(config)#

To add a computer to existing plan 20

cyber(config)#int fa 0/4
cyber(config-if)#switchport mode access
cyber(config-if)#switchport access vlan 20
cyber(config-if)#exit
cyber(config)#
cyber(config)#do wr
Building configuration...
[OK]
cyber(config)#
To select a range of ports in switch

cyber(config)#int range fa 0/1-2


cyber(config-if)#switchport mode access
cyber(config-if)#switchport access vlan 10
cyber(config-if)#exit

cyber(config)#int range fa 0/3-4


cyber(config-if)#switchport mode access
cyber(config-if)#switchport access vlan 20
cyber(config-if)#exit

VLAN Trunking

Switch>
Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#
Switch(config)#int fa 0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#
Switch(config)#int fa 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#
Switch(config)#int vlan 10
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

Switch(config-if)#ip address 192.168.10.1 255.255.255.0


Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#int vlan 20
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

Switch(config-if)#ip address 192.168.20.1 255.255.255.0


Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#
Switch(config)#int fa 0/3
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up

Switch(config-if)#exit
Switch(config)#do wr
Building configuration...
[OK]
Switch(config)#
MAC Binding of a port in switch

Switch>
Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int fa 0/x
Switch(config-if)#switchport mode access
Switch(config-if)#switchport port-security
Switch(config-if)#switchport port-security maximum 1
Switch(config-if)#switchport port-security mac-address 00E0.F954.B784
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#do wr
Building configuration...
[OK]
Switch(config)#

SSH Login in Router

Router>
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface gigabitEthernet 0/0/0
Router(config-if)#ip address 192.168.10.1 255.255.255.0
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to up

Router(config-if)#exit
Router(config)#
R1(config)#hostname R1
R1(config)#ip domain-name abc
R1(config)#line vty 0 4
R1(config-line)#login local
R1(config-line)#transport input ssh
R1(config-line)#exit
R1(config)#crypto key generate rsa

The name for the keys will be: r1.abc


Choose the size of the key modulus in the range of 360 to 2048 for your
General Purpose Keys. Choosing a key modulus greater than 512 may take
a few minutes.

How many bits in the modulus [512]: 1024


% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

R1(config)#use
*Mar 1 0:3:43.112: %SSH-5-ENABLED: SSH 1.99 has been enabled
R1(config)#username cyber password cyber123
R1(config)#enable password admin
R1(config)#do wr
Building configuration...
[OK]
R1(config)#
Inter-VLAN Routing using Layer-3 Switch

Switch>
Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#int gigabitEthernet 1/0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#
Switch(config)#int gigabitEthernet 1/0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#
Switch(config)#int vlan 10
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

Switch(config-if)#ip address 192.168.10.1 255.255.255.0


Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#
Switch(config)#int vlan 20
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

Switch(config-if)#ip address 192.168.20.1 255.255.255.0


Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#ip routing
Switch(config)#do wr
Building configuration...
Compressed configuration from 7383 bytes to 3601 bytes[OK]
[OK]
Switch(config)#
Inter-VLAN Routing using L-2 and L-3 switch
Switch>
Switch>en
Switch#
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname L2
L2(config)#vlan 10
L2(config-vlan)#exit
L2(config)#vlan 20
L2(config-vlan)#exit
L2(config)#
L2(config)#int fa 0/1
L2(config-if)#switchport mode access
L2(config-if)#switchport access vlan 10
L2(config-if)#exit
L2(config)#int fa 0/2
L2(config-if)#switchport mode access
L2(config-if)#switchport access vlan 20
L2(config-if)#exit
L2(config)#int fa 0/3
L2(config-if)#switchport mode trunk
L2(config-if)#exit
L2(config)#
L2(config)#do wr
Building configuration...
[OK]
Switch(config)#

Switch>en
Switch#
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
Switch(config)#hostname L3
Switch(config)#ip routing
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#interface gigabitEthernet 1/0/1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#exit
Switch(config)#
Switch(config)#int vlan 10
Switch(config-if)#ip address 192.168.10.1 255.255.255.0
Switch(config-if)#exit
Switch(config)#
Switch(config)#int vlan 20
Switch(config-if)#ip address 192.168.20.1 255.255.255.0
Switch(config-if)#exit
Switch(config)#
Switch(config)#do wr
Building configuration...
Compressed configuration from 7383 bytes to 3601 bytes[OK]
[OK]
Switch(config)#

You might also like