old-www/LDP/GNU-Linux-Tools-Summary/html/network-commands.html

398 lines
6.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Network Commands</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="GNU/Linux Command-Line Tools Summary"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Mathematical tools"
HREF="mathematical-tools.html"><LINK
REL="NEXT"
TITLE="Network Configuration "
HREF="network-configuration.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>GNU/Linux Command-Line Tools Summary</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="mathematical-tools.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="network-configuration.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="NETWORK-COMMANDS"
></A
>Chapter 13. Network Commands</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>13.1. <A
HREF="network-configuration.html"
>Network Configuration</A
></DT
><DT
>13.2. <A
HREF="internet-specific-commands.html"
>Internet Specific Commands</A
></DT
><DT
>13.3. <A
HREF="remote-administration.html"
>Remote Administration Related</A
></DT
></DL
></DIV
><P
>The network commands chapter explains various tools which can be useful when networking with other computers both within the network and accross the internet, obtaining more information about other computers. This chapter also includes information on tools for network configuration, file transfer and working with remote machines.</P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>netstat</DT
><DD
><P
>Displays contents of /proc/net files. It works with the <SPAN
CLASS="PRODUCTNAME"
>Linux</SPAN
> Network Subsystem, it will tell you what the status of ports are ie. open, closed, waiting, masquerade connections. It will also display various other things. It has many different options.</P
></DD
><DT
>tcpdump</DT
><DD
><P
>This is a sniffer, a program that captures packets off a network interface and interprets them for you. It understands all basic internet protocols, and can be used to save entire packets for later inspection.</P
></DD
><DT
>ping</DT
><DD
><P
>The ping command (named after the sound of an active sonar system) sends echo requests to the host you specify on the command line, and lists the responses received their round trip time.</P
><P
>You simply use ping as:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>ping ip_or_host_name</PRE
></FONT
></TD
></TR
></TABLE
><P
>Note to stop ping (otherwise it goes forever) use
<B
CLASS="KEYCAP"
>CTRL</B
>-<B
CLASS="KEYCAP"
>C</B
>
(break).</P
><DIV
CLASS="NOTE"
><P
></P
><TABLE
CLASS="NOTE"
WIDTH="90%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TH
ALIGN="LEFT"
VALIGN="CENTER"
><B
>Please note</B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Using ping/smbmount/ssh or other <SPAN
CLASS="PRODUCTNAME"
>UNIX</SPAN
> system programs with a computer name rather than IP address will only work if you have the computer listed in your /etc/hosts file. Here is an example:</P
><P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>192.168.1.100 new </PRE
></FONT
></TD
></TR
></TABLE
> This line says that their is a computer called &#8220;new&#8221; with IP address 192.168.1.100. Now that it exists in the /etc/hosts file I don't have to type the IP address anymore, just the name &#8220;new&#8221;.</P
></TD
></TR
></TABLE
></DIV
></DD
><DT
>hostname</DT
><DD
><P
>Tells the user the host name of the computer they are logged into. Note: may be called <EM
>host.</EM
></P
></DD
><DT
>traceroute</DT
><DD
><P
><EM
>traceroute</EM
> will show the route of a packet. It attempts to list the series of hosts through which your packets travel on their way to a given destination. Also have a look at <EM
>xtraceroute</EM
> (one of several graphical equivalents of this program). </P
><P
>Command syntax:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>traceroute machine_name_or_ip</PRE
></FONT
></TD
></TR
></TABLE
></DD
><DT
>tracepath</DT
><DD
><P
><EM
>tracepath</EM
> performs a very simlar function to <EM
>traceroute</EM
> the main difference is that <EM
>tracepath</EM
> doesn't take complicated options.</P
><P
>Command syntax:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>tracepath machine_name_or_ip</PRE
></FONT
></TD
></TR
></TABLE
></DD
><DT
>findsmb</DT
><DD
><P
><EM
>findsmb</EM
> is used to list info about machines that respond to SMB name queries (for example windows based machines sharing their hard disk's). </P
><P
>Command syntax:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>findsmb</PRE
></FONT
></TD
></TR
></TABLE
><P
>This would find all machines possible, you may need to specify a particular subnet to query those machines only...</P
></DD
><DT
>nmap</DT
><DD
><P
>&#8220; network exploration tool and security scanner&#8221;. <EM
>nmap</EM
> is a very advanced network tool used to query machines (local or remote) as to whether they are up and what ports are open on these machines. </P
><P
>A simple usage example:</P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="90%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>nmap machine_name</PRE
></FONT
></TD
></TR
></TABLE
><P
>This would query your own machine as to what ports it keeps open. <EM
>nmap</EM
> is a very powerful tool, documentation is available on the <A
HREF="http://www.insecure.org/nmap/"
TARGET="_top"
>nmap site</A
> as well as the information in the manual page.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="mathematical-tools.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="network-configuration.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Mathematical tools</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Network Configuration</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>