Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WIN Networking Commnands. PLS contribute 4

Status
Not open for further replies.

ponetguy2

MIS
Aug 28, 2002
442
US
Hello Everyone,

I would like to collect a list of networking commands for windows. Please add a command so we can have a nice reference manual for administering our windows networking environment. I've successfully collected a list of Sun networking commands and it proved to be very valuable. I hope we can be just as successfull with this attempt.

Here is my contribution:

tracert: The tracert command is used to visually see a network packet being sent and received and the amount of hops required for that packet to get to its destination.

c:\tracert <hostname or IP>

ping: This utility is used to check if a certain host is online.

c:\ping <hostname or IP>

pathping: At a dos prompt if you want detailed info about your network, type the following:

C:\pathping <IPADDRESS>


net helpmsg: if you have error messages from pathping, do the following:

c:\net helpmsg <ERRORNUMBER>

Thank you,

ponetguy2

Carlo Reyes
 
More tips:

How to add view a route:

C:\route PRINT
or
C:\netstat -rn

How to add a route and make it permanent:

route add -p 89.0.0.0 MASK 255.0.0.0 118.0.0.1
route add -p [makes permanent] [destination] [subnet mask] [gateway]

route delete -p xx.xx.xx.xx. MASK xxx.xxx.xxx.xxx XXX.XXX.XXX.X
 
More tips:

How to check for local workstation network configuration:

C:\ipconfig or ipconfig /all

Output from ipconfig command:
C:\>ipconfig

Windows 2000 IP Configuration

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : eg.deutsche-boerse.de
IP Address. . . . . . . . . . . . : 172.20.12.40
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 172.20.12.3
 
&quot;net use&quot; to show mapped drives, or to map drives, etc...

&quot;nbtstat -a (and ip addr)&quot; Displays protocol statistics and current TCP/IP connections using NBT, also useful for getting mac addr, I use it for getting mac for Wake on lan.

&quot;Shutdown -a&quot; to abort the shutdown that MSBLASTER worm starts. Do a /? for more on that...

&quot;net send&quot; to send messages, without IM's... ;p

many more (I'm sure they'll come flying in!)



 
To view the network share of a machine:
>net share

To flush your DNS cache
>ipconfig/flushdns

To register your DNS name on the DNS server
>ipconfig/registerdns

To add/remove/modify user account
>net user

NET USER [username [password | *] [options]] [/DOMAIN]
username {password | *} /ADD [options] [/DOMAIN]
username [/DELETE] [/DOMAIN]

And a lot more...
 
More tips:

arp

The arp command is used to analyze problem with IP to Ethernet address translation. The arp command has three useful
options for troubleshooting:

-a
Display all ARP entries in the table.

-d hostname
Delete an entry from the ARP table

-s hostname ether-address
Add a new entry to the table.

With these three options you can view the contents of the ARP table, delete a problem entry, and install a corrected

entry. The ability to install a corrected entry is useful in &quot;buying time&quot; while you look for a permanent fix.

Use arp if you suspect that incorrect entries are getting into the address resolution table. One clear indication of

problems with the ARP table is a report that the &quot;wrong&quot; host responded to some command, like ftp or telnet.

Intermittent problems that affect only certain hosts can also indicate that the ADP table has been corrupted. ARP

table problems are usually caused by two systems using the same IP address. The problems appear intermittent,

because the entry that appears in the table is the address of the host that responded quickest to the last ARP

request. Sometimes the &quot;correct&quot; host responds first, and sometimes the &quot;wrong&quot; host responds first.

If you suspect that two systems are using the same IP address, display the address resolution table with the

arp -a command. Here's an example from a Solaris system:

%arp ?a
Net to Media Table
Device IP Address Mask Flags Phys Addr
------ ---------- ---- ----- -------------
1e0 peanut.nuts.com 255.255.255.255 08:00:20:05:21:33
1e0 pecan.nuts.com 255.255.255.255 00:00:0c:e0:80:b1
1e0 almond.nuts.com 255.255.255.255 SP 08:00:20:22:fd:51
1e0 BASE-ADDRESS.MCAST.NET 240.0.0.0 SM 01:00:5e:00:00:00

It is easiest to verify that the IP and Ethernet address pairs are correct if you have a record of each host's

correct Ethernet address. For this reason, you should record each host's Ethernet and IP address when it is added

to your network. If you have such a record, you'll quickly see if anything is wrong with the table.

If you don't have this type of record, the first three bytes of the Ethernet address can help you detect a problem.

The first three bytes of the address identify the equipment manufacturer. A list of these identifying prefixes is

found in the Assigned Numbers RFC, in the section entities Ethernet Vendor Address Components.&quot; This information is

also available at ftp://ftp.isi.edu/in-notes/ianan/assignments/ethernet-numbers.

From the vendor prefixes we see that two of the ARP entries displayed in our example are Sun systems (8:0:20). If

pecan is also supposed to be a Sun, the 0:0:0c Cisco prefix indicates that a Cisco router has been mistakenly

configured with pecan's IP address.

If neither checking is a record of assignments nor checking the manufacturer prefix helps you identify the source

of the errant ARP, try using telnet to connect to the IP address shown in the ARP entry. If the device supports

telnet, the login banner might help you identify the incorrectly configured host.
 
Great link from blin2000!!! Thank you to everyone who contributed. I will keep adding usefull commands as I stumble into them.

Thanx,

ponetguy2
 
What the hey, take it one step further. Before I figured out the networking problems I was having with my home network, (Not getting an IP address from my isp), I made up a batch file.

ipconfig /release
ipconfig /renew
pause

Named it ip.bat. This would drop any ip address that wouldn't work, then generate a new one and pause to let me see what the new ip was. (Turned out I needed to clone the mac address to my router so the isp only saw one ip, then used dhcp for the rest of my machines. Sitting on the back porch with my wireless laptop surfing the net as we type.) Man I love technology!

Great post! Dave, if you're listening, put this at the top!

Glen A. Johnson
Johnson Computer Consulting
MCP W2K
glen@nellsgiftbox.com

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884

&quot;Once the game is over, the king and the pawn return to the same box.&quot;
 
How to move the FSMO roles from one DC to another (this is a step-by-step) (I am assuming that you are at the console of the target server):

>ntdsutil
ntdsutil: roles
fsmo maintenance: connections
server connections: connect to server [your server name]
server connections: quit
fsmo maintenance: select operation target
select operation target: list domains
select operation target: select domain [domain # from list(probably 0)]
select operation target: list sites
select operation target: select site [site # from list]
select operation target: list servers in site
select operation target: select server [server # from list]
select operation target: quit
fsmo maintenance: tranfer pdc
fsmo maintenance: transfer schema master
fsmo maintenance: transfer infrastructure master
fsmo maintenance: transfer rid master
fsmo maintenance: transfer domain naming master
fsmo maintenance: quit
ntdsutil: quit
>

=====================================
How bout a cute one from the NT and 2000 resource Kits....

>Userstat.exe
I don't remember what the switch is, but it will tell you the the last time every user account was logged in.


PSC
 
Microsoft NET Commands
The following work in NT, 2000, XP and .NET

For more information about specific Microsoft NET commands, type the command name followed by /? at the Command Prompt or use Help
(for example, NET VIEW /?).


NET ACCOUNTS
Updates the user accounts database and modifies password and logon requirements.
NET COMPUTER
Adds, deletes computers from domain database.
NET CONFIG
Displays your current workgroup settings.
NET CONFIG SERVER
Displays or changes settings for the server service.
NET CONFIG WORKSTATION
Displays or changes settings for the workstation service.
NET CONTINUE
Reactivates suspended services.
NET FILE
Displays the names or closes all open files.
NET GROUP
Adds, displays, modifies global group properties (domain controllers only).
NET HELP
Provides information about commands and error messages.
NET HELPMSG
Provides error message help.
NET LOCALGROUP
Adds, displays, modifies local group properties.
NET NAME
Adds or deletes a messaging name or displays the list of names the computer will accept messages for.
NET PAUSE
Pauses services.
NET PRINT
Displays information about print queues and controls print jobs.
NET SEND
Sends messages to other users or computers on the network.
NET SESSION
Lists, disconnects sessions between local computer and connected computers.
NET SHARE
Creates, deletes, displays shared resources
NET START
Starts services.
NET STATISTICS
Displays the statistics logs for the local Workstation or Server Service.
NET STOP
Stops services.
NET TIME
Displays the time on or synchronizes your computer's clock with the clock on a Microsoft Windows for Workgroups, Windows NT, Windows 95, or NetWare time server.
NET USE
Connects to or disconnects from a shared resource or displays information about connections.
NET USER
Add/Delete users.
NET VIEW
Displays a list of computers that share resources or a list of shared resources on a specific computer.




Right now, you occupy a point where three lines reach across the expanse of time and space and intersect only there, and that you and only you possess.
 
Few more:

****

After installing the support tools from the W2K server setup CDROM, you get these important commands:

DCDIAG

NETDIAG

And some more.

****

With a default install you can use:

CACLS - to modify NTFS permissions.

XCOPY /? - Use this to see how powerfull it can be. You can use XCOPY to copy folders even if a file is unreadable (/C) or to copy NTFS permissions (/O), and more...
For example:
XCOPY F:\ G:\ /C/H/E/R/K/O
You can copy over the network of course, and then if something happens just after 95% copied, you just run it again adding the switch: /D



Yizhar Hurwitz
 
What about netsh?

This VERY powerful command seems to be little known by most of the people I talk with. Just check out the help and be amazed ...
Apart from being able to configure almost any network setting you can even configure things like RIP (the routing protocol not the W2K service) and OSPF
Especially nice are the dump commands that give you a very detailed documentation of the current settings.

Geert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top