1 Network Familiarization Commands
1 Network Familiarization Commands
-i : Displays network interfaces and their statistics (not available under Windows)
-n : Displays active TCP connections, however, addresses and port numbers are expressed
numerically and no attempt is made to determine names.
-o : Displays active TCP connections and includes the process ID (PID) for each connection.
-p Linux: Process : Show which processes are using which sockets
ARP
In computer networking, the Address Resolution Protocol (ARP) is the method for finding a host's
link layer (hardware) address when only its Internet Layer (IP) or some other Network Layer address
is known.
ARP has been implemented in many types of networks; it is not an IP-only or Ethernet-only protocol.
It can be used to resolve many different network layer protocol addresses to interface hardware
addresses, although, due to the overwhelming prevalence of IPv4 and Ethernet, ARP is primarily
used to translate IP addresses to Ethernet MAC addresses.
How to Use ARP to Find a MAC Address
In Windows, Linux, and other operating systems, the command line utility ARP (Address Resolution
Protocol) shows local MAC address information stored in the ARP cache. However, it only works
within the small group of computers on a local area network (LAN), not across the internet.
ARP is intended to be used by system administrators, and it is not typically a useful way to track
down computers and people on the internet.
TCP/IP computer networks use both the IP addresses and MAC addresses of connected client devices.
While the IP address changes over time, the MAC address of a network adapter always stays the
same.
Start by pinging the device you want the MAC to address for:
ping 192.168.86.45
The ping command establishes a connection with the other device on the network and should show a
result like this:
arp -a
The results may look something like this but probably with many other entries:
TELNET
Telnet (Telecommunication network) is a network protocol used on the Internet or local area
network (LAN) connections. In Linux, the telnet command is used to create a remote connection
with a system over a TCP/IP network.
Typically, telnet provides access to a command-line interface on a remote machine.
The term telnet also refers to software which implements the client part of the protocol. Telnet
clients are available for virtually all platforms.
Protocol details:
Telnet is a client-server protocol, based on a reliable connection-oriented transport. Typically
this protocol is used to establish a connection to TCP port 23
FTP
File Transfer Protocol (FTP):
FTP is a network protocol used to transfer data from one computer to another through a network
such as the Internet.FTP is a file transfer protocol for exchanging and manipulating files over a
TCP computer network. An FTP client may connect to an FTP server to manipulate files on that
server.FTP runs over TCP. It defaults to listen on port 21 for incoming connections from FTP
clients. A connection to this port from the FTP Client forms the control stream on which
commands are passed from the FTP client to the FTP server and on occasion from the FTP
server to the FTP client. FTP uses out-of-band control, which means it uses a separate
connection for control and data. Thus, for the actual file transfer to take place, a different
connection is required which is called the data stream.
To establish an FTP connection to a remote system, use the ftp command with the remote
system's IP address:
ftp [IP]
ftp 192.168.100.9
FINGER:
In computer networking, the Name/Finger protocol and the Finger user information protocol
are simple network protocols for the exchange of human-oriented status and user information.
finger -p ch
Display information about the user ch. Output appears similar to the following:
TRACEROUTE:
traceroute is a computer network tool used to determine the route taken by packets across an IP
network . An IPv6 variant, traceroute6, is also widely available. Traceroute is often used for
network troubleshooting. By showing a list of routers traversed, it allows the user to identify the
path taken to reach a particular destination on the network. This can help identify routing
problems or firewalls that may be blocking access to a site. Traceroute is also used by
penetration testers to gather information about network infrastructure and IP ranges around a
given host. It can also be used when downloading data, and if there are multiple mirrors available
for the same piece of data, one can trace each mirror to get a good idea of which mirror would be
the fastest to use.
In other words, traceroute command in Linux prints the route that a packet takes to reach the host.
This command is useful when you want to know about the route and about all the hops that a
packet takes.
The traceroute command in Windows is tracert. On a Linux system, the command is traceroute.
A typical tracert on a Windows machine would look like the following.
tracert www.google.com
Tracing route to www.google.com [74.125.227.179]
over a maximum of 30 hops:
1 1 ms <1 ms 1 ms 192.168.1.1
2 7 ms 6 ms 6 ms 10.10.1.2
3 7 ms 8 ms 7 ms 10.10.1.45
4 9 ms 8 ms 8 ms 10.10.25.45
5 9 ms 10 ms 9 ms 10.10.85.99
6 11 ms 51 ms 10 ms 10.10.64.2
7 11 ms 10 ms 10 ms 10.10.5.88
8 11 ms 10 ms 11 ms 216.239.46.248
9 12 ms 12 ms 12 ms 72.14.236.98
10 18 ms 18 ms 18 ms 66.249.95.231
11 25 ms 24 ms 24 ms 216.239.48.4
12 48 ms 46 ms 46 ms 72.14.237.213
For all additional options of traceroute, check the manual page in the terminal with the man
command:
man traceroute
WHO IS:
WHOIS (pronounced "who is"; not an acronym) is a query/response protocol which is widely
used for querying an official database in order to determine the owner of a domain name, an IP
address, or an autonomous system number on the Internet. WHOIS lookups were traditionally
made using a command line interface, but a number of simplified web-based tools now exist for
looking up domain ownership details from different databases. WHOIS normally runs on TCP
port 43.
The WHOIS system originated as a method that system administrators could use to look up
information to contact other IP address or domain name administrators (almost like "white
pages").
whois 216.58.206.46
https://whois.arin.net/rest/nets;q=216.58.206.46?showDetails=true&showARIN=false&showNo
nArinTopLevelNet=false&ext=netref2
CIDR: 216.58.192.0/19
NetName: GOOGLE
NetHandle: NET-216-58-192-0-1
OriginAS: AS15169
RegDate: 2012-01-27
Ref: https://whois.arin.net/rest/net/NET-216-58-192-0-1
OrgId: GOGL
StateProv: CA
PostalCode: 94043
Country: US
RegDate: 2000-03-30
Updated: 2017-12-21
whois google.com