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

Networking Command

The document provides information on several Windows network commands: 1. Ping allows you to test connectivity to a device and returns data packets. 2. Netstat displays active TCP connections, listening ports, routing tables, and statistics. 3. Ipconfig displays basic IP configuration like IP addresses for network adapters. 4. Hostname simply displays the current computer name.

Uploaded by

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

Networking Command

The document provides information on several Windows network commands: 1. Ping allows you to test connectivity to a device and returns data packets. 2. Netstat displays active TCP connections, listening ports, routing tables, and statistics. 3. Ipconfig displays basic IP configuration like IP addresses for network adapters. 4. Hostname simply displays the current computer name.

Uploaded by

Dhruvik Tank
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Dhruvik Tank 206170307025 C.N.S.

(3350704)

Networking Command

1. Ping :- The Ping command allows you to test the reachability of a device on
a network. Pinging a host should return four data packets, if the data
packets are not returned you know there is a problem with your network
connection.

Syntax : ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]

[-r count] [-s count] [[-j host-list] | [-k host-list]]

[-w timeout] [-R] [-S srcaddr] [-c compartment] [-p]

[-4] [-6] target_name

Options:

-t Ping the specified host until stopped.

To see statistics and continue - type Control-Break;

To stop - type Control-C.

-a Resolve addresses to hostnames.

-n count Number of echo requests to send.

-l size Send buffer size.

-f Set Don't Fragment flag in packet (IPv4-only).

-i TTL Time To Live.

-v TOS Type Of Service (IPv4-only. This setting has been deprecated

1|Page
Dhruvik Tank 206170307025 C.N.S. (3350704)

and has no effect on the type of service field in the IP

Header).

-r count Record route for count hops (IPv4-only).

-s count Timestamp for count hops (IPv4-only).

-j host-list Loose source route along host-list (IPv4-only).

-k host-list Strict source route along host-list (IPv4-only).

-w timeout Timeout in milliseconds to wait for each reply.

-R Use routing header to test reverse route also (IPv6-only).

Per RFC 5095 the use of this routing header has been

deprecated. Some systems may drop echo requests if

this header is used.

-S srcaddr Source address to use.

-c compartment Routing compartment identifier.

-p Ping a Hyper-V Network Virtualization provider address.

-4 Force using IPv4.

-6 Force using IPv6.

Example

2|Page
Dhruvik Tank 206170307025 C.N.S. (3350704)

2. NetStat :- The Netstat command displays active TCP connections, ports on


which the computer is listening, Ethernet statistics, the IP routing table,
IPv4 statistics, and IPv6 statistics. When used without parameters, this
command displays active TCP connections.

Options
NETSTAT [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-t] [-x] [-y] [interval]

-a Displays all connections and listening ports.

-b Displays the executable involved in creating each connection or

listening port. In some cases well-known executables host

multiple independent components, and in these cases the

sequence of components involved in creating the connection

or listening port is displayed. In this case the executable

name is in [] at the bottom, on top is the component it called,

and so forth until TCP/IP was reached. Note that this option

can be time-consuming and will fail unless you have sufficient

permissions.

-e Displays Ethernet statistics. This may be combined with the -s

option.

-f Displays Fully Qualified Domain Names (FQDN) for foreign

addresses.

-n Displays addresses and port numbers in numerical form.

3|Page
Dhruvik Tank 206170307025 C.N.S. (3350704)

-o Displays the owning process ID associated with each connection.

-p proto Shows connections for the protocol specified by proto; proto

may be any of: TCP, UDP, TCPv6, or UDPv6. If used with the -s

option to display per-protocol statistics, proto may be any of:

IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.

-q Displays all connections, listening ports, and bound

nonlistening TCP ports. Bound nonlistening ports may or may not

be associated with an active connection.

-r Displays the routing table.

-s Displays per-protocol statistics. By default, statistics are

shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6;

the -p option may be used to specify a subset of the default.

-t Displays the current connection offload state.

-x Displays NetworkDirect connections, listeners, and shared

endpoints.

-y Displays the TCP connection template for all connections.

Cannot be combined with the other options.

interval Redisplays selected statistics, pausing interval seconds

between each display. Press CTRL+C to stop redisplaying

statistics. If omitted, netstat will print the current

configuration information once.

4|Page
Dhruvik Tank 206170307025 C.N.S. (3350704)

3. Ip Config :- The IPConfig command displays basic IP address configuration


information for the Windows device you are working on. In fact, the
command will display information for every network adapter that has ever
been installed on your Windows computer.

Syntax:

ipconfig [/allcompartments] [/? | /all |

/renew [adapter] | /release [adapter] |

/renew6 [adapter] | /release6 [adapter] |

/flushdns | /displaydns | /registerdns |

/showclassid adapter |

/setclassid adapter [classid] |

/showclassid6 adapter |

/setclassid6 adapter [classid] ]

where

adapter Connection name

(wildcard characters * and ? allowed, see examples)

Options:

/? Display this help message

/all Display full configuration information.

5|Page
Dhruvik Tank 206170307025 C.N.S. (3350704)

/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.

Example

6|Page
Dhruvik Tank 206170307025 C.N.S. (3350704)

4. Hostname :- The Windows HostName network command will simply


display the current name of your Windows computer .

Syntax: Hostname

Example

5. Tracert :- This command will trace the route a data packet takes before
reaching its destination, displaying information on each hop along the
route. Each hop of the route will display the latency between your device
and that particular hop and the IP address of the hop .
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout]

[-R] [-S srcaddr] [-4] [-6] target_name

Options:

-d Do not resolve addresses to hostnames.

-h maximum_hops Maximum number of hops to search for target.

-j host-list Loose source route along host-list (IPv4-only).

-w timeout Wait timeout milliseconds for each reply.

-R Trace round-trip path (IPv6-only).

-S srcaddr Source address to use (IPv6-only).

-4 Force using IPv4.

-6 Force using IPv6.

7|Page
Dhruvik Tank 206170307025 C.N.S. (3350704)

Example

6. Nslookup :- The NSLookUp Windows network command displays


information that you can use to diagnose Domain Name System (DNS)
infrastructure. Using NSLookUp without a parameter will show the DNS
server your PC is currently using to resolve domain names into IP
addresses.

Syntax: NSLookUp

8|Page
Dhruvik Tank 206170307025 C.N.S. (3350704)

7. Arp :- The Windows 10 network command Arp displays entries in the


Address Resolution Protocol (ARP) cache, which contains one or more
tables that are used to store IP addresses and their resolved Ethernet
physical addresses.

Syntax: arp /a

8. Route :- IP networks use routing tables to direct packets from one subnet
to another. The Windows Route utility allows you to view the device’s
routing tables. To do so, simply type Route Print.

The cool thing about the Route command is that it not only shows you the
routing table, it lets you make changes. Commands such as Route Add,
Route Delete, and Route Change allow you to make routing table
modifications on an as needed basis. The changes that you make can be
persistent or nonpersistent, depending on whether you use the -P switch.
ROUTE [-f] [-p] [-4|-6] command [destination]

[MASK netmask] [gateway] [METRIC metric] [IF interface]

-f Clears the routing tables of all gateway entries. If this is

used in conjunction with one of the commands, the tables are

cleared prior to running the command.

-p When used with the ADD command, makes a route persistent across

boots of the system. By default, routes are not preserved

9|Page
Dhruvik Tank 206170307025 C.N.S. (3350704)

when the system is restarted. Ignored for all other commands,

which always affect the appropriate persistent routes.

-4 Force using IPv4.

-6 Force using IPv6.

command One of these:

PRINT Prints a route

ADD Adds a route

DELETE Deletes a route

CHANGE Modifies an existing route

destination Specifies the host.

MASK Specifies that the next parameter is the 'netmask' value.

netmask Specifies a subnet mask value for this route entry.

If not specified, it defaults to 255.255.255.255.

gateway Specifies gateway.

interface the interface number for the specified route.

METRIC specifies the metric, ie. cost for the destination.

10 | P a g e
Dhruvik Tank 206170307025 C.N.S. (3350704)

9. PathPing :- The Windows 10 network command PathPing combines the


ping command with the tracert command, providing information about
network latency and network loss at intermediate hops between a source
and destination.

Syntax: pathping [-g host-list] [-h maximum_hops] [-i address] [-n]

[-p period] [-q num_queries] [-w timeout]

[-4] [-6] target_name

Options:

-g host-list Loose source route along host-list.

-h maximum_hops Maximum number of hops to search for target.

-i address Use the specified source address.

-n Do not resolve addresses to hostnames.

-p period Wait period milliseconds between pings.

-q num_queries Number of queries per hop.

-w timeout Wait timeout milliseconds for each reply.

-4 Force using IPv4.

-6 Force using IPv6.

11 | P a g e
Dhruvik Tank 206170307025 C.N.S. (3350704)

10. Getmac :- Every network capable device on the internet has a unique
identifying number called its MAC address. The number is assigned during
manufacture and is established in the hardware of the device. Using the
Getmac command, a user can determine the MAC address of their various
network devices.

Syntax: getmac

12 | P a g e

You might also like