Basic Networking Commands you should know!
This would be mostly (*)nix based command set - Here we go...
- ping {hostname}
Lets you check whether your internet connection is alive or lost
Example : ping techflock.blogspot.com - traceroute {hostname}
Lets you trace packets and find if your connection is broken beyond your ip address. Also can be used to track the number of hops to get to the hostname
Example: traceroute techflock.blogspot.com - ifconfig
Find out your ip address, your network interfaces, transferred and received data information
Example : ifconfig - nslookup {hostname}
Find out the dns name resolves to a IP - a way to test your dns server
Example: nslookup techflock.blogspot.com - dig {hostname}
Does the same as above and provides other dns related information
Example: dig techflock.blogspot.com - netstat -a
Find out all the open ports on your machine
Example: netstat -a - netstat -nt
Display all the tcp based established connections on your machine
Example: netstat -nt - telnet {hostname} {port}
Telnet or connect to a machine at the specified port to find out whether that machine/server is working right
Example: telnet techflock.blogspot.com 80
Ofcourse, there are many other options within each of these commands which you can find out through the manual pages by typing man {command}
Update: Some of the commands might be in /sbin or /usr/sbin paths and might not be in default PATH. So go and execute it from there! For Example: /sbin/ifconfig
56 comments:
I believe it is ipconfig not ifconfig.
Anonymous:
It is ifconfig in Linux based distributions (or GNU/Linux) and ipconfig in Windows.
Check out more here:
http://www.oreillynet.com/linux/cmd/cmd.csp?path=i/ifconfig
tracert, player. not traceroute.
ah... linux. sorry about that. I'm stuck in a windows environment
nslookup is a depreciated tool....
people should be using host or dig
I think ssh is the new version of telnet...
What? No mention of netcat? It's absolutely invaluable!
do people still use telnet? isn't it insecure and all that. SSH wud be a better option IMHO
For networking testing, you use telnet not ssh. For actually connecting to your pc from a remote location, you should indeed use ssh instead of telnet.
But say you're configuring an smtp or imap daemon. In that case, you use telnet to connect to it, and see what's wrong with it.
In OS X, ifconfig works like it does in linux. ipconfig is also there, which lets you see the ip status, such as dhcp, bootp, maunal etc, and lets you set such automatic ip resolution.
wget nmap ftp
bleh
Do these commands NOW while the connection is up - especially tracert (windows) traceroute (Linux) -
Record the results somewhere.
Then when the connection is actually down - you can compare the results.
you forgot route...
netstat -ap also might be useful, to obtain the pid of the program which is listening on specific ports
Yes ssh should be used for accessing another machine remoteley and not telnet, but telnet is a still a hugely useful command for extrapalating information from any remote port to see what service is running on any port.
"nslookup is a depreciated tool"
That word doesn't mean what you think it does. The word you're looking for is "deprecated".
The commenters are pretty cocky for not knowing jackshit. Jeebus.
i agree with anonymous
the ppl posting need to read a few books before enlightening us
yea all the windows trolls need to chill out, it's not ipconfig, and it's not tracert... what a bunch of dicks! if you don't know what you're talking about, just calm down and go somewhere else guys.
It's interesting that the windows based commenters are actually trying to be helpful and John (who presumably is not) is the only one actually being rude and in most definitions a troll.
Of course now I'm doing the worst thing possible in responding to the troll.
jeebus
;]
What? No lsof?
lsof -i
is the most useful command... it lists what services are using what ports. Remove the -i and it shows all the files open on the computer.
The Windows commenters (ipconfig, tracert) may have honestly intended to be helpful but nevertheless have merely shown their ignorance.
But perhaps, this is helpful too, in that it highlights what may be a confusing subject for many people--at least for those stupid Windows losers...
Also:
1. route
2. nmap
3. lsof
4. iwtools (iwconfig, etc)
For those Windows folk that say tracert instead of traceroute, lets not forget that it was derived from traceroute but it *HAD* to be called tracert because of the 8 character limit imposed in MS-DOS (ref: http://www.answers.com/topic/traceroute-program)
Also ipconfig just handles IP configuration, whereas ifconfig (short for interface) does more then just IP configuration as it configures the entire interface for the machine (usually handled in Windows' drivers settings).
Lastly, telnet is *great* to test out if a port is up like the article (read guys) says, not to remote connect. Want to see if you can get to port 80 on a host (maybe the firewall is blocking it) or port blah blah (say you can't get to your mail server, do telnet mail.yourisp.com 110 for pop3 or smtp.yourisp.com 25 for smtp).
Please I know windows users are trying to help but it really does look uninformed and dumb when you correct the article by saying "tracert not traceroute" since the article specifies LINUX / UNIX commands.
In looking at the commands listed it looks like theyre mainly used for DNS lookups and to check that connectivity FROM the host is up, thats probably why things like netcat and lsof arent listed. Also I dont really think that its appropriate to say that if you're testing vs working use telnet over ssh. You can use ssh all you want and fail miserably if the far end isnt set to respond to ssh requests. Maybe you should try and take whats listed in context rather than starting a "OMFG u use telnet over SSH?!?!?!?! n00b"
To the guy who said:
I believe it is ipconfig not ifconfig.
HAHAHAHAHAHHAHAHAHAHAHAHAHAHAH mmwwwwaaHAHAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAHAHAH
arp -a can be nice at times
Hey, Clint, is that you?
How about 'lynx' (see http://en.wikipedia.org/wiki/Lynx_%28web_browser%29)
:-)
-- Clint
mtr is another good tool. It is a cross between ping and traceroute.
I definately agree with anonymous
Networking can be said to be "vodoo science"
www.glendalegolfs.com
hum and what about the ip command and the netcat command.
And the telnet is deprecated as well, use ssh.
You should mention the nmap and tcpdump.
Regarding netstat and several more options that are useful and one mod to the oen you gave:
netstat -ltnp
will give you the actual processes locally holding open ports.
Also, when running netstat -a (open ports) or netstat -r (list routes) its good to add an 'n' e.g., netstat -rn , the benefit being it tells netstat *not* to do a DNS lookup on every IP address it handles. If you are having network issues, you probably have issues connectiong to your DNS server, which will cause the whole thing to hang(for short periods or forever).
Also, all the "windows corrections" just killed me =)
traceroute
dig
wget
nmap
netcat
ifconfig
netstat
iptables -- KNOW IT LIVE IT LOVE IT
route
expect -- networking-based scripting in tcl
ethereal
and last but not least:
ping. ok, it's the least.
im in ur networks stealin your password since your so dumb you used telnet even though when you checking a service you won't get a password prompt
article should have specified which OS the commands work on, otherwise a good article
calm down people :) its just a blog, its all about helping and what OS you use doesnt really matter. learning all OSs is ideal any way.
You should also know:
your ass
a hole in the ground
If you don't know "ping", then you are retarded.
Telnet rulez.
I use telnet on all of my ultra secure government and corporate machines.
Cryptography and ssh are obsolete.
Make sure that the most encryption you ever uze is rot13 or a xor mask.
-Dogno7
about ifup
*how about ifup and ifdown
"article should have specified which OS the commands work on, otherwise a good article"
-----------------------------------------
These commands work with the majority of todays operating systems i.e. OSX, Linux, BSD, Solaris, AIX, HPUX etc. etc.
The only major OS that does these things differently is..... go on, guess.
should have been...
"The only major OS that does these things differently or not at all is...."
add arp -a
to that list
Telnet is still pretty handy. You can telent to different ports to test if you can make a TCP connection between your hosts. For example, telnet to port 80 to connect to a webserver.
I have a little writeup on how to use the dig command to lookup DNS information. You can read it at http://timarcher.com/?q=node/38
Tim
i want to know more comments in networking.now i am working with exchange server 2003.
Its really nice to have discussion with you guys.Thanx......
drew... just lol at that statement.
Also yes, telnet is FAR more unsecure. It does have encryption or anything.
there's brute forcers out there. I can connect all the time to remote telnet servers and all they ask for is a password. imho, very unsecure. SSH for the win.
This comment thread is hilarious.
its not ifconfig. it is ipconfig
that was very good experience to read that lines.
What is ipconfig?
i didn't expect this kind of knowledge at one page , hope to see more.
Very Helpful for beginners of networking.....
Post a Comment