0% found this document useful (0 votes)
22 views

Exp 2

The tracert command prints the path between a source and destination host by displaying the sequence of routers that IP packets pass through. It can show where connectivity issues occur if a router is down along the path. The ping command tests connectivity between two hosts by sending ICMP echo request and reply messages. The ipconfig command displays TCP/IP network configuration values like IP addresses. The arp command displays or manipulates the IP address to MAC address mappings in the ARP cache.

Uploaded by

cs docs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Exp 2

The tracert command prints the path between a source and destination host by displaying the sequence of routers that IP packets pass through. It can show where connectivity issues occur if a router is down along the path. The ping command tests connectivity between two hosts by sending ICMP echo request and reply messages. The ipconfig command displays TCP/IP network configuration values like IP addresses. The arp command displays or manipulates the IP address to MAC address mappings in the ARP cache.

Uploaded by

cs docs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Tracert

This command is used to diagnose path-related problems. On an IP network, routers


exchange IP packets between the source and the destination. They take IP packets
from the source host and forward them in a sequence until they reach the destination
host. The sequence of routers between the source and destination is known as the
path. A path consists of all routers in a sequence that IP packets sent from the source
host traverse to reach the destination host.

The tracert command prints the path. If all routers on the path are functional, this
command prints the full path. If a router is down on the path, this command prints the
path up to the last operational router.

The tracert command uses the following syntax.

tracert Destination Name or IP address


The following command traces the path to the host named www.google.co.in.

tracert www.google.co.in
The following image shows the output of this command.

The following table lists some important options of the tracert command.

Option Description
-d Do not resolve the IP addresses of intermediate routers to their names.
-h Specifies the maximum number of hops (routers) to search on the path. The default is 30 hops.
-w Specifies the amount of time in milliseconds to wait for a reply message from the router. If not
received within the time-out, an asterisk (*) is displayed. The default time-out is 4000 (4
seconds).
Ping

The ping command is used to test connectivity between two hosts. It sends ICMP echo
request messages to the destination. The destination host replies with ICMP reply
messages. If the ping command gets a reply from the destination host, it displays the
reply along with round-trip times.

The ping command uses the following syntax.

ping destination host IP or name


The following command tests connectivity between the host computer and Google's
server.
ping google.com
The following image shows the output of this command.

If you specify the hostname as an argument, the ping command uses the configured DNS
client service to automatically translate the hostname into the IP address.

Ipconfig

This command displays all current TCP/IP network configuration values and refreshes
Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS)
settings. This command is mainly used to view the IP addresses on the computers that
are configured to obtain their IP address automatically.

The following image shows the sample output of this command.


The following table lists some important options of the ipconfig command.

Used without Displays the IP address, subnet mask, and default gateway for all adapters.
parameters
/all Displays the full TCP/IP configuration for all adapters.
/renew [Adapter] Renews DHCP configuration for all adapters (if an adapter is not specified) or for a
specific adapter if the Adapter parameter is included.
/release Sends a DHCPRELEASE message to the DHCP server to release the current DHCP
[Adapter] configuration and discard the IP address configuration for either all adapters (if an
adapter is not specified) or for a specific adapter if the Adapter parameter is included.
/flushdns Flushes and resets the contents of the DNS client resolver cache.
Arp

To send IP packets, a computer needs two addresses. These addresses are the MAC
address and the IP address. A MAC address is the physical or hardware address of the
NIC. An IP address is the logical or software address of NIC. If a computer knows the
IP address of the destination computer but it does not know the MAC address of the
destination computer, it uses the ARP protocol to know the MAC address of the
destination computer.

The ARP protocol broadcasts a given IP address over a local network. The
corresponding host responds to the broadcast with its MAC address. To avoid
repetition, ARP stores the answer in a table known as ARP table. ARP maintains a
separate ARP table for each NIC.

To view the ARP table, you can use the following command.

arp
By default, this command displays the ARP table of the active NIC. If multiple NICs are
installed on the computer, you can use the -a option with this command. If the -a
option is used, the ARP command displays all ARP tables.

The following image shows the output of the arp command when used with the -
a option.
To display the ARP cache entry for a specific IP address, specify the IP address with
the -N option. For example, the following command displays the ARP cache table for
the interface that is assigned the IP address 192.168.42.171.

Arp -a -N 192.168.42.171
The following image shows the output of the above command.

getmac Command

Another very simple command that shows the MAC address of your
network interfaces

Nbtstat

The nbtstat command removes and corrects preloaded entries using a number of
case-sensitive switches. The nbtstat - a <name>** command performs a NetBIOS
adapter status command on the computer name specified by < name> . The adapter
status command returns the local NetBIOS name table for that computer as well as
the MAC address of the adapter card. The nbtstat -A < IP address > command
performs the same function using a target IP address rather than a name.

The nbtstat - c option shows the contents of the NetBIOS name cache, which
contains NetBIOS name-to-IP address mappings.
nbtstat -n displays the names that have been registered locally on the system by
NetBIOS applications such as the server and redirector.

The nbtstat -r command displays the count of all NetBIOS names resolved by
broadcast and by querying a WINS server. The nbtstat -R command purges the
name cache and reloads all #PRE entries from the LMHOSTS file. #PRE entries are the
LMHOSTS name entries that are preloaded into the cache.

O/P:

C:\>nbtstat -S

Local Area Connection:

Node IpAddress: [172.16.0.142] Scope Id: []

Nslookup
Using Nslookup

To illustrate the use of nslookup we are going to use it to:

• Find the IP address of a host.


• Find the domain name of an IP address.
• Find mail servers for a domain.

These are probably the most common usage scenarios.

Finding The IP Address of an Host-

To find the ip address of a host e.g. www.steves-internet-guide.com

type:

nslookup www.steves-internet-guide.com

at a command prompt.
for an interactive lookup:

Reverse Lookup IP address to domain name

Type nslookup IP address

Hostname Command

A very simple command that displays the host name of your machine. This
is much quicker than going to the control panel>system route.
NETDIAG

This command-line diagnostic tool helps to isolate networking and


connectivity problems by performing a series of tests to determine the
state of your network client. These tests and the key network status
information they expose give network administrators and support
personnel a more direct means of identifying and isolating network
problems. Moreover, because this tool does not require parameters or
switches to be specified, support personnel and network administrators
can focus on analyzing the output rather than on training users how to use
the tool.

1. Installing Exchange and you wish to check that you can


connect to other servers.

2. Checking VPN network tunnels on the WAN.

3. DNS problems. Computers cannot ‘see’ their domain


controller on the LAN.

4. A quick check on hotfixes.

5. Check the Network Card Bindings from the command


prompt.

6. You are having problems with IPSEC.

7. Winsock corruption, wrong version incompatibilities.

8. NetDiag checks that Domain Controllers are all able to


‘speak’ LDAP.
Syntax

netdiag [/q] [/v] [/l] [/debug] [/d:DomainName] [/fix] [/DcAccountEnum] [/test:


TestName] [/skip:TestName] [/?]
Parameters
Parameter Description

/q Specifies quiet output (errors only).


/v Specifies verbose output.
/l Sends output to Netdiag.log. This log file is created in the same directory where
Netdiag.exe was run.
Parameter Description

/debug Specifies even more verbose output. With this parameter, NetDiag takes a few
minutes to complete.
/d: DomainName Finds a domain controller in the specified domain.
/fix Fixes minor problems.
/DcAccountEnum Enumerates domain controller computer accounts.
/test: TestName Runs only the listed test(s). TCP/IP must be bound to one or more adapters
before running any of the tests. Nonskippable tests are still run.

Valid TestName values are:


• Autonet - Automatic Private IP Addressing (APIPA) address test. Tests
whether APIPA is in use for the network adapters.

• Bindings - Bindings test. Lists all bindings, including interface name,


lower module name, upper module name, whether the binding is
currently enabled, and the owner of the binding.

• Browser - Redirector and Browser test. Lists the protocols bound to the
Browser service and the redirector.

• DcList - Domain controller list test. Obtains a list of domain controllers


for the domain.

• DefGw - Default gateway test. Attempts to contact each configured


default gateway.

• DNS - DNS test. Tests the availability of the configured DNS servers and
verifies the current client's DNS registrations.

• DsGetDc - Domain controller discovery test. First finds a generic domain


controller from directory service, then finds the primary domain
controller. Then, finds a Windows 2000 domain controller (DC). If the
tested domain is the primary domain, checks whether the domain GUID
stored in Local Security Authority (LSA) is the same as the domain GUID
stored in the DC. If not, the test returns a fatal error; if the /fix option is
on, DsGetDC tries to fix the GUID in LSA.

• IpConfig - IP address configuration test. Enumerates the TCP/IP


configuration information for each network adapter.
Parameter Description

• IpLoopBk - IP address loopback ping test. Pings the IP loopback address


of 127.0.0.1 for each adapter.

• IPsec – Internet Protocol Security (IPsec) test. Tests whether IPsec is


enabled and displays a list of active IPsec policies for the computer.

• IPX - IPX test. Lists statistics for the IPX protocol installed on the
computer.

• Kerberos - Kerberos test. Checks whether the Kerberos package


information is up-to-date.

• Ldap - Lightweight Directory Access Protocol (LDAP) test. Contacts all


available domain controllers and determines which LDAP
authentication protocol is in use.

• Member - Domain membership test. Checks to confirm details of the


primary domain, including computer role, domain name, and domain
GUID. Checks to see if NetLogon service is started, adds the primary
domain to the domain list, and queries the primary domain security
identifier (SID).

• Modem - Modem diagnostics test. Lists configuration information for


each modem found.

• NbtNm - NetBT name test. Similar to the nbtstat -n command. It checks


that the workstation service name <00> is equal to the computer name.
It also checks that the messenger service name <03>, and server service
name <20> are present on all interfaces and that none of these names
are in conflict.

• Ndis - Netcard queries test. Lists the network adapter configuration


details, including the adapter name, configuration, media, globally
unique identifier (GUID), and statistics. If this test shows an
unresponsive network adapter, the remaining tests are aborted.

• NetBTTransports - NetBT transports test. Lists the transport protocols


that are bound to NetBT.
Parameter Description

• Netstat - Netstat information test. Lists protocol statistics and current


TCP/IP connections.

• Netware - Netware test. Queries the nearest Netware server for current
login information.

• Route - Routing table test. Lists static routes and whether they are
persistent.

• Trust - Trust relationship test. Tests trust relationships to the primary


domain only if the computer is a member workstation, member server,
or a Backup Domain Controller (BDC) domain controller that is not a
PDC emulator. Checks that the primary domain security identifier (SID)
is correct. Contacts an active DC. Connects to the SAM server on the
DC. Uses the domain SID to open the domain to verify whether the
domain SID is correct. Queries info of the secure channel for the
primary domain. If the computer is a BDCDC, reconnects to the PDC
emulator. If the computer is a member workstation or server, sets
secure channel to each DC on the DC list for this domain.

• WAN - Wide Area Network (WAN) configuration test. Lists settings and
status on each COM port currently in use.

• WINS - Windows Internet Name Service (WINS) service test. Tests the
availability of the configured WINS server and the validity of the client
registrations.

• Winsock - Winsock test. Lists protocols and ports available to the


WinSock service.

/skip: TestName Skips the test specified by TestName. Nonskippable tests will still run.

Valid TestName values are:

• Autonet - Automatic Private IP Addressing (APIPA) address test.

• Bindings - Bindings test.

• Browser - Redir and Browser test.


Parameter Description

• DcList - Domain controller list test.

• DefGw - Default gateway test.

• DNS - DNS test.

• DsGetDc - Domain controller discovery test.

• IpConfig - IP address configuration test.

• IpLoopBk - IP address loopback ping test.

• IPX - IPX test.

• Kerberos - Kerberos test.

• Ldap - Lightweight Directory Access Protocol (LDAP) test.

• Modem - Modem diagnostics test.

• NbtNm - NetBT name test.

• Netstat - Netstat information test.

• Netware - Netware test.

• Route - Routing table test.

• Trust - Trust relationship test.

• WAN - Wide Area Network (WAN) configuration test.

• WINS - Windows Internet Name Service (WINS) test.


PathPing
The PathPing tool is a route tracing tool that combines features of Ping and Tracert with
additional information that neither of those tools provides. PathPing sends packets to each router
on the way to a final destination over a period of time, and then computes results based on the
packets returned from each hop. Since PathPing shows the degree of packet loss at any given
router or link, you can pinpoint which routers or links might be causing network problems.

Input :
C:\Users\Mahesh>pathping www.google.com
Output:
Tracing route to www.google.com [2404:6800:4007:828::2004]
over a maximum of 30 hops:
0 DESKTOP-2REB81Q [2409:4070:4d9a:ec33:1cfc:90ee:79b5:d4bf]
1 2409:4070:4d9a:ec33::82
2 * * *
Computing statistics for 25 seconds...
Source to Here This Node/Link
Hop RTT Lost/Sent = Pct Lost/Sent = Pct Address
0 DESKTOP-2REB81Q [2409:4070:4d9a:ec33:1cfc:90ee:79b5:d4bf]
0/ 100 = 0% |
1 13ms 0/ 100 = 0% 0/ 100 = 0% 2409:4070:4d9a:ec33::82
Trace complete.
telnet
To use telnet, follow the steps below:

1. First, find out the ip address of the server/main computer. For this you
need to access the server and use the ipconfig command in MS-DOS.
See this link for more details about this command.
2. Select the Windows key and the R key.
3. In the Run box type CMD.
4. Select OK.
5. Type Telnet <IP Address> 13531
o Note: Do not include the <> when entering the IP Address.
6. If you see a blank cursor then the connection is fine. You can close the
command prompt window.
7. If you receive the message that 'telnet' is not recognized as an internal
or external command, operable program, or batch file, you will want to
enable Telnet.
o To enable Telnet, follow these steps:
o Select Start > Control Panel > then Programs and
Features (or Programs)
o Select Turn Windows Features on or off
o heck the box for both Telnet Client and Telnet Server
o Select OK.
o Verify that you can now Telnet the port.

Example:
If the server's ip address is 192.168.0.100, then:

1. Open command prompt on the workstation computer.


2. Type: telnet 192.168.0.100 13531

FTP
To connect to and use FTP from a command line
interface, like MS-DOS or the Linux shell, click a link
below for instructions.
Connect using FTP
To connect to another computer using FTP at the MS-DOS prompt,
command line, or Linux shell, type FTP, and press Enter. Once in FTP,
use the open command to connect to the FTP server, as shown in the
following example.
open ftp.example.com

In the example above, you'd substitute example.com for the domain


name or IP address of where you are connecting. An example would
be open 192.168.1.12.

Once connected, a username and password prompt appears.


Once these credentials are entered, the server lets you
browse, send, or receive files, depending on your rights. Some
servers may also allow anonymous logins using guest or an e-
mail address.

Send and receive a file in FTP


To get files from the server onto your computer, use the get
command, as shown in the following example. In this example, you
would get the file myfile.htm.

get myfile.htm

Use the send command, as shown in the following example, to move


a file to another connected computer. In this example, we are sending
the myfile.htm to the current directory.

send myfile.htm

It is important to realize that the files sent must be in your local


working directory. In other words, the directory you were in when
you typed the FTP command. If you want to change to
the local directory containing your files, use the lcd command. For
example, in Windows, you'd type lcd c:\windows to set the local
directory to the Windows directory.

FTP commands
Depending on the version of FTP and the operating system, each of
the following commands may or may not work. Typing -help or
a ? lists the commands available to you. Below is a general
description of FTP commands available in the Windows command line
FTP command.

Command Information

! The exclamation point command


switches temporarily from FTP to
operating system. When using the
operating system,
typing exit takes you back to the
FTP command line.

? Access the help screen.

append Append text to a local file.

ascii Switch to ASCII transfer mode.

Bell Turns bell mode on or off.

binary Switches to binary transfer mode.

Bye Exits from FTP.

Cd Changes directory.

close Exits from FTP.


delete Deletes a file.

debug Sets debugging on or off.

Dir Lists files if connected.

dir -C lists the files in wide


format.
dir -1 lists the files in bare format
in alphabetic order
dir -r lists directory in reverse
alphabetic order.
dir -R lists all files in current
directory and subdirectories.
dir -S lists files in bare format in
alphabetic order.

disconnect Exits from FTP.

Get Grabs file from the connected


computer.

Glob Sets globbing on or off. When


turned off the file name in the put
and get commands is taken
literally and wildcards are not
used.

hash Sets hash mark printing on or off.


When turned on, for each 1024
bytes of data received, a hash
mark (#) is displayed.

Help Access the help screen and


displays information about
command if command typed after
help.

Lcd Displays local directory if typed


alone, or if path typed after lcd,
changes local directory.

literal Sends a literal command to the


connected computer with an
expected one line response.

Ls Lists files of the remotely


connected computer.

mdelete Multiple delete.

mdir Lists contents of multiple remote


directories.

mget Get multiple files.

mkdir Make directory.


Mls Lists contents of multiple remote
directories.

mput Sent multiple files

open Opens address.

prompt Enables or disables the prompt.

Put Send one file.

Pwd Print working directory.

Quit Exits from FTP.

quote Same as the literal command.

Recv Receive file.

remotehelp Get help from remote server.

rename Renames a file.

rmdir Removes a directory on the


remote computer.

send Send single file.


status Shows status of currently enabled
and disabled options.

trace Toggles packet tracing.

Type Set file transfer type.

user Send new user information.

verbose Sets verbose on or off.

You might also like