Switch>ena
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S1
S1(config)#banner motd %Unauthorized access prohibited%
S1(config)#ena pass cisco
S1(config)#ena secret class
S1(config)#line con 0
S1(config-line)#pass cisco
S1(config-line)#login
S1(config-line)#line vty 0 4
S1(config-line)#pass cisco
S1(config-line)#login
S1(config-line)#int vlan 1
S1(config-if)#ip add 192.168.1.1 255.255.255.0
S1(config-if)#no shu
%LINK-5-CHANGED: Interface Vlan1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
S1(config-if)#exit
S1(config)#ip default-gateway 192.168.1.2
S1(config)#int fa0/1
S1(config-if)#switchport mode acc
S1(config-if)#switchport mode access
S1(config-if)#switchport port-security
S1(config-if)#int fa1/1
S1(config-if)#speed 10
S1(config-if)#dup
S1(config-if)#duplex half
S1(config-if)#end