IP addressing is a system used to assign unique numerical labels to devices on a network, enabling them to communicate with each other. Each IP address consists of two parts: the network portion, which identifies the network itself, and the host portion, which identifies the specific device within that network.
Subnetting is the practice of dividing a larger network into smaller, more manageable subnetworks (subnets). This enhances routing efficiency, improves security, and optimizes performance by limiting broadcast traffic. Subnetting involves creating subnets by manipulating the subnet mask, allowing for more effective use of IP addresses within an organization.
In this article, we will understand IP addresses and subnets and check how to configure them in Cisco devices. Configuration of IP address and subnet on a Cisco device is a very basic concept and should be known if you want to pursue any Cisco certification.
It will be a detailed guide on IP addressing and subnetting, as we will cover everything related to IP address, subnet, their working, and configuration.
An IP address is a unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves two main functions: identifying the host or network interface and providing the location of the device in the network.
IP addresses can be classified into two types: IPv4, which uses a 32-bit address format, and IPv6, which uses a 128-bit address format, allowing for a vastly larger number of unique addresses.
Currently, most devices use IPv4 addressing, and we will also learn about IPv4 addresses.
IPv4 addresses are 32-bit binary numbers, typically represented in decimal format (dotted-decimal notation) consisting of four octets separated by periods. Each octet represents 8 bits, ranging from 0 to 255, giving a total of 2^32 (approximately 4.3 billion) unique IPv4 addresses.
IPv4 addresses are categorized into five classes, each serving different purposes based on the size of the network and the number of hosts.
Class | First Bits | IP Address Range | Network Size |
---|---|---|---|
A | 0 | 1.0.0.0 - 126.0.0.0 | Large networks |
B | 10 | 128.0.0.0 - 191.255.0.0 | Medium-sized networks |
C | 110 | 192.0.0.0 - 223.255.255.0 | Small networks |
D | 1110 | 224.0.0.0 - 239.255.255.255 | Multicast addresses (not assigned to individual hosts or networks) |
E | 1111 | 240.0.0.0 - 255.255.255.255 | Reserved for experimental and future use |
There are two types of IPv4 addresses.
1. Public IPv4 addresses: They are globally routable and can be accessed over the Internet.
● 1.0.0.0 - 126.255.255.255
● 128.0.0.0 - 191.255.255.255
● 192.0.0.0 - 223.255.255.255
2. Private IPv4 addresses: They are used in private networks which are not routable on the Internet.
● 10.0.0.0 - 10.255.255.255
● 172.16.0.0 - 172.31.255.255
● 192.168.0.0 - 192.168.255.255
NAT (Network Address Translation) converts private IPv4 addresses into public addresses or vice versa. It helps private networks to communicate over the internet once they are converted to public addresses.
Subnetting divides a network into smaller subnets which allows an efficient utilization of IP addresses with network segmentation. It has several benefits such as improved network management, enhanced security, and optimized routing.
Subnets are smaller, manageable segments of a larger network, created by dividing an IP address space. Subnetting allows for efficient IP address management and better control over network resources, enabling easier troubleshooting and reduced broadcast domains.
Each subnet has its range of IP addresses, which helps in optimizing the use of available addresses and improving overall network efficiency.
The key steps in the subnetting process are:
Step 1: Start with an IP address that you want to subnet, either a network address or a host address within the network.
Step 2: Decide on the subnet mask that will define the size of each subnet. The subnet mask consists of a series of contiguous 1s followed by a series of contiguous 0s and is represented in decimal format (dotted-decimal notation).
Step 3: Count the number of 1s in the subnet mask, which represents the number of bits dedicated to the network portion of the IP address.
Step 4: Use the formula 2^n - 2 to calculate the number of subnets and hosts per subnet, where n is the number of subnet bits. Subtract 2 to account for the network and broadcast addresses, as they cannot be assigned to hosts.
Step 5: Calculate the network address by performing a bitwise AND operation between the IP address and the subnet mask.
Step 6: Determine the range of valid host addresses within each subnet, which is between (network address + 1) and the last usable address (broadcast address - 1).
Step 7: Calculate the broadcast address for each subnet by setting all host bits to 1.
This process allows network administrators to efficiently utilize IP addresses by creating smaller, more manageable subnets, each with its network address and range of available host addresses.
Here we will see the process to configure of IP addressing and subnetting on the Cisco environment. You can try the steps in our CCNA virtual lab.
Topology Diagram
Tasks
● Begin by logging into device R01 and observe that it already has a customized configuration, evident from its host name. Reset this device to its factory default configuration.
● Login into each device and perform the following configurations:
✓ Set the hostname to match the device name as indicated in the topology diagram.
✓ Implement a command to prevent the device from attempting DNS resolution for mistyped commands.
✓ Configure a command to display the most recent input/typing on the screen after an interruption caused by a SYSLOG or other console message.
✓ Require a password of "CISCO" whenever anyone attempts to access Privileged EXEC mode. Ensure that this password is not visible in plaintext in the configuration file.
✓ Enable all interfaces shown in the topology diagram and provide brief interface descriptions to indicate their respective connections.
✓ Once these steps are completed, use CDP on SW02, R05, and R04 to verify that these devices can recognize other connected Cisco devices as CDP neighbors.
● Proceed to configure devices R01 and R03 to allow inbound Telnet connections, authenticated against a preconfigured password of "CISCO".
● For devices R02 and R05, configure them to allow inbound SSH (version 2) connections, authenticated using the username "admin" and a password of "CISCO" at Privilege Level 15. Feel free to include any additional required keywords or features for SSH configuration at your discretion.
● To drive an IP addressing scheme for network segments A through F, adhere to the following guidelines:
✓ Begin with the starting network of 170.50.0.0/16.
✓ Allocate the first and largest subnet as 170.50.0.0 with a new or different subnet mask.
● Utilize the Variable Length Subnet Masking (VLSM) method, ensuring that each network has the fewest or least host bits possible based on the below-provided host requirements.
Network Segment Required Hosts Subnet Mask Prefix
A 99
B 13
C 6
D 11
E 26
F 30
● Assign IPv4 addresses to your router interfaces using these guidelines:
✓ Routers connecting to network segments A through D should be assigned the first available host address within each respective subnet.
✓ The addressing of router R03's E0/2 interface for Segments E and F will be covered in another lab.
✓ Configure IP addresses of routers R03 (E0/0: 20.1.3.3/24 and E0/1: 20.1.34.3/24), R04 (E0/0: 20.1.45.4/24 and E0/1: 20.1.34.4/24), and R05 (E0/0: 20.1.45.5/24, E0/1: 50.1.23.5/24 and E0/2: 20.1.5.5/24).
● To verify your IPv4 addressing configuration, perform the following actions:
✓ Confirm successful Telnet connectivity from R02 to R01.
✓ Verify Telnet connectivity from R04 to R03.
✓ Ensure SSH connectivity from R01 to R02.
✓ Validate SSH connectivity from R04 to R05.
Login to R01, press enter, and go to the user mode using the command "enable". Use the command "write erase" or "erase startup-config" to remove the configuration and press enter to confirm. Then use "reload" command to restart the device and press enter to confirm.
When the R01 device comes up again it will be in factory default state. It asks for System Configuration Dialog, Type "no" to proceed as
Login to all devices and configure using the following commands.
enable - command to enter in user mode
configure terminal - command to enter in configuration mode
no ip domain-lookup - command to prevent the device from attempting DNS resolution for mistyped commands
line console 0
logging synchronous - command to display the most recent input/typing on the screen after an interruption caused by a console message
enable secret CISCO- command for configuring password to enter in privileged exec mode
interface <>
description <> - command to enter into interface mode and give a description to it, note <> give interface name here
Note: All devices are in factory default, and it asks for System Configuration Dialog, Type "no" to proceed. By default, the router's interfaces are shut down, so need to unshut them using the command "no shutdown". Save the device configuration using the "write" command.
R01:
R02:
R03:
R04:
R05:
Note: The switch's interfaces are already in no shutdown state by default. Please shut down all the unused interfaces using the command "shutdown". Using the interface range <> command, you can configure multiple interfaces at the same time. Save the device configuration using the "write" command.
SW01:
SW02:
SW03:
SW04:
Use "show cdp neighbor" command on SW02, R05, and R04 to verify that these devices can recognize other connected Cisco devices as CDP neighbors.
Note: Now whenever you log in to any device, you have to first use the enable command for privileged mode and it will then also ask for a password (which you previously configured as "CISCO"). Here in the output Device IDs are the neighbors, Local Interfaces are the device interfaces and Port IDs are the neighbor device interfaces to which this device is connected.
SW02:
In the output above SW02 is connected to R01, R02, SW03 and SW04 on interfaces E0/1, E0/2, E0/0 and E0/3 & E1/0 respectively.
R05:
In the output above R05 is connected to R04 and SW04 on interfaces E0/0 and E0/2 respectively.
R04:
In the output above R04 is connected to R03 and R05 on interfaces E0/1, E0/0 respectively.
Now configure devices R01 and R03 to allow inbound Telnet connections and authenticate them against a preconfigured password of "CISCO". This will be configured in vty line, there are 5 lines in these routers i.e., 0-4 (in high-end devices there are 15 lines) meaning 5 users can log in to this device at the same time.
Note: By default, telnet is allowed, and any user (who has this device password) can telnet to this device.
From now onwards, it will be assumed that you are already logged into the devices and have entered the enable password.
R01 and R03:
Configure R02 and R05 to allow inbound SSH (version 2) connections, authenticated using the username "admin" and a password of "CISCO" at Privilege Level 15
Note: By default, SSH is not allowed in many low-end or old devices so first need to enable SSH on these devices as follows
Note: When generating a key, select the 1024-bit long key
R02 and R05:
Now similar to allowing telnet under vty lines in the previous scenario, in this case, allow ssh as follows, remember here username and password is to be configured at privileged level 15 instead of under vty line.
This needs to specify under vty line that the local password will be used using the command "login local".
R02 and R05:
Drive an IP addressing scheme for network segments A through F as per the provided table from a major subnet 170.50.0.0/16. The following bits are required to have these hosts in the Network Segments (A, B, C, D, E, F). If you subtract these bits from 32 then you will get a subnet mask.
● B = 13 requires 4-bits => 32-4 = 28 or 255.255.255.240
● C = 6 requires 3-bits => 32-3 = 29 or 255.255.255.248
● D = 11 requires 4-bits => 32-4 = 28 or 255.255.255.240
● E = 26 requires 5-bits => 32-5 = 27 or 255.255.255.224
● F = 30 requires 5-bits => 32-5 = 27 or 255.255.255.224
●A = 99 requires 7-bits => 32-7 = 25 or 255.255.255.128
As per given in the task, the first and largest subnet should be 170.50.0.0, and the others are as follows, so the first subnet 170.50.0.0/25 and add 128, 32, 32, 16, and 16 in the last octate for segment F, B, E, D and C respectively.
● A => 170.50.0.0 255.255.255.128
● F => 170.50.0.128 255.255.255.224
● E => 170.50.0.160 255.255.255.224
● B => 170.50.0.192 255.255.255.240
● D => 170.50.0.208 255.255.255.240
● C => 170.50.0.224 255.255.255.248Now configure R01 and R02's interfaces using network segments A, B, and D as per topology. Use initial available IP addresses.
Note: By default, the router's interfaces are in a shutdown state, here we are adding the command "no shutdown" on interfaces just for consistency.
R01:
R02:
Now configure interface IP addresses on R03, R04, and R05 as per provided in the tasks.
R03:
R04:
R05:
Now check the direct IP connectivity between the devices using the PING command. R01 can reach R02 from segments A, B, and D. Also use the "show ip interface brief" command to check the configured IP address on interfaces and make sure both interface status and protocol are showing up/up.
R01:
Check the IP connectivity from R04 to R03 and R05. Also, use "show ip interface brief" command to check the configured IP address on interfaces and make sure both interface status and protocol are showing up/up.
R04:
Further verifications can be performed by, using password CISCO for telnet or SSH into other devices (as configured in the tasks) and using "exit" to come out from the terminal of the logged device.
Telnet connectivity from R02 to R01
Telnet connectivity from R04 to R03
SSH connectivity from R01 to R02, log in using username "admin" and password "CISCO"
SSH connectivity from R04 to R05, log in using username "admin" and password "CISCO"
IP addressing involves assigning unique numerical labels to devices on a network, allowing them to communicate. IPv4 uses a 32-bit format, while IPv6 uses a 128-bit format. Subnetting divides a larger network into smaller, more manageable segments called subnets, enhancing efficiency, security, and performance.
To configure IP addressing and subnetting on Cisco devices, define interfaces, assign IP addresses and subnet masks, enable interfaces, and verify configurations. Mastering these concepts is crucial for effective network management and troubleshooting.
By staying informed about best practices and configuring devices properly, network professionals can optimize network performance and strengthen security measures.
He is a senior solution network architect and currently working with one of the largest financial company. He has an impressive academic and training background. He has completed his B.Tech and MBA, which makes him both technically and managerial proficient. He has also completed more than 450 online and offline training courses, both in India and ...
More... | Author`s Bog | Book a Meeting