The network commands which can be useful when networking with other computers both within the network and across the internet, obtaining more information about other computers. When using command-line tools in Windows Vista it is healthy to remember to launch the command prompt window with administrative privileges. In order to do so, press [windows button + R] enter "cmd"
Tracert will show the route of a packet being sent and received. It attempts to list the series of hops through which your packets travel on their way to a given destination.
You get this error in windows 7 because unlike XP ,Vista does not support telnet command by default. So, for this you have to manually enable/turn on the telnet feature in windows 7
The function and syntax of the Windows ROUTE command is similar to the UNIX or Linux route command. Use the command to manually configure the routes in the routing table.
ftp
Displays information that you can use to diagnose Domain Name System (DNS) information such as ns, a, mx, txt, etc. The Nslookup command-line tool is available only if you have installed the TCP/IP protocol.
This tool will enable you to display the MAC addresses for network adapters on a system. The Media Access Control (MAC) address for the network card can be accessed both on the local computer and on a network.
nbtstat utility that displays protocol statistics and current TCP/IP connections using NBT.
netstat
Displays active TCP connections, status of ports are i.e. open, closed, waiting, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, netstat displays active TCP connections. It will also display various other things. It has many different options.
-a | Displays all connections and listening ports. |
-e | Displays Ethernet statistics. This may be combined with the -s option. |
-n | Displays addresses and port numbers in numerical form. |
-p | Proto Shows connections for the protocol specified by proto; proto may be TCP or UDP. If used with the -s option to display per-protocol statistics, proto may be TCP, UDP, or IP. |
-r | Displays the routing table. |
-s | Displays per-protocol statistics. By default, statistics are shown for TCP, UDP and IP; the -p option may be used to specify a subset of the default. |
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. |
ipconfig
Displays the network settings currently assigned to any or all network adapters in the machine. This command can be utilized to verify a network connection as well as to verify your network settings and the command could be /all, /flushdns, /renew /release etc.
/all | Display full configuration information. |
/release | Release the IP address for the specified adapter. |
/renew | Renew the IP address for the specified |
/flushdns | Purge the DNS Resolver cache. |
/registerdns | Refresh all DHCP leases and re-register DNS names. |
/displaydns | Display the contents of the DNS Resolver Cache. |
/showclassid | Display all the DHCP class IDs allowed for adapter. |
/setclassid | Modify the dhcp class id. |
tracert
Tracert will show the route of a packet being sent and received. It attempts to list the series of hops through which your packets travel on their way to a given destination.
-d | Do not resolve addresses to hostnames |
-h | Maximum number of hops to search for target |
-j | Loose source route along host-list <IPV4 only> |
-w | Wait timeout milliseconds for each reply. |
-R | Trace round – trip path <IPV6 only> |
-S | Source address to use <IPV6 only> |
-4 | Force using IPV4 |
-6 | Force using IPV6 |
ping
The ping command helps in determining TCP/IP Networks IP address as well as determine issues with the network by sending echo requests to the host you specify on the command line, and lists the responses received their round trip time and assists in resolving them.
-t | Ping the specified host until stopped |
-a | Resolve address to hostnames |
-n count | Number of echo requests to send |
-l size | Send buffer size |
-I TTL | Time to live |
-f | Set don’t fragment flag in packet <IPV4 only> |
-v TOS | Type of service <IPV4 only This setting has been deprecated 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> |
-S srcaddr | Source address to use |
-4 | Force using IPV4 |
-6 | Force using IPV6 |
pathping
Pathping is the advance (newer version) of tracert Provides information about network latency and network loss at intermediate hops between a source and destination. Pathping sends multiple Echo Request messages to each router between a source and destination over a period of time and then computes results based on the packets returned from each router.
-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 |
telnet
Telnet is software that allows users to remotely access another computer such as a server, network device, or other computer. With telnet users can connect to a device or computer, manage a network device, setup a device, transfer files, etc.
Here’s the step by step procedure to enable telnet feature (telnet command) in Windows Vista/7.
1. Go to the Control Panel.
2. Click on the sub heading Uninstall a program under the main heading Programs.
NOTE: IF you are in the Classic View click on Programs and Features.
3. Now in the left panel under the Tasks select the option Turn Windows features on or off.
4. Check Telnet Client
Hit OK
-a | Attempt automatic logon on user’s name. |
-e | Escape character to enter telnet client prompt. |
-f | File name for client side logging |
-l | Specifies the user name to log in with on the remote system. |
-t | Specifies terminal type. |
host | Specifies the hostname or IP address of the remote computer |
port | Specifies a port number or service name. |
route
The function and syntax of the Windows ROUTE command is similar to the UNIX or Linux route command. Use the command to manually configure the routes in the routing table.
-f | Clears the routing table of all gateway entries. |
-p | When used with the ADD command, make a route persistent across boots of the system. By default, routes are not preserved when the system is restarted. Ignored for all other commands, which always affect the appropriate persistent routes. |
Command | One of these: |
PRINT | Prints a route |
ADD | Adds a route |
DELETE | Deletes a 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. |
gateway | Specifies gateway. |
interface | The interface number for the specified route. |
METRIC | Specifies the metric, i.e., cost for the destination. |
FTP is short for File Transfer Protocol; this page contains additional information about the FTP command and help using that command in UNIX and MS-DOS (Windows).
Command | Description |
! | Preceding a command with the exclamation point will cause the command to execute on the local system instead of the remote system. |
? | Request assistance or information about the FTP commands. This command does not require a connection to a remote system. |
ascii | Set the file transfer mode to ASCII (Note: this is the default mode for most FTP programs). |
bell | Turns bell mode on / off. This command does not require a connection to a remote system. |
binary | Set the file transfer mode to binary (Note: the binary mode transfers all eight bits per byte and must be used to transfer non-ASCII files). |
bye | Exit the FTP environment (same as quit). This command does not require a connection to a remote system. |
cd | Change directory on the remote system. |
close | Terminate a session with another system. |
debug | Sets debugging on/off. This command does not require a connection to a remote system. |
delete | Delete (remove) a file in the current remote directory (same as rm in UNIX). |
dir | Lists the contents of the remote directory. The asterisk (*) and the question mark (?) may be used as wild cards. For example: |
get | WIP |
help | Request a list of all available FTP commands. This command does not require a connection to a remote system. |
lcd | Change directory on your local system (same as CD in UNIX). |
ls | List the names of the files in the current remote directory. |
mget | WIP |
mkdir | Make a new directory within the current remote directory. |
mput | Copy multiple files from the local system to the remote system. (Note: You will be prompted for a "y/n" response before copying each file). |
open | Open a connection with another system. |
put | Copy a file from the local system to the remote system. |
pwd | Find out the pathname of the current directory on the remote system. |
quit | Exit the FTP environment (same as "bye"). This command does not require a connection to a remote system. |
rmdir | Remove (delete) a directory in the current remote directory. |
trace | Toggles packet tracing. This command does not require a connection to a remote system. |
nslookup
NAME | print info about the host/domain NAME using default server | ||||||||||||||||||||||||||||||||||
NAME1 NAME2 | as above, but use NAME2 as server | ||||||||||||||||||||||||||||||||||
help or ? | print info on common commands | ||||||||||||||||||||||||||||||||||
set OPTION | set an option
| ||||||||||||||||||||||||||||||||||
server NAME | set default server to NAME, using current default server | ||||||||||||||||||||||||||||||||||
lserver NAME | set default server to NAME, using initial server | ||||||||||||||||||||||||||||||||||
finger [USER] | finger the optional NAME at the current default host | ||||||||||||||||||||||||||||||||||
Root | set current default server to the root | ||||||||||||||||||||||||||||||||||
ls [opt] DOMAIN [> FILE] | list addresses in DOMAIN (optional: output to FILE)
| ||||||||||||||||||||||||||||||||||
view FILE | sort an 'ls' output file and view it with pg | ||||||||||||||||||||||||||||||||||
Exit | exit the program |
arp
Displays, adds, and removes arp information from network devices.
Displays, adds, and removes arp information from network devices.
-a | Displays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed. |
-g | Same as –a |
inet_addr | Specifies an Internet address. |
-N if addr | Displays the ARP entries for the network interface specified by if_addr. |
-d | Deletes the host specified by inet_addr. |
-s | Adds the host and associates the Internet address inet_addr with the Physical address eth_addr. The Physical address is given as 6 hexadecimal bytes separated by hyphens. The entry is permanent. |
eth_addr | Specifies a physical address |
if_addr | If present, this specifies the Internet address of the interface whose address translation table should be modified. If not present, the first applicable interface will be used. |
getmac
/S system | Specifies the remote system to connect to. |
/U [domain\]user | Specifies the user context under which the command should execute. |
/P [password] | Specifies the password for the given user context. Prompts for input if omitted. |
/FO format | Specifies the format in which the output is to be displayed. |
/NH | Specifies that the “Column Header” should not be displayed in the output. |
/V | Specifies that verbose output is displayed |
/? | Displays this help message. |
hostname
Tells the user the host name of the computer they are logged into.
nbtstat
nbtstat utility that displays protocol statistics and current TCP/IP connections using NBT.
-a | (adapter status) Lists the remote machine's name table given its name |
-e | (Adapter status) Lists the remote machine's name table given its |
-A | Displays addresses and port numbers in numerical form. |
-c | (cache) Lists the remote name cache including the IP addresses |
-n | (names) Lists local NetBIOS names. |
-r | (resolved) Lists names resolved by broadcast and via WINS |
-R | (Reload) Purges and reloads the remote cache name table |
-S | (Sessions) Lists sessions table with the destination IP addresses. |
-s | (sessions) Lists sessions table converting destination IP addresses to host names via the hosts file. |
RemoteName | Remote host machine name. |
IP address | Dotted decimal representation of the IP address. |
interval | Redisplays selected statistics, pausing interval seconds between each display. Press Ctrl+C to stop redisplaying statistics. |
net
Net is a general tool with commands covering a broad range of functionality.
NET ACCOUNTS | Adjust account settings. [/FORCELOGOFF:{minutes | NO}] [/MINPWLEN:length] [/MAXPWAGE:{days | UNLIMITED}] [/MINPWAGE:days] [/UNIQUEPW:number] [/DOMAIN] |
NET COMPUTER | Add other networked computers with Windows Domain Controller. \\computername {/ADD | /DEL} |
NET CONFIG | Displays your current server or workgroup settings. [SERVER | WORKSTATION] |
NET CONTINUE | Continues the use of service. [service] |
NET FILE | Display opened shared files on the server. [id [/CLOSE]] |
NET GROUP | Add, delete, view, and otherwise manage network workgroups. [groupname [/COMMENT:"text"]] [/DOMAIN] groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN] groupname username [...] {/ADD | /DELETE} [/DOMAIN] |
NET LOCALGROUP | Add, delete, view, and otherwise manage network groups. [groupname [/COMMENT:"text"]] [/DOMAIN] groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN] groupname name [...] {/ADD | /DELETE} [/DOMAIN] |
NET NAME | Create or delete name used for messaging. [name [/ADD | /DELETE]] |
NET PAUSE | Pause the specified network service. [service] |
NET PRINT | Manage network print jobs. \\computername\sharename [\\computername] job# [/HOLD | /RELEASE | /DELETE] |
NET SEND | Sends messages to other users, computers, or messaging names on the network. The Messenger service must be running to receive messages. You can send a message only to a name that is active on the network. If the message is sent to a username, that user must be logged on and running the Messenger service to receive the message. {name | * | /DOMAIN[:name] | /USERS} message |
NET SESSION | Display all sessions connected to the computer and deletes them if specified. [\\computername] [/DELETE] |
NET SHARE | Create and manage a local network share. sharename sharename=drive:path [/USERS:number | /UNLIMITED] [/REMARK:"text"] [/CACHE:Manual | Documents| Programs | None ] sharename [/USERS:number | /UNLIMITED] [/REMARK:"text"] [/CACHE:Manual | Documents | Programs | None] {sharename | devicename | drive:path} /DELETE |
NET START | Start the specified network service. [service] |
NET STATISTICS | Display network statistics of the workstation or server. [WORKSTATION | SERVER] |
NET STOP | Stop the specified network service. Service |
NET TIME | Display the time and date of another network computer. [\\computername | /DOMAIN[:domainname] | /RTSDOMAIN[:domainname]] [/SET] [\\computername] /QUERYSNTP [\\computername] /SETSNTP[:ntp server list] |
NET USE | Connects or disconnects your computer from a shared resource or displays information about your connections. [devicename | *] [\\computername\sharename[\volume] [password | *]] [/USER:[domainname\]username] [/USER:[dotted domain name\]username] [/USER:[username@dotted domain name] [/SMARTCARD] [/SAVECRED] [[/DELETE] | [/PERSISTENT:{YES | NO}]] NET USE {devicename | *} [password | *] /HOME NET USE [/PERSISTENT:{YES | NO}] |
NET USER | Displays users on the computer or domain. [username [password | *] [options]] [/DOMAIN] username {password | *} /ADD [options] [/DOMAIN] username [/DELETE] [/DOMAIN] |
NET VIEW | Displays a list of computers in a specified workgroup or the shared resources available on a specified computer. [\\computername [/CACHE] | /DOMAIN[:domainname]] NET VIEW /NETWORK:NW [\\computername] |
netsh
netsh is a command-line scripting utility that allows you to, either locally or remotely, display, modify or script the network configuration of a computer that is currently running.
The netsh command is used for the unified tracing operation available in Windows 7. You can use the Netsh.exe tool to perform the following tasks:
- Configure routes.
- Configure filters.
- Configure routing protocols.
- Configure interfaces.
- Display the configuration of a currently running router on any computer.
- Configure remote access behavior for Windows-based remote access routers that are running the Routing and Remote Access Server (RRAS) Service.
- Use the scripting feature to run a collection of commands in batch mode against a specified router.
The syntax for the Netsh.exe tool is:
netsh [-r router name] [-a AliasFile] [-c Context] [Command | -f ScriptFile]
To learn how to use Netsh with its switches and parameters, type the context name followed by a space and a? at the netsh> command prompt. Netsh /?. Or to display a list of subcontext and commands that can be used in the interface context, type Netsh Interface / ?
netsh [-r router name] [-a AliasFile] [-c Context] [Command | -f ScriptFile]
To learn how to use Netsh with its switches and parameters, type the context name followed by a space and a? at the netsh> command prompt. Netsh /?. Or to display a list of subcontext and commands that can be used in the interface context, type Netsh Interface / ?
? | Displays a list of commands. |
Add | Adds a configuration entry to a list of entries. |
advfirewall | Changes to the `netsh advfirewall' context. |
Branchcache | Changes to the `netsh branchcache' context. |
Bridge | Changes to the `netsh bridge' context. |
Delete | Deletes a configuration entry from a list of entries. |
Dhcpclient | Changes to the `netsh dhcpclient' context. |
Dnsclient | Changes to the `netsh dnsclient' context. |
Dump | Displays a configuration script. |
Exec | Runs a script file. |
Firewall | Changes to the `netsh firewall' context. |
Help | Displays a list of commands. |
http | Changes to the `netsh http' context. |
Interface | Changes to the `netsh interface' context. |
Ipsec | Changes to the `netsh ipsec' context. |
Lan | Changes to the `netsh lan' context. |
Mbn | Changes to the `netsh mbn' context. |
Namespace | Changes to the `netsh namespace' context. |
Nap | Changes to the `netsh nap' context. |
Netio | Changes to the `netsh netio' context. |
P2p | Changes to the `netsh p2p' context. |
Ras | Changes to the `netsh ras' context. |
Rpc | Changes to the `netsh rpc' context. |
Set | Updates configuration settings. |
Show | Displays information. |
Trace | Changes to the `netsh trace' context. |
Wcn | Changes to the `netsh wcn' context. |
Wfp | Changes to the `netsh wfp' context. |
Winhttp | Changes to the `netsh winhttp' context. |
Winsock | Changes to the `netsh winsock' context. |
Wlan | Changes to the `netsh wlan' context. |
No comments:
Post a Comment