Thursday, May 28, 2009

linux network configuration - A Quick Howto

Linux Network configuration files .


One of the linux network configuration part is to setup DNS , to do this you need to edit 
/etc/resolv.conf  -- DNS Configuration in linux

-----
search yourdomain.com
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
-----

Secondly you might need to edit the host file 

/etc/hosts
---
127.0.0.1       localhost
---

For fedora and redhat , you can use an easy GUI tool for linux network configuration .
command : /usr/sbin/system-config-network 

After running this command you can simply select the interface to edit and configure 

Also from text mode you can configure linux networking using ifconfig tool like 
/sbin/ifconfig eth0 192.168.75.50 netmask 255.255.255.0 broadcast 192.168.75.255
For debian 
Just edit /etc/network/interfaces 
and put like
-------------------------
# The loopback network interface 
auto lo iface lo inet loopback  
# The primary network interface allow-hotplug eth0 iface eth0 inet static         address 192.168.75.50         netmask 255.255.255.0         network 192.168.75.0         broadcast 192.168.75.255 
----------------------

save and exit , then restart network service ussuing command "/etc/init.d/network restart".

For alias ip configuration just follow the smae steps except assign ip address in virtual interface like eth1:1 , eth1:2..etc.



How to copy a disk - Linux

Here are the steps which shows
How to copy a disk over network .

Copy a disk over network , target machine enter following command:

"nc" utility and "dd" are used to copy a disk over network
nc -l -p 6565 | gzip –dfc | dd of=/dev/hdb

And on source machine.

dd if=/dev/hda | gzip –cf | nc 192.168.75.21 6565