Author: Mayur Prakash Srivastava
Q1. How to get the Kernel IP routing table of my machine ?
bash% netstat -nr
This command prints the kernel's IP routing table.
bash% netstat -a
Prints both listening and non-listening sockets.
For more details type man netstat
Q2. How to get my IP address ?
bash% /sbin/ifconfig
ifconfig is used to configure a network interface.
Try more:
bash% /sbin/ifconfig eth0
bash% /sbin/ifconfig lo
Q3. How to start and stop the eth0 ?
/sbin/ifconfig eth0 down is used to shut down eth0.
/sbin/ifconfig eth0 up is used to bring up the eth0.
This may also be done by /sbin/ifdown eth0 and /sbin/ifup eth0.
bash% /etc/rc.d/init.d/network {start|stop|restart}
This command also does the job.
Q4. How to change the IP address, etc. of my computer ?
Step 1: Stop the network by /etc/rc.d/init.d/network stop.
Step 2: Manually edit /etc/sysconfig/network-scripts/ifcfg-eth0.
Step 3: Start the network by /etc/rc.d/init.d/network start.
Q5. How to change the nameserver ?
Goto /etc/resolv.conf.
e.g.,
search cse.iitb.ac.in cse.iitb.ernet.in it.iitb.ernet.in cc.iitb.ernet.in
nameserver 144.16.111.15
nameserver 144.16.106.173
Q6. How can I duplicate user accounts on one computer to another, i.e., transfer all the accounts,etc. ?
Copy the following files and you will be done:
/etc/passwd
/etc/shadow
/etc/groups
These files can also be transferred for making copy of the system.
/etc/resolv.conf
/etc/hosts
/etc/hosts.allow
/etc/hosts.deny
/etc/ssh/sshd_config
/etc/printcap
/etc/sudoers
/etc/distfile
/etc/exports
Q7. How to change the hostname ?
Edit /etc/sysconfig/network and change the hostname entry.
Author: Mayur Prakash Srivastava