Below are some useful Windows networking commands and the Linux equivalent
Have you ever wanted to know if your network is up and running but aren’t exactly sure how to tell. Maybe you know your network works, but you aren’t sure if you are entering your username wrong or if your mail server is off line. How can you tell?
Ping allows you to send a packet to a remote host which should be repeated back to you (pinged). When you ping a remote computer, you receive a response that tells how many packets you sent, and how many you received back. If you keep sending and hear nothing back, either the remote computer is not working, or you are not able to find a route to that remote host.
PING [server address]
As you can see, you can either ping by IP address or host name. If you can ping by IP address but not by name, there may be an issue in resolving names, such as a problem with your DNS server. If you are not able to ping by either, but you think that the remote device is working, check to make sure that your gateway and netmask are properly configured.
TRACERT will allow you to analyze the path by which information travels from your computer to a remote machine. It can be very useful in determining if and where there is a network failure. For instance, if you expect that you are connecting to an offsite host and you are never able to get out of your network, your connection may be down or the gateway may not be properly configured.
As you can see, TRACERT can also use either IP address or host name. Typically, either TRACERT or traceroute will follow the connection over a maximum of 30 “hops” or jumps from one network device to another before reaching its destination.
IPCONFIG will let you see what IP address has been assigned to each network interface on your computer. By looking at a more detailed IPCONFIG output, you can find out other useful information such as the netmask, gateway, and MAC (Hardware) address of each interface. This is an alternative to looking at the property section under the network controller’s TCP/IP settings (a very long and non-fun process).
or for more information
The important line is the one either labeled IP ADDRESS or IP_V4 Address.
The “NET” commands can be very useful for mapping and viewing windows shars from the command line. This is a useful alternative to browsing the network neighborhood. The following two commands are probably the most useful (or have been to me).
NET USE NET VIEW
You can get information on all of the NET commands by typing: NET /? or specific information on either of hte above commans by typing
NET USE /? or
NET VIEW /?.
Note the use of
/?. Actually, the
/? switch can be very useful to get more information on the syntax and use of most MSDOS commands.
I’ll include some typical examples below:
NET USE [devicename] [\\computername\sharename\volume\] [/user:[username@dotted domain name]]
NET USE v: \\192.168.0.10\share /USER:Admin@mydomain.local
Keep in mind that it is typically a bad idea to mount drives as an administrator, unless you need full access to the shared device. You are best to mount with a user that has the least amount of access necessary to complete your tax. Don’t make a practice of always mounting as administrator (or root).
If you would like the mount to survive a reboot, make it PERSISTENT:
NET USE v: \\192.168.0.10\share /USER:Admin@mydomain.local /PERSISTENT:YES
NET USE [devicename] /DELETE
NET USE v: /DELETE
To view the shares available on the computer (similar to browsing)
NET VIEW [\\computername]
NET VIEW \\192.168.0.10