Internetworks offers a comprehensive collection of articles and tutorials on computer networks, covering basic to advanced concepts such as data link layer, network layer, network security, and more. It’s a great starting point for beginners and a useful reference for advanced learners. A+ N+ CCNA CCNP CCIE
by Edgar C Francis
As we already know switches are very important network devices and with the help of switches we connect and maintain communication channels between various devices. we also know ethernet ports are present on our switches and with these ports, we connect our devices like routers computers, and other devices. switches identify the devices by their MAC addresses and provide the services. the important thing is we need to secure these ethernet ports so that authorized users are able to connect network securely.
here we can use the security feature of Cisco IOS Port-security to block the ethernet, fast ethernet, or Gig ports when the MAC address is different from the specified MAC on the port. we can use port security to filter traffic that is destined to or received from a specific host that is based on the host MAC address. These security features only be configured on access ports and by default this feature is disabled.
before we start our lab and come to the direct point, what I always do but before we need to understand these points.
Aging
mac-address
maximum
violation
Aging is when we configure the maximum number of MAC addresses on the particular port, we can also configure aging with the help of aging we specify how long the address on the port is secure,
once the time is expired, the MAC address on that port will be insecure, by default all addresses on a port are secured permanently. <1-1440> Aging time in minutes. Enter a value between 1 and 1440.
MAC address_ when we configure the specific MAC address in the port security command, only that device will be authorized by the switch to connect through the available port. this is also called a static mac address.
from the above output, we can see after the? mark. now have (H.H.H means configure static MAC address) and the second mode is (sticky) let's take a look at sticky.
Sticky before we understand what is sticky mode first, we must know, we have two configuration options for example
whenever we enable sticky learning on an interface, the interface converts all the dynamic secure MAC addresses, and also those that were dynamically learned before sticky learning was enabled, to sticky secure MAC addresses and adds all sticky secure MAC addresses to the running configuration. all newly on-boarded clients are considered sticky MACs.
now we know that the switch can learn MAC addresses on a secure port in one of three ways.
1. Manually the admin can manually configure a static MAC address. using the command
2. Dynamically when we configure the command switchport port-security, whatever the current source MAC address on that port device will be secured but not added in running-config. if we reboot the switch the port has to re-learn the MAC address.
switchport port-security
3. Dynamically-Sticky the admin can enable the switch to learn MAC address dynamically and stick them in running-config.
switchport port-security mac-address sticky
Maximum as per our requirements we can increase the limit of the number of hosts which is associated with the interface. by default, only 1 MAC address is allowed by the cisco switch on a single port. if other devices try to connect using this port our switch shutdown the port automatically. we can set this limit from 1 to 132. the maximum number is 132.
Now we have the last modeviolation
Violation_ when the MAC address of a connected device to a port is different from the list of secure addresses we are given on the interface, then a port violation occurs and the port enters the error-disable state. In violation, we have three modes. as you can see in the picture below.
Protect_ under the Protect mode the data packets from the configured MAC addresses are only transferred within the network. this mode is the least secure of the security violation mode. the port dropped the packets with unknown MAC addresses until you remove a sufficient number of MAC addresses. no syslog message is sent.
Restrict_ under the restrict mode if the security violation occurs, all the data transfer is blocked and packets are dropped. also, Syslog messages are generated simultaneously,
Shutdown_ under the shutdown mode if the violation occurs on port security enable the port. the port changed to an error-disable state. this mode is enabled by default.
{if you like this post, please take a look at our YouTube program}
Per VLAN Spanning tree (PVST) is cisco's proprietary version of STP which delivers more flexibility than the common spanning tree version. PVST works on a separate instance of STP for each VLAN. In normal
STP, CST (Common Spanning Tree), only one instance can be used for the network. There are no specific instances per VLAN. This allows the STP on each VLAN to be configured independently and offers better load balancing and tuning according to the conditions.
but as we know PVST is a cisco proprietary and because of its proprietary nature, Per VLAN Spanning tree (PVST) requires the use of a cisco inter-switch link (ISL) trunk but in coexist network where CST is working, and we configure PVST there will be problem occurs both require different trunking methods and the problem remains BPDUs are never exchanged between these types of STP.
the solution is Per-VLAN spanning tree plus (PVST+) it's also the cisco proprietary version of STP and allows the device to interoperate with both PVST and CST. PVST+ act as a translator between a group of CST switches and groups of PVST
switches. PVST+ creates an instance for each VLAN and in each instance, a different STP process occurs, a different Root bridge is selected, different port roles are used, etc.
Rapid Per VLAN Spanning Tree Plus (RPVST+) it's a Cisco proprietary STP version. Again, it has an instance for each VLAN and each VLAN has a separate STP process just like PVST but RPVST+ has a faster convergence advantage if we compare it with PVST+.
Let's see the configuration for a better understanding:
Topology:
Goal:
configure the topology as per the diagram.
configure VLANs 10,20,30 and 40 on all the switches.
configure TRUNK between switches
Allowed all VLANs on all the switches
configure PVST on all switches
configure Root bridge on switch 1 for VLAN 10
configure Root bridge on switch 2 for VLAN 20
configure Root bridge on switch 3 for VLAN 30
configure Root bridge on switch 4 for VLAN 40
verify the configuration
SWITCH-1(config-vlan)#VLAN 10
SWITCH-1(config-vlan)#VLAN 20
SWITCH-1(config-vlan)#VLAN 30
SWITCH-1(config-vlan)#VLAN 40
SWITCH-2(config)#VLAN 10
SWITCH-2(config-vlan)#VLAN 20
SWITCH-2(config-vlan)#VLAN 30
SWITCH-2(config-vlan)#VLAN 40
SWITCH-3(config)#VLAN 10
SWITCH-3(config-vlan)#VLAN 20
SWITCH-3(config-vlan)#VLAN 30
SWITCH-3(config-vlan)#VLAN 40
SWITCH-4(config)#VLAN 10
SWITCH-4(config-vlan)#VLAN 20
SWITCH-4(config-vlan)#VLAN 30
SWITCH-4(config-vlan)#VLAN 40
SWITCH-1(config)#interface range fastEthernet 0/1-2
SWITCH-1(config-if-range)#switchport mode trunk
SWITCH-1(config-if-range)#exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
SWITCH-2(config)#interface range fastEthernet 0/1-2
SWITCH-2(config-if-range)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
SWITCH-3(config)#interface range fastEthernet 0/1-2
SWITCH-3(config-if-range)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
SWITCH-4(config)#interface range fastEthernet 0/1-2
SWITCH-4(config-if-range)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
SWITCH-1(config)#interface range fastEthernet 0/1-2
By default, our
switch dynamically learns the MAC address and stores it in the CAM table. by just looking at the source MAC address of the incoming frame.
This dynamically
learning the MAC addresses and filling in the CAM table the process is vulnerable
to layer 2 MAC address spoofing attacks. The attacker easily spoofs a few MAC
addresses to change entries in the MAC address table. We can deal with this problem by
manually configuring entries in the MAC address table. A statically configured MAC
address will always overrule dynamic entry.
Let's configure the Static MAC Address table Entries: -
Topology:
Goal: -
configure the topology as per the diagram.
configure the IP addresses as per the topology
configure IP addresses on the PC as per the topology
This means a single private IP address (unregistered) is configured and mapped with the public IP address (registered) one-to-one mapped.
This is not for organizations because of many devices. We use this
in web hosting or home networks.
In the previous blog, we have seen dynamic NAT
where the inside network can access the outside but now the outside wants to reach our DMZ
server. Let's see how to configure
NAT is the method of translation of a private IP address into a public IP address. In order to communicate with the internet, we must have a registered public IP address.
Address translation was originally developed to solve two problems:
To handle a shortage of IPv6 addresses
Hide network addressing schemes.
Types of NAT: -Static NAT
Dynamic NAT
Port Address Translation (PAT)
Static NAT- one-to-one mapping was done manually for every private IP needed on registered IP address (one-to-one)
Dynamic NAT- one-to-one mapping is done automatically for every private IP that needs one registered IP address (one-to-one)
Port address translation (Dynamic NAT Overload)- Allows thousands of users to connect to the internet using only one real global IP address. Maps many to one by using different ports. PAT is the real reason we haven’t run out of valid IP addresses on the internet.
Just like the Cisco IOS routers, we can configure NAT / PAT
on our Cisco ASA firewall.
I'm assuming that you already know about NAT, if you don't, please click here
White-hat hackers are also known as ethical hackers
and they are professionals with expertise in cybersecurity. They are authorized
by the company and certified to hack the systems. They hack systems from the
loop to find weaknesses in the system. They never intend to harm the system,
rather than try to find out weaknesses in a computer or a network system as a
part of penetration testing and vulnerability assessments. well, Ethical
hacking is not illegal actually it is one of the most demanding jobs available
in the IT Industry. many companies hire ethical hackers for penetration testing
and vulnerability assessments. ethical hackers' job is to protect the system
network from hackers.
What is hacking?
Hacking is the act of finding the possible entry
points that exist in a computer system or computer network and finally entering
into them. hacking is usually done to gain unauthorized access to a computer
system or a computer network, either to harm the system or to steal sensitive
information available on the computer. Hacking is not always a malicious
activity, but the term has mostly negative connotations due to its association
with cybercrime. hacking is usually legal as long as it is being done to find
weaknesses in a computer or network system for testing purposes.
Types of hacking (BASIC)
we can segregate hacking into different categories, based on what
is being hacked.
here is a set of basic hacking examples:
Social engineering
Social engineering is a manipulation technique. Using
a fake identity and various psychological tricks, hackers can deceive you into
disclosing personal or financial information. They rely on phishing scams, spam
emails or instant messages, or even fake websites to achieve hacking.
Hacking passwords
Hackers use many ways to gain passwords. The
trial-and-error method in which involves hackers trying to guess every possible
combination to obtain access. Hackers also use simple algorithms to generate
different combinations for letters, numbers, and symbols to help them identify
password combinations. Another technique is known as a dictionary attack, which
is a program that inserts common words into password fields to see if one
works.
Malware hacking
Hackers infiltrate
a user’s device to install malware. More likely, hackers will target potential
victims via email, instant messages, and websites with downloadable content or
peer-to-peer networks.
Wireless Networks Hacking
hackers just
simply take advantage of open wireless networks. Many people do not secure
their Wi-Fi routers, and this can be exploited by hackers driving around looking
for open and unsecured wireless connections. This is an activity known as wardriving.
When hackers are connected to an unsecured network, they only need to
bypass basic security to gain access to devices connected to that network.
Website hacking
Website hacking: hacking a website means taking unauthorized
control over a web server and its associated software such as databases and
other interfaces.
Network hacking
Network hacking a network means gathering
information about a network by using tools like telnet, NS lookup, ping,
tracert, netstat, etc. with the intent to harm the network system and hamper
its operation.
Email hacking
Email hacking includes getting unauthorized access to an email
account and using it without taking the consent of its owner.
The advantages of hacking
are quite valuable for the following scenarios:
Whenever you need to recover lost information, especially in case you lost your
password.
When you want to perform penetration testing to strengthen computer and network
security.
when to put adequate preventative measures in place to prevent security
breaches.
to have a computer system that prevents malicious hackers from
gaining access.
The disadvantages of hacking
are quite dangerous if it is done with harmful intent. it
can cause:
massive security breach.
unauthorized system access to private information.
privacy violation.
hampering system operation.
denial of service attacks
malicious attack on the system.
purpose of hacking
there could be various positive and negative intentions behind
performing hacking activities, here is a list of some probable reasons why
people indulge in hacking activities: