You have erred on many levels. We'll go through it one by one:
Quote:
Originally Posted by
abhi123
I dont have a console, but a monitor, that I switch between my desktop and this server.
A "console" is a certain form of a terminal - one that is directly attached to the system (instead of being attached via network lines, etc.). Usually this is the "terminal of last resort" if everything else fails. Basically, terminals are serially attached. You could connect the serial port of the server with a serial cable to your PC, start a terminal emulation (IIRC this is called "HYPERTERM" in Windoze) and get a connect once you choose the right baud rate, etc..
Quote:
Originally Posted by
abhi123
yesterday I wanted to change IP of the server from dynamic to static IP. Using my monitor connected to that server
I changed ip in /etc/hosts and used init 3 to reboot.
This won't work at all. "/etc/hosts" is a file for name resoultion, nothing else. You can write there whatever you want, it won't change the IP address one iota.
Your computer has to translate network
names like "www.unix.com" to network
addresses somehow (and vice versa). There is a network service for this, called DNS (Domain Name Service), but there are also other means: NIS (Network Information Service, also called "Yellow Pages", "YP") and the local file "/etc/hosts". This is a simple table, one IP address and its corresponding name(s) per line. The file
/etc/netsvc.conf tells the system which of the available service(s) takes precedence.
To change your IP address use the "ifconfig" command, to activate and deactivate your network interface use the same. See "man ifconfig" for details.
CAUTION: if you are connected via a network connection and change your IP your connection is lost! Because UNIX-processes which lose their terminal are terminated you have to execute such a command with the "nohup" command (see "man nohup" for details).
Now, about runlevels: runlevels are different configurations of a system. After a system has started some basic services a certain "runlevel" is entered. There is a directory
/etc/rc.d where a directory for every runlevel resides. In this directory are start-scripts ("S....") and stop-scripts ("K...."). When a runlevel is entered all the start-scripts are executed. When the runlevel is left, all the stop-scripts are executed. Changing a runlevel means first leaving one and then entering a another.
Basically these scripts start/stop a certain service each. In principle you could use these runlevels as you please, but there is an (informal) standard in place:
0 - boot
1(S) - single user, no network
2 - Multiuser
3 - Multiuser with network
4,5 user-defined
6 Reboot
5 is most times associated with a GDM (Graphical Display Manager) started. Some Unix (AIX for instance) deviate slightly from this, but 0,1(=S mostly) and 6 is conventionally the same everywhere. If you want to reboot the system you should use the command for that, which is
shutdown (see "man shutdown" for the appropriate options) or switch to runlevel 6.
I hope this helps.
bakunin