<HTML>
<HEAD>
<TITLE>Network command manual</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="../css0.css">
</HEAD>
<BODY>

<h1>Network command manual</h1>
	<ol>
	<li><a href="index.html#Configure network" target="_self">
		Configure network</a>
	<li><a href="index.html#telnet" target="_self">
		telnet - user interface to the TELNET protocol</a>
	<li><a href="index.html#ftp" target="_self">
		ftp - ARPANET file transfer program</a>
	<li><a href="index.html#rdate" target="_self">
		rdate - get the date and time via the network</a>
	</ol>

<!-******************** HEADER ********************>
<a name="ifconfig"></a><h2>ifconfig</h2>

Add a new ip address to existing interface

<pre>
ifconfig eth0:0 202.144.157.211 \
	broadcast 202.144.157.223 \
	netmask 255.255.255.240
route add -host 202.144.157.211 dev eth0:0

</pre>

<!-******************** HEADER ********************>
<a name="Configure network"></a><h2>Configure network</h2>

<table border=1 cellspacing=0 cellpadding=0>
	<caption>Sample Network</caption>
	<tr><th>  <th>IP Address	<th>					<th>
	<tr><th>1 <td>192.168.1.0	<td>Network Address		<td>
	<tr><th>2 <td>192.168.1.2	<td>Red Hat Linux Server<td>DNS, E-Mail, etc
	<tr><th>3 <td>192.168.1.3	<td>Windows				<td>Assign from DHCP
	<tr><th>  <td>...........	<td>					<td>
</table><p>

<li>/etc/sysconfig/network
<blockquote><pre>
NETWORKING=yes
FORWARD_IPV4=false
HOSTNAME=ns
DOMAINNAME=rim
GATEWAY=
GATEWAYDEV=
NISDOMAIN=""
</pre></blockquote>

/etc/sysconfig/network-scripts/ifcfg-eth0
<blockquote><pre>
DEVICE=eth0
IPADDR=192.168.1.2
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
</pre></blockquote>

/etc/hosts
<blockquote><pre>
127.0.0.1		localhost		localhost.localdomain
192.168.1.2	ns		ns.grape-info.com
</pre></blockquote>

/etc/resolv.conf
<blockquote><pre>
search grape-info.com
</pre></blockquote>

/etc/resolv.conf
<blockquote><pre>
search grape-info.com
nameserver 192.168.1.2
nameserver 202.144.129.34
nameserver 202.144.128.200
</pre></blockquote>
<table border=1 cellspacing=0 cellpadding=0>
	<caption>Notice</caption>
	<tr><th> <th>DNS Server's IP Address	<th>
	<tr><th>1<td>nameserver 192.168.1.2		<td>DNS Server
	<tr><th>2<td>nameserver 202.144.129.34	<td>ISP DNS Server
	<tr><th>3<td>nameserver 202.144.128.200	<td>ISP DNS Server
</table>

<!-******************** HEADER ********************>
<a name="telnet"></a><h2>telnet - user interface to the TELNET protocol</h2>
The telnet command is used for interactive communication with another host using the TELNET protocol.<p>

<table border=1 cellspacing=0 cellpadding=0>
	<caption>telnet [host] [port]</caption>
	<tr><th>host<td>Specifies a host to contact over the network.
	<tr><th>port<td>Specifies a port number or service name to contact.
					If not specified, the telnet port (23) is used.
</table><p>

<li>Connect to another host
<blockquote><pre>
[root@myhost /]# telnet hostname
Trying xxx.xxx.xxx.xxx...
Connected to localhost.
Escape character is '^]'.

Red Hat Linux release 5.2(J) (crimson)
Kernel 2.0.36 on an i586
login: hoge
Password:
Last login: Sun Aug 29 22:22:55 from hoge
[hoge@hostname hoge]$
</pre></blockquote>

<li>Connect to news server
<blockquote><pre>
[root@myhost /root]# telnet localhost nntp
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
200 myhost.grape-info.com InterNetNews server INN 1.7.2 08-Dec-1997 ready
<b>LIST</b>
215
control 0000000000 0000000001 y
junk 0000000000 0000000001 y
test 0000000000 0000000001 y
to 0000000000 0000000001 y
.
<b>QUIT</b>
205 .
Connection closed by foreign host.
</pre></blockquote>

<!-******************** HEADER ********************>
<a name="ftp"></a><h2>ftp - ARPANET file transfer program</h2>

Ftp is the user interface to the ARPANET standard File Transfer Protocol. The program allows a user to transfer files to and from a remote network site.<p>

<li>ftp [host]
<blockquote><pre>
[root@myhost /root]# ftp hostname
Connected to hostname.
220 hostname.grape-info.com FTP server (Version wu-2.5.0(1) Tue Jun 8 11:19:44 EDT 1999) ready.
Name (hostname:username): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 6
drwxr-xr-x   6 root     root         1024 Aug 28 01:08 .
drwxr-xr-x   6 root     root         1024 Aug 28 01:08 ..
d--x--x--x   2 root     root         1024 Aug 28 01:08 bin
d--x--x--x   2 root     root         1024 Aug 28 01:08 etc
drwxr-xr-x   2 root     root         1024 Aug 28 01:08 lib
dr-xr-sr-x   2 root     ftp          1024 Sep 11  1998 pub
226 Transfer complete.
</pre></blockquote>

<table border=1 cellspacing=0 cellpadding=0>
	<tr><th>! [command [args]]
		<td>Invoke an interactive shell on the local machine.  If there are arguments, the first is taken to be a command to execute directly, with the rest of the arguments as its arguments.
	<tr><th>account [passwd]
		<td>Supply a supplemental password required by a remote system for access to resources once a login has been successfully completed.  If no argument is included, the user will be prompted for an account password in a non-echoing input mode.
	<tr><th>ascii
		<td>Set the file transfer type to network ASCII. This is the default type.
	<tr><th>binary
		<td>Set the file transfer type to support binary image transfer.

	<tr><th>bye
		<td>Terminate the FTP session with the remote server and exit ftp. An end of file will also terminate the session and exit.
	<tr><th>cd remote-directory
		<td>Change the working directory on the remote machine to remote directory.
	<tr><th>get remote-file [local-file]
		<td>Retrieve the remote-file and store it on the local machine. If the local file name is not specified, it is given the same name it has on the remote machine, subject to alteration by the current case, ntrans, and nmap settings.  The current settings for type, form, mode, and structure are used while transferring the file.
	<tr><th>hash
		<td>Toggle hash-sign (``#'') printing for each data block transferred.  The size of a data block is 1024 bytes.
	<tr><th>ls [remote-directory] [local-file]
		<td>Print a listing of the contents of a directory on the remote machine.  The listing includes any system-dependent information that the server chooses to include; for example, most UNIX systems will produce output from the command `ls -l'. (See also nlist.) If remote-directory is left unspecified, the current working directory is used.  If interactive prompting is on, ftp will prompt the user to verify that the last argument is indeed the target local file for receiving ls output.  If no local file is specified, or if local-file is `-', the output is sent to the terminal.
	<tr><th>open host [port]
		<td>Establish a connection to the specified host FTP server. An optional port number may be supplied, in which case, ftp will attempt to contact an FTP server at that port.  If the autologin option is on (default), ftp will also attempt to automatically log the user in to the FTP server (see below).
	<tr><th>put local-file [remote-file]
		<td>Store a local file on the remote machine.  If remote-file is left unspecified, the local file name is used after processing according to any ntrans or nmap settings in naming the remote file.  File transfer uses the current settings for type, format, mode, and structure.
	<tr><th>pwd
		<td>Print the name of the current working directory on the remote machine.
	<tr><th>quit
		<td>A synonym for bye.
	<tr><th>user user-name [password] [account]
		<td>Identify yourself to the remote FTP server.  If the password is not specified and the server requires it, ftp will prompt the user for it (after disabling local echo).  If an account field is not specified, and the FTP server requires it, the user will be prompted for it.  If an account field is specified, an account command will be relayed to the remote server after the login sequence is completed if the remote server did not require it for logging in.  Unless ftp is invoked with ``auto-login'' disabled, this process is done automatically on initial connection to the FTP server.
</table>


<!-******************** HEADER ********************>
<a name="rdate"></a><h2>rdate - get the date and time via the network</h2>

<li>SYNOPSIS<br>
       rdate [-p] [-s] [host...]<p>

<li>DESCRIPTION<br>
Rdate  uses  TCP  to  retrieve the current time of another machine using using the protocol described in RFC 868. The time for each system is returned in ctime(3) format. The following is an example:<p>

<blockquote><pre>
% rdate uci mc
[uci]   Sun Mar 24 20:35:41 1985
[mc]    Sun Mar 24 20:36:19 1985
</pre></blockquote>

<li>OPTIONS<br>
<table border=1 cellspacing=0 cellpadding=0>
	<colgroup>
		<col width="10%">
		<col width="90%">
	</colgroup>
	<tr><th>-p<td>Print the time retrieved from the remote  machines. This is the default mode.
	<tr><th>-s<td>Set  the  local system time from the time retrieved from the remote machine.  This, quite naturally, is only effective for root.
</table>

<hr><a href="../index.html">Back</a>

<!--#include virtual="/doc/footer.html" -->

</body>
</html>
