Router or Switch basic command

Disable DNS lookup: no ip domain lookup
Router name R1: hostname R1
Domain name: ip domain-name ccna-lab.com
Encrypted privileged EXEC password: enable secret class
Console access password: line console 0
password cisco
login

VTY access password: line vty 0 15
password cisco
login
Set the minimum length for passwords (10 characters):
security passwords min-length 10
Create an administrative user in the local database:
username admin secret admin1pass
Set login on VTY: line vty 0 15
login local
Set VTY lines to accespt SSH: transport input ssh
exit
Encrypt the clear text passwords: service password-encryption
Configure an MOTD Banner: banner motd  # Unauthorized Access is Prohibited #

Generate an RSA crypto key:
crypto key generate rsa

1024
Enable IPv6 Routing: ipv6 unicast-routing

 

Create the new VLAN

S1(config)# vlan 10
S1(config)# name Sales
S1(config)# interface vlan 10
S1(config-if)# ip address 192.168.1.2 255.255.255.0
S1(config-if)# no shutdown
S1(config-if)# exit
S1(config)# ip default-gateway 192.168.1.1

Assign Port for VLAN.
S1(config)# interface range f0/1 – 6
S1(config-if-range)# switchport mode access
S1(config-if-range)# switchport access vlan 10
S1(config-if-range)# exit

Trunk port for VLAN.
int g0/2
switchport mode trunk
switchport nonegotiate
switchport trunk allowed vlan 10
exit

Shutdown unused port for VLAN.
int range fa0/1-5, fa0/12-17, fa0/19-24,g0/1
shutdown

Switchport Security.

int fa0/6
switchport mode access
switchport port-security maximum 2
switchport port-security mac-address sticky
switchport port-security violation restrict

Router on Stick-mode Configuration.

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1

R1(config)#int g0/0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 172.17.10.1 255.255.255.0
R1(config-subif)#exit

R1(config)#int g0/0/0.30
R1(config-subif)#encapsulation dot1Q 30
R1(config-subif)#ip address 172.17.30.1 255.255.255.0
R1(config-subif)#exit

R1(config)#int g0/0/0
R1(config-if)#no shut
R1(config)#exit
R1#sh ip int brief