Download Command Line Interface (CLI)

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Dynamic Host Configuration Protocol wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Transcript
CECS 474 COMPUTER NETWORKING INTEROPERABILITY
Reference Sheet 1: Basic Command-Line Interface (CLI) Networking Tools
This guide briefly covers the following important CLI commands:




Ping
Traceroute
Netstat
IPConfig
Ping
A computer ping test is a message sent by a device to determine the latency to another network device. It is
a useful troubleshooting tool that comes with virtually every modern operating system. Most pings use
Internet Control Message Protocol (ICMP). Microsoft Windows has a built in utility which will be used in this
guide. There are other utilities that work in a similar fashion. Open up the command prompt in Windows to
begin. We start with a basic ping command to a specific address
Command: ping [ip address]
Figure 1 shows a ping command being issued to a device with IP address 134.139.1.60. The result shows
that the sending computer attempted four pings and all were successful.
Figure 1: Ping using IP address
Note:
 The size of the packet sent in each ping message is shown.
 The round trip time (RTT) is useful in determining several things about the link including how far away it
is (geographically), as well as how well the connection media is working. For example, if two computers
are in the same room but the RTT is high, then perhaps you have a bad wire in between.
 Finally, the statistics show the summary of the information acquired.
 We can also ping using the URL address (or domain name) of a site.
Dr. Tracy Bradley Maples (Fall 2013)
Lab Design: Rogelio Cruz
CECS 474 COMPUTER NETWORKING INTEROPERABILITY
Figure 2 shows a ping command to the same site as before but using the name of the site instead.
Figure 2: ping command with URL
Note:
 The actual ICMP messages are still sent to the IP address, and not the domain name.
 Also, the latency has increased a bit since the URL name needs to be resolved to a Domain Name Server
to determine the IP address. The increase is in milliseconds and therefore insignificant.
Command: ping [ip address] or [URL] –t
Typically, a ping only needs a few tries to produce relevant information. However, if you need a continuous
ping you can add a –t option after the command. Figure 3 shows the continuous ping.
Figure 3: Continuous ping
Note:
 To end the continuous ping press the “control” key and “c” key simultaneously.
Dr. Tracy Bradley Maples (Fall 2013)
Lab Design: Rogelio Cruz
CECS 474 COMPUTER NETWORKING INTEROPERABILITY
Traceroute/Tracepath
A trace route test is used to display the routing path taken by a packet to reach a destination. In Windows,
the traceroute command differs from other Operating Systems (e.g., Apple Mac OS and Linux) but has the
same basic functionality.
Command: tracert [ip address]
Figure 1 shows a trace that took three hops to reach the destination.
Figure 1: Traceroute command
Note:
 The Windows trace route utility limits you to a maximum of 30 hops. Unless you are spanning the
globe to reach a destination, chances are you won’t reach that limit.
 There are times that the information will not be displayed for a specific hop. Instead you will see a
star(s). The trace route sends three packets to communicate with the remote node, but if it does not
get a reply it cannot evaluate that hop. Typically, this is due to a firewall restricting or blocking the
ICMP echo request. Figure 2 shows an example.
Figure 2: Hop
Dr. Tracy Bradley Maples (Fall 2013)
Lab Design: Rogelio Cruz
CECS 474 COMPUTER NETWORKING INTEROPERABILITY
Netstat
Sometimes there is an issue with connectivity that is not obvious to locate. In some cases firewalls create
chaos in a network in a passive way by blocking certain ports or protocols. Sometimes you may need to
know which sites are currently connected through port 80 (standard http port). In these instances, the
netstat command is needed.
Command: netstat
Figure 1 shows the basic netstat command. It lists all the active connections in the computer and their
associated sockets. Netstat displays the TCP sockets of both the local and remote computer. Remember
that the socket is comprised of both the IP address and the port being used.
Figure 1: Netstat displays active connection in a Computer
Command: netstat –a –n –o | findstr: [port]
You can use netstat to filter out specific ports. Figure 2 shows an example of filtering out only HTTP (port
80) connections.
Figure 2: Netstat with port filters
Dr. Tracy Bradley Maples (Fall 2013)
Lab Design: Rogelio Cruz
CECS 474 COMPUTER NETWORKING INTEROPERABILITY
IPConfig
Internet Protocol Configuration (IPConfig) is a system tool that allows you to display the current IP
configuration. Figure 1 shows a typical ipconfig output window, which displays a summary of the network
statistics for the PC. Things to note includes the DNS suffix (or Domain), the local IP address (IPv4 or IPv6),
the subnet mask, and the default gateway.
Command: ipconfig
Figure 1: Typical ipconfig output
Command: ipconfig /all
For a more detailed output add the forward slash all after the command. This will display a lot more
statistics including all the network interfaces on the workstation. This includes “virtual” interfaces that you
may have with virtualization environments. Figure 2 shows a partial output of an ipconfig /all.
Dr. Tracy Bradley Maples (Fall 2013)
Lab Design: Rogelio Cruz
CECS 474 COMPUTER NETWORKING INTEROPERABILITY
Figure 2: Partial output for ipconfig /all command
Note:
 Notice on this output that the Ethernet adapter is displayed as “Media disconnected” with no
configured IP address (Red Arrow). This detailed view also gives you the DHCP serving leasing the
address and how long the lease is for (Orange Arrow).
 Additionally, you can also see the DNS server which resolves the IP addresses for you locally. In this
case it handles all requests for the csulb.edu domain (Green Arrows).
 Finally, you get the physical or MAC address of each network interface (purple Arrow).
Command: ipconfig /release
When you want to end the current DHCP lease you have you need to use the release option (Blue Arrow).
This command forces the network interface to flush the IP information out. Figure 3 shows the output of
ipconfig using /release. Notice that the only information remaining on each interface is the link local
address, which is internal used for tunneling between IPv4 and IPv6 (Orange Arrow).
Dr. Tracy Bradley Maples (Fall 2013)
Lab Design: Rogelio Cruz
CECS 474 COMPUTER NETWORKING INTEROPERABILITY
Figure 3: IPconfig /release output
Command: ipconfig /renew
To request a new lease from a DHCP server you use the renew option. This will send a broadcast to the
network requesting an IP address for the interface. After a second or two the local DHCP acknowledges the
request and grants the PC a new lease. Figure 4 shows the new lease issued.
Figure 4: The lease renewed
Dr. Tracy Bradley Maples (Fall 2013)
Lab Design: Rogelio Cruz