Security in Computing Pratical - Compressed
Security in Computing Pratical - Compressed
Configure Routers
PROCESS:
5. NTP Server,
6. SYSLOG Server
7. In Router 0,
8. In Router 1
9. Now we have to configure OSPF MD5 Authentication.
In Router 0,CLI:
1. Exit
2. enable
3. router ospf 1
4. network 192.168.1.0 0.255.255.255 area 1
5. network 192.168.2.0 0.255.255.255 area 1
6. exit
In Router 1,CLI:
1. ping 192.168.1.2
2. ping 192.168.1.3
If the packets are Transferred that means OSPF is enabled.
Type Commands:
1. enable
2. conf
3. interface GigabitEthernet 0/1
4. ip ospf authentication message-digest
5. ip ospf message-digest-key 1 md5 smile
6. exit
7. Exit.
In Router 1,
All Commands are the same as above.
This is Output for this Practical it means we have configured OSPF MD5
Authentication.
b) NTP
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ntp server 192.168.1.3
Router(config)#ntp up
Router(config)#ntp update-calendar
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#show clock
*0:23:41.789 UTC Mon Mar 1 1993
Router#show clock
19:10:42.287 UTC Tue Apr 23 2024
c) SYSLOG
Now Go to CLI Mode of any Router and type the following commands in all the
Routers.
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#logging 192.168.1.2
Router(config)#exit
Router#
d) SSH
● An SSH server is a software program which uses the secure
shell protocol to accept connections from remote computers.
● The way SSH works is by making use of a client-server model to
allow for authentication of two remote systems and encryption
of the data that passes between them.
Now Go to CLI Mode of both the routers and type the following commands.
Router#
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip domain-name ismail.com
Router(config)#hostname R1
R1(config)#crypto key generate rsa
The name for the keys will be: R1.ismail.com
Choose the size of the key modulus in the range of 360 to 4096 for your
General Purpose Keys. Choosing a key modulus greater than 512 may
take
a few minutes.
How many bits in the modulus [512]: 512
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]
R1(config)#line vty 0 4
*Apr 23 19:22:43.332: RSA key size needs to be at least 768 bits for ssh
version 2
*Apr 23 19:22:43.337: %SSH-5-ENABLED: SSH 1.5 has been enabled
R1(config-line)#transport input ssh
R1(config-line)#login local
R1(config-line)#exit
R1(config)#username ismail privilege 15 password cisco
R1(config)#
Output:
Router(config)#conf t
%Invalid hex value
Router(config)#aaa new-model
Router(config)#tacacs-server host 192.168.2.3 key CISCO
Router(config)#radius-server host 192.168.2.2 key CISCO
Router(config)#aaa authentication login tyit group tacacs+ group radius
local
Router(config)#line vty 0 4
Router(config-line)#login authentication tyit
Router(config-line)#exit
Router(config)#
After performing all these steps. Go to both PC’s CMD and do necessary
configurations.
EXPLANATION:
The Cisco Access Control List (ACL) are used for filtering traffic based
on a given filtering criteria on a router or switch interface. Based on the
conditions supplied by the ACL, a packet is allowed or blocked from
further movement. Cisco ACLs are available for several types of routed
protocols including IP, IPX, AppleTalk, XNS, DECnet, and others.
However, we will be discussing ACLs pertaining to TCP/IP protocol only.
ACLs for TCP/IP traffic filtering are primarily divided into two types:
Standard Access Lists, and Extended Access Lists
Topology:
Configuring PC1
Configuring PC2
Configuring Router1
Configuring Router0
Configuring Server0
Configuring Server1
Router#configure terminal
Router(config)# Router(config)#access-list 100 permit tcp host 192.168.3.2
host 192.168.1.2 eq ftp Router(config)#interface GigabitEthernet0/1
Router(config-if)#ip access-group 100 out Router(config-if)#exit
Router(config)#
Now verify the ftp (ftp 192.168.1.2) command from both the PCs, one would be
successful (PC1) and other (PC0) would fail
Part 2: Configure, Apply and Verify an Extended Named ACL We use the same
topology for this case Type the following command in the CLI mode of Router1
Router> Router>en Router#configure terminal
Router(config)#ip access-list extended SMILE
Router(config-ext-nacl)#permit tcp host 192.168.3.3 host 192.168.1.3 eq www
Router(config-ext-nacl)#exit
Router(config)#
Router(config)#interface GigabitEthernet0/1
Router(config-if)#ip access-group SMILE out
Router(config-if)#exit
Router(config)#
Now verify the www (192.168.1.3) command from both the PCs browser, one
would be successful (PC0) and other (PC1) would fail
Hence Extended Numbered ACLs as well as Extended Named ACLs have been
verified
PRACTICAL 4
SOLUTION:
TOPOLOGY:
Configuring PC0:
Configuring Server0
Configuring Router0
Configuring Router1
Configuring Router2
Set the RIP on each Router
Part 1: Verify Basic Connectivity
We can now verify the connectivity by pinging Server from PC
Part a) Set up the SSH protocol Enter the following commands in CLI mode of
all Routers
Router>enable
Router#configure terminal
Router(config)#ip domain-name ismail.com
Router(config)#hostname R0
R0(config)#
R0(config)#crypto key generate rsa
R0(config)#line vty 0 4
R0(config-line)#transport input ssh
R0(config-line)#login local
R0(config-line)#exit
R0(config)#username SSHadmin privilege 15 password ismail
R0(config)#exit
R0#
Router>enable
Router#configure terminal
Router(config)#access-list 10 permit host 192.168.4.2
Router(config)#line vty 0 4
Router(config-line)#access-class 10 in
Now we verify the remote access from PC using the following and find it to be
successful
Configuring PC0
Configuring Router1
Configuring Router2
Configuring Server0
Part 1: Static Routing Static Routing is done using the following procedure for
each Router Router 2: Add the following Routes in the Static mode
Router 1: Add the following Routes in the Static mode
Solution:
Configuring PC1:
Configuring Server0:
Configuring Router0:
Configuring Router1
We need to set the Routing table in all the Routers so that each node
could send and receive packets from others (RIP is set in all the Routers
as follows)
Now we can check the connectivity by sending ping commands from
any node to any other node
Router>enable
Router#
Router#show version
We will get a message informing whether the security package is
enabled or not
Router#
Router#
Router#clock set 11:47:56 MARCH 3 2020
Router#mkdir smile
Router#configure terminal
Router(config)#ip ips config location flash:smile
Router(config)#ip ips name iosips
Router(config)#ip ips notify log
Router(config)#ip ips signature-category
Router(config-ips-category)#category all
Router(config-ips-category-action)#retired true
Router(config-ips-category-action)#exit
Router(config-ips-category)#category ios_ips basic
Router(config-ips-category-action)#retired false
Router(config-ips-category-action)#exit
Router(config-ips-category)#exit
Router(config)#interface Serial0/1/0
Router(config-if)#ip ips iosips out
Router(config-if)#
Router(config)#
PC1 to SERVER
SERVER to PC1
Also we can observe the Syslog service in the SERVER to check the log
activities
PRACTICAL 7
7. Layer 2 Security
a. Assign the Central switch as the root bridge.
b Secure spanning-tree parameters to prevent STP manipulation attacks.
c Enable port security to prevent CAM table overflow attacks.
Topology:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#show spanning-tree
^
% Invalid input detected at '^' marker.
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#show spanning-tree
Switch1: CLI
Switch#erase startup-config
Confirm
Switch#en
Switch#show spanning-tree
Multilayer Switch0:
Switch#
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#spanning-tree vlan1 root primary
^
% Invalid input detected at '^' marker.
Switch A Configuration
CLI:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface range fastEthernet 0/1-2
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a
single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/1 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a
single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/2 but will only
have effect when the interface is in a non-trunking mode.
Switch(config-if-range)#spanning-tree bpduguard enable
Switch(config-if-range)#
Switch1:
CLI:
Switch>EN
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface range fastEthernet 0/23-24
Switch(config-if-range)#spanning-tree guard root
Switch(config-if-range)#
Switch A : CLI
Switch#show port-security
Switch#show port-security interface f0/1
Configuring PC1
Configuring PC2
Configuring Router0
Configuring Router1
Configuring Router2
Part 1: Configuring RIP on each Router
Router>enable
Router#configure terminal
Router(config)#license boot module c1900 technology-package securityk9
Router(config)#do write
Router(config)#exit
Router#reload
Router>
Router>enable
Now we need to check if the security package is enabled, so we type the following
command
Router#show version
The above shows that the security package has been enabled
Router#configure terminal
Router(config)#access-list 110 permit ip 92.168.1.0 0.0.0.255 192.168.4.0
0.0.0.255
Router(config)#crypto isakmp policy 10
Router(config-isakmp)#encryption aes 256
Router(config-isakmp)#authentication pre-share
Router(config-isakmp)#group 5
Router(config-isakmp)#exit
Router(config)#crypto isakmp key smile1234 address 192.168.3.2
Router(config)#crypto ipsec transform-set vpn-set esp-aes esp-sha-hmac
Router(config)#crypto map vpn-map 10 ipsec-isakmp
Router(config-crypto-map)#set peer 192.168.3.2
Router(config-crypto-map)#set transform-set vpn-set
Router(config-crypto-map)#match address 110
Router(config-crypto-map)#exit
Router(config)#
Router(config)#interface Serial0/1/0
Router(config-if)#crypto map vpn-map
Router(config-if)#exit
Router(config)#
Router>enable
Router#configure terminal
Router(config)#license boot module c1900 technology-package securityk9
Router(config)#do write
Router(config)#exit
Router#reload
Router>
Router>enable
Now we need to check if the security package is enabled, so we type the following
command
Router#show version
The above shows that the security package has been enabled
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#access-list 110 permit ip 192.168.4.0 0.0.0.255 192.168.1.0 0.0.0.255
Router(config)#crypto isakmp policy 10
Router(config-isakmp)#encryption aes 256
Router(config-isakmp)#authentication pre-share
Router(config-isakmp)#group 5
Router(config-isakmp)#exit
Router(config)#crypto isakmp key smile1234 address 192.168.2.1
Router(config)#crypto ipsec transform-set vpn-set esp-aes esp-sha-hmac
Router(config)#crypto map vpn-set 10 ipsec-isakmp
Router(config-crypto-map)#description vpn
Router(config-crypto-map)#set peer 192.168.2.1
Router(config-crypto-map)#set transform-set vpn-set
Router(config-crypto-map)#match address 110
Router(config-crypto-map)#exit
Router(config)#
Router(config)#interface Serial0/1/1
Router(config-if)#crypto map vpn-set
Router(config-if)#
Part 4: Verify the IPSec VPN
We get the following output (No packets are encrypted given in bold)
interface: Serial0/1/0
Crypto map tag: vpn-map, local addr 192.168.2.1
We get the following output, as seen the number of packets encrypted is not zero
(marked bold)
interface: Serial0/1/0
Crypto map tag: vpn-map, local addr 192.168.2.1
inbound ah sas:
outbound ah sas:
We get the following output, as seen the number of packets encrypted is not zero
(marked bold)
interface: Serial0/1/0
Crypto map tag: vpn-map, local addr 192.168.2.1
inbound ah sas:
We get the following output, as seen the number of encrypted packets do not
change as compared to previous case
interface: Serial0/1/0
Crypto map tag: vpn-map, local addr 192.168.2.1
inbound ah sas:
outbound ah sas: