Lab01 - Computer Networks
Lab01 - Computer Networks
• Gather information including connection, host name, Layer 2 MAC address and Layer 3
TCP/IP network address information.
• Compare network information to other PCs on the network.
• Identify tool used for discovering a computer’s network configuration.
• Understand basic network information & configuration from computer through
ipconfig/ifconfig and ns lookup commands.
• Introduction with Network adapter and its working.
• Perform some network adapter operations using ipconfig/ifconfig.
• Find the IP of a system with 8 different methods.
Computer Networks Lab Manual
Contents
Computer Networks ........................................................................................................................ 3
Terminologies ................................................................................................................................. 3
IP address ................................................................................................................................. 3
Public IP and Private IP ........................................................................................................... 3
MAC Address .......................................................................................................................... 4
TCP .......................................................................................................................................... 4
DHCP....................................................................................................................................... 4
DNS ......................................................................................................................................... 4
Gather TCP/IP Configuration Information ..................................................................................... 4
Ipconfig ....................................................................................................................................... 4
Open Command Prompt .............................................................................................................. 5
Ipconfig Syntax ........................................................................................................................... 5
Ipconfig Parameters..................................................................................................................... 5
Retrieve Basic TCP/IP Network Information ............................................................................. 6
ipconfig /all - Retrieve All TCP/IP Network Information .......................................................... 7
MAC Address (OUI) Lookup Tool ............................................................................................. 9
Network Adapter ......................................................................................................................... 9
ipconfig /release - Releases the IPv4 Address of All Network Adapters ................................. 10
ipconfig /release6 - Releases the IPv6 Address of All Network Adapters................................ 11
ipconfig /renew - Get a New IPv4 Address for All Network Adapters .................................... 12
ipconfig /renew6 - Get a New IPv6 Address for All Network Adaptersipconfig /displaydns -
View DNS Cache ...................................................................................................................... 13
ipconfig /renew <adapter> - Get a New IPv4 Address For a Specific Network Adapter ......... 13
ipconfig /all | findstr /v 00-00-00 | findstr Physical - Display MAC Address of Only Physical
Connected Network Adapters ................................................................................................... 14
ipconfig /displaydns - View DNS Cache .................................................................................. 15
ipconfig /flushdns - Purge DNS Cache ..................................................................................... 17
Other Usages and Getting Help ................................................................................................. 17
Redirect Output to Text File ..................................................................................................... 19
NS LookUp ................................................................................................................................... 20
Multiple ways to find your IP address in Windows (all versions) ................................................ 21
How to find your IP address from the Command Prompt (all versions of Windows) .......... 21
1
Computer Networks Lab Manual
How to find your IP address in the Settings app (Windows 10 only) ................................... 22
How to find your IP Address in the Control Panel (all versions of Windows) ..................... 25
How to find your IP address in System Information (all versions of Windows) .................. 29
How to find the IP address in PowerShell (all versions of Windows) .................................. 30
How to find your IP address in Task Manager (Windows 10 and Windows 11 only) .......... 31
How to find your IP address in the PC Settings app (Windows 8.1 only) ............................ 33
2
Computer Networks Lab Manual
Computer Networks
Computer networks are the basis of communication in IT. They are used in a huge variety of
ways and can include many different types of networks. A computer network is a set of
computers that are connected together so that they can share information. The earliest examples
of computer networks are from the 1960s, but they have come a long way in the half-century
since then.
Computer networking refers to interconnected computing devices that can exchange data and
share resources with each other. These networked devices use a system of rules, called
communications protocols, to transmit information over physical or wireless technologies.
Terminologies
IP address
Every machine on a network has a unique IP address provides an identity to a networked device.
Similar to a home or business address supplying that specific physical location with an
identifiable address; devices on a network are differentiated from one another through IP
addresses.
IPv4 uses 32bits to create a single unique address on the network. An Ipv4 address is expressed
by four number separated by dots. Each number is the decimal (base 10) representation for an
eight-digit binary (base-2) number, also called an octet. For example:
IP address: 216.27.61.137
Binary representation: 11011000.00011011.00111101.10001001
Figure 1: Each device within the same network has a unique private IP address.
3
Computer Networks Lab Manual
MAC Address
A MAC address, or Media Access Control address, is a 48-bit address associated with a network
adapter. While IP addresses are associated with software, MAC addresses are linked to the
hardware of network adapters. The MAC address is a unique value associated with a network
adapter. MAC addresses are also known as hardware address or physical address. They uniquely
identify an adapter on a LAN.
TCP
TCP stands for Transmission Control Protocol a communications standard that enables
application programs and computing devices to exchange messages over a network. It is
designed to send packets across the internet and ensure the successful delivery of data and
messages over networks. TCP organizes data so that it can be transmitted between a server and a
client. It guarantees the integrity of the data being communicated over a network.
DHCP
DHCP (Dynamic Host Configuration Protocol) is a network management protocol used to
dynamically assign an Internet Protocol (IP) address to any device, or node, on a network so they
can communicate using IP. DHCP automates and centrally manages these configurations rather
than requiring network administrators to manually assign IP addresses to all network devices.
DHCP can be implemented on small local networks, as well as large enterprise networks.
DNS
The Domain Name System (DNS) is the phonebook of the Internet. Humans access information
online through domain names, like nytimes.com or espn.com. Web browsers interact through
Internet Protocol (IP) addresses. DNS translates domain names to IP addresses so browsers can
load Internet resources.
Ipconfig
The ipconfig is a Windows command-line utility used often to troubleshooting computer network
issues. If you are a Linux user, this utility is similar to ifconfig. Ipconfig displays all current
TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol
(DHCP) and Domain Name System (DNS) settings. Used without parameters, ipconfig displays
Internet Protocol version 4 (IPv4) and IPv6 addresses, subnet mask, and default gateway for all
adapters.
While most of the information provided by the ipconfig command-line utility can be found via a
more user-friendly graphical interface, sometimes that interface may not be available and
command prompt is your only available option. If you are a help desk technician or a network
professional, it is recommended that you understand the command-line method of retrieving a
computer's network configuration, and it some cases, performing network functions.
4
Computer Networks Lab Manual
Open Command Prompt
1. Search for cmd/Command Prompt using the built-in Windows search tool. OR
2. Press the keyboard combination WinKey + R, then type cmd at the Run window that
appears.
Ipconfig Syntax
Ipconfig Parameters
Parameter Description
/all Display the full TCP/IP configuration information for all network adapters.
/release Release the IPv4 address for the specified adapter.
/release6 Release the IPv6 address for the specified adapter.
/renew Renew the IPv4 address for the specified adapter.
/renew6 Renew the IPv6 address for the specified adapter.
/flushdns Purges the DNS Resolver cache.
/registerdns Refreshes all DHCP leases and re-registers DNS names.
/displaydns Display the contents of the DNS Resolver Cache.
/showclassid Displays all the DHCP class IDs allowed for adapter.
/setclassid Modifies the DHCP class ID.
/showclassid6 Displays all the IPv6 DHCP class IDs allowed for adapter.
/setclassid6 Modifies the IPv6 DHCP class ID.
/? Displays help information.
There are a variety of switches (sub commands) available with the ipconfig utility that will either
display certain information or perform certain network functions. At the most basic, the ipconfig
5
Computer Networks Lab Manual
displays a computer's IP address, subnet mask and the default gateway (which is typically the IP
address of your router or network firewall).
To get basic network information from your computer, type the following in the command
window then press Enter: ipconfig
The screenshot example below is the ipconfig output of a particular computer. The output of
your ipconfig result will differ depending on your network setup and the type of network
adapters installed on your computer. In our screenshot example, it shows the following basic
networking information about the computer from which ipconfig was ran.
Please note that unless your computer is connected directly to the Internet (this is rare), the IP
address reported by ipconfig will be your local network IP, not your public external IP address.
While other network details can be retrieved by the ipconfig utility, for most network
troubleshooting, this is what is typically needed.
6
Computer Networks Lab Manual
ipconfig /all - Retrieve All TCP/IP Network Information
Another useful switch with ipconfig is to have it report all TCP/IP network details for all
network adapters on a computer. This is accomplished by using the /all switch. This switch
provides you with the same basic information as ipconfig described above, but with a lot more
detail. To retrieve all network information about your computer, type the following in the
command window then press Enter: ipconfig /all
This shows a detailed report of various network details for the computer. Again, your report will
differ depending on your network setup and the network adapters installed on your computer.
This report includes information such as:
As you can see, ipconfig /all provides you with a plethora of details about your computer
network setup.
7
Computer Networks Lab Manual
8
Computer Networks Lab Manual
The results of IPConfig include the following information:
Subnet Mask The specific section of the network to which a computer is connected.
Default The router or switch that the network connection goes through.
Gateway
DHCP Server The server that hands out IP addresses based on a DHCP protocol.
DNS Servers Domain name servers for your network - these servers translate URLs to an IP
address.
Connection- A connection specific DNS suffix is a DNS suffix that is related to a particular
specific DNS network interface. It can be used in addition to or instead of the Primary DNS
Suffix suffix when performing DNS queries or DNS dynamic registrations.
A MAC address, or Media Access Control address, is a 48-bit address associated with a network
adapter. While IP addresses are associated with software, MAC addresses are linked to the
hardware of network adapters. The MAC address is a unique value associated with a network
adapter. MAC addresses are also known as hardware address or physical address. They uniquely
identify an adapter on a LAN.
A MAC address is made up of six (6) octets. The first three octets indicate the manufacturer of
the network adapter. Use this MAC Address (OUI) Lookup Tool to find the manufacturer of
your adapter.
Network Adapter
A network adapter is the component of a computer’s internal hardware that is used for
communicating over a network with another computer. It enables a computer to connect with
another computer, server or any networking device over a local area network (LAN) connection.
A network adapter can be used over a wired or wireless network.
A network adapter is usually the only component within a computer for interfacing or connecting
with a network. Typically, it is built on a printed circuit board with jumpers that connect it with
the computer’s motherboard.
9
Computer Networks Lab Manual
The /release switch will cause ipconfig to go through the network adapters you have and drop the
dynamically issued IPv4 address by sending a DHCPRELEASE message to the DHCP server.
For the majority of the time, you would follow this command with ipconfig /renew (described
below) will cause your network adapters to reach out to your DHCP server for an IP address (it
10
Computer Networks Lab Manual
can be a new IP address or the same IP you had prior to when you performed
the /release command). For most, executing this command does not have adverse effect on your
computer.
To release your IP address from your computer, type the following in the command window then
press Enter:ipconfig /release
Note, if you have a statically assigned (manually assigned) IP address, this command will not
release it. See example ipconfig /renew for related information.
The command is similar to ipconfig /release except it renews the IPv6 address on the
adapters.
11
Computer Networks Lab Manual
ipconfig /renew - Get a New IPv4 Address for All Network Adapters
The ipconfig /renew will cause your computer to reach out to your DHCP server for an IPv4
address if it doesn't already have one or renews an existing one for all network adapters.
Depending on how your DHCP server is configured or the pool of available addresses, the IP
address you will receive can be one you had previously or it can be a new IP address. Once you
execute this command, it will typically take just seconds for a DHCP to assign your computer
with an IP address. In the illustration below, the IP address assigned to this computer is
192.168.226.132.
To renew the IP address of your computer, type the following in the command window then
press Enter: ipconfig /renew
12
Computer Networks Lab Manual
ipconfig /renew6 - Get a New IPv6 Address for All Network Adaptersipconfig
/displaydns - View DNS Cache
The command is similar to ipconfig /renew except it renews the IPv6 address on the adapters.
ipconfig /renew <adapter> - Get a New IPv4 Address For a Specific Network
Adapter
The ipconfig /renew <adapter> will cause your computer to reach out to your DHCP server for
an IPv4 address if it doesn't already have one or renews an existing one for a specific network
adapter. Depending on how your DHCP server is configured or the pool of available addresses,
the IP address you will receive can be one you had previously or it can be a new IP address.
Once you execute this command, it will typically take just seconds for a DHCP to assign your
computer with an IP address. In the illustration below, the IP address assigned to the network
adapter named " Wi-FI " is 192.168.226.132.
To renew the IP address for a network adapter on your computer named "Local Area Connection
3", type the following in the command window then press Enter: ipconfig/release *Wi-FI*. To find
out the name(s) of the network adapters on your computer, type the following in the command
window then press Enter: ipconfig
13
Computer Networks Lab Manual
ipconfig /all | findstr /v 00-00-00 | findstr Physical - Display MAC Address of Only
Physical Connected Network Adapters
The ipconfig utility, with the /all switch, is often used to find the MAC address (the 6-byte
'burned-in' physical/hardware address) of network adapters. While this does the job, the output
shows a plethora of information as mentioned above. If you have multiple adapters, the output
can be lengthy making it cumbersome to find what you are looking for.
The Windows findstr utility is used to search for patterns of text. By feeding the output
of ipconfig /all into findstr, we can significantly reduce the clutter and have the output show only
the MAC address of physical network adapters. To accomplish this, type the following in the
command window then press Enter:
1. ipconfig /all
2. findstr /v 00-00-00
14
Computer Networks Lab Manual
3. findstr Physical
The vertical bar (|), more commonly referred to as the pipe, is a 'command' that takes the output
from the left side of the pipe and feeds it as input to the command on the right, bypassing the
computer screen.
As the above command shows, the output of ipconfig /all is funneled into the command findstr /v
00-00-00 as its input. The findstr with the /v switch will look for lines of text in the output
of ipconfig /all that does not contain 00-00-00. What this does is exclude any network adapters
that are disabled or not connected. These network adapters will have MAC address that starts
with 00-00-00.
The result from the first findstr will still contain a lot of information that we can further filter out,
such as DHCP lease information. To further reduce clutter to ultimately end up with an output
that lists only MAC address of physical adapters, we will need to funneled the output of the first
findstr into a second findstr command. This second findster will filter out every line of text
except those that has the word Physical.
This series of commands produce an output that is concise to show only the MAC address of
connected network adapters. As the illustration below shows, this is a much easier report to read
as oppose to using just using ipconfig /all.
When you visit a website using it's domain name (e.g., www.meridianoutpost.com), your
computer will need to know the IP address for that website in order for it to find it the server
hosting it on the Internet. The process of identifying the IP address is called DNS lookup
(analogous to looking up a number in a phone book). Once your computer learns the associated
IP address for the website you want to visit, it will cache it (store it) on your computer. The
purpose of caching it is to improve performance by not having your computer perform a DNS
lookup each time you access a web page on the website.
15
Computer Networks Lab Manual
This command will list all the currently cached IP addresses on your computer (also referred to
as the DNS resolver cache). If you've accessed a lot of websites since turning on your computer,
this list can be very lengthy. The illustration below shows just a few entries out of many for a
particular computer. If you just turned on our computer and have not access websites or servers
on the network on the Internet, then you list will only show a "localhost" setting in your local
host’s file.
To display cached DNS entries on your computer, type the following in the command window
then press Enter: ipconfig /displaydns
This command is typically used to troubleshoot specific DNS lookup issues. See example
for ipconfig /flushdns for related information.
16
Computer Networks Lab Manual
ipconfig /flushdns - Purge DNS Cache
This command will purge the cached DNS entries on your computer. You would typically do this
to troubleshoot DNS related problems. An example of this is when you try to access a website
but you encounter an error message stating the website is not found. For most people, executing
this command does not have adverse effect on your computer. See example for ipconfig
/displaydns for related information.
To delete all the cached DNS entries on your computer, type the following in the command
window then press Enter: ipconfig /flushdns
The example usage described shows only some of the functions available with ipconfig. To get a
list of the available switches, type the following in the command window then
press Enter: ipconfig /?
17
Computer Networks Lab Manual
18
Computer Networks Lab Manual
Redirect Output to Text File
Instead of displaying the results on the screen, you can have the results saved automatically to a
text file on your computer. To do this, simply use the ">" symbol followed by the folder path and
file name of your choice. For example, to redirect the output of ipconfig /renew, type the
following in the command window then press Enter: ipconfig /all >D:\ipconfig-results.txt
This will create a file named ipconfig-results.txt in the folder path c:\temp that will have your
result. You can then open this file with any text editor, such as Notepad on a Windows computer,
as illustrated below.
19
Computer Networks Lab Manual
NS LookUp
Nslookup (stands for “Name Server Lookup”) is a useful command for getting information from
DNS server. It is a network administration tool for querying the Domain Name System (DNS) to
obtain domain name or IP address mapping or any other specific DNS record. It is also used to
troubleshoot DNS related problems.
Syntax:
nslookup [option]
nslookup google.com
nslookup 172.217.19.164 :
Reverse DNS lookup
20
Computer Networks Lab Manual
Multiple ways to find your IP address in Windows (all versions)
The IP address or Internet Protocol address is a numerical label that is used in networks to identify
and locate network devices, from computers to smartphones, to printers and other devices. The IP
address can be a useful piece of information, especially when you want to set up your home router
or when you want to connect to other devices on a network. But how do you check a PC's IP
address in Windows?
How to find your IP address from the Command Prompt (all versions of Windows)
Open the Command Prompt, type the command ipconfig and press Enter. This command lists all
the network adapters (both Ethernet and wireless) found on your Windows computer, and it
shows details about each of them.
21
Computer Networks Lab Manual
For each network adapter, you get to see both the IPv4 address and the IPv6 Address.
To learn more about the parameters accepted by the ipconfig command and what each of them
does, run the command ipconfig /?
If you are using Windows 10, open the Settings app. There, go to Network & Internet. You are
shown a list of networking related settings and categories. If you are connected to a wireless
network, in the column on the left, choose Wi-Fi and then, on the right, click or tap on the name
of the network that you are connected to.
You are shown a long list of properties. Scroll down until you find the fields for the IPv6 and
IPv4 addresses, highlighted below.
22
Computer Networks Lab Manual
If you are connected using a network cable, in the column on the left choose Ethernet and then
click or tap on the network name, on the right side of the screen.
23
Computer Networks Lab Manual
Scroll down the list of network properties until you find the entries for the IPv6 and IPv4
addresses, highlighted below.
24
Computer Networks Lab Manual
How to find your IP Address in the Control Panel (all versions of Windows)
Another geeky method that does not involve using a command is to use the Network and Sharing
Center. To access it, open the Control Panel and go to "Network and Internet -> Network and
Sharing Center." Next, click or tap the "Change adapter settings" link on the left.
25
Computer Networks Lab Manual
The Network Connections window is opened, listing the network adapters installed on your
computer, including virtual ones, used by VPN services or virtualization apps. Double click (or
double tap) the network adapter for which you want to see the IP address.
26
Computer Networks Lab Manual
27
Computer Networks Lab Manual
28
Computer Networks Lab Manual
29
Computer Networks Lab Manual
In the System Information desktop app, on the column on the left, expand Components followed
by Networks and then Adapter. On the right side of the app window, you can see detailed
information about each network adapter that is found on your computer. Scroll down the list until
you find the network card that you are interested in. There you see a field named IP Address,
giving you all the information, you need.
30
Computer Networks Lab Manual
Another command which returns the same results is Get-NetIPConfiguration. Type it,
press Enter and then look for the information that you want.
How to find your IP address in Task Manager (Windows 10 and Windows 11 only)
The Task Manager can also tell you the IP address you’re using on the local network. To fire it
up, press Ctrl + Shift+ Escape on your keyboard or use any of the other ways of opening Task
Manager. If you’re using Windows 10, and you start the Task Manager in the compact view,
click or tap More details. Then, select the Performance tab and look for your network adapter. If
31
Computer Networks Lab Manual
you are connected to a wireless network, choose Wi-Fi. If you’re using a cable connection,
choose Ethernet. Then, on the right side, you see the IPv6 and IPv4 addresses.
Things are similar in Windows 11. However, when you fire up the Task Manager, there’s no
annoying compact view. Instead, you just select the Performance tab on the left and click or tap
on Wi-Fi or Ethernet, depending on your network connection. Then, on the bottom-right, you see
your computer's IPv6 and IPv4 addresses.
32
Computer Networks Lab Manual
How to find your IP address in the PC Settings app (Windows 8.1 only)
If you are using Windows 8.1, open the PC Settings app. There, choose Network and then go
to Connections. Here you can see the network adapter that you are using the name of the network
that you are connected to. Click or tap on the network name, under Ethernet (if you are on a
wired connection) or Wi-Fi (if you are using a wireless network).
33
Computer Networks Lab Manual
34
Computer Networks Lab Manual
References
1. https://www.fortinet.com/resources/cyberglossary/tcp
2. https://www.techtarget.com/searchnetworking
3. https://www.meridianoutpost.com/resources/articles/command-line/ipconfig.php
4. https://docs.microsoft.com/en-us/windows-server/administration/windows-
commands/ipconfig
35