Wednesday, August 12, 2009

Adding SWAP space in Linux

#free –m (To check free space of SWAP memory)

#df –h

We are going to make a swap file in /opt by using dd to create a file 128 Mb in size

#dd if=/dev/zero of=swapfile bs=1024 count=132207

132207+0 records in

132207+0 records out

#ls –l

#chmod 600 swapfile

#mkswap swapfile

#swapon swapfile

#free

Now you can entry this in /etc/fstab file

#vi /etc/fstab

/opt/swapfile swap swap defaults 0 0

Thursday, July 30, 2009

Turn off icmp request

How to turn off ping request?

Open /etc/sysctl.conf in vi editor and write as follows

#sysctl –a |grep icmp

net.ipv6.icmp.ratelimit = 250
net.ipv4.netfilter.ip_conntrack_icmp_timeout = 30
net.ipv4.icmp_ratemask = 6168
net.ipv4.icmp_ratelimit = 250
net.ipv4.icmp_errors_use_inbound_ifaddr = 0
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_echo_ignore_all = 1

(Copy the last line and paste that into /etc/sysctl.conf)

#vi /etc/sysctl.conf

net.ipv4.icmp_echo_ignore_all=1

#/sbin/sysctl –P or reboot

Restart your box

Network Installation Server

We can install Linux by four types of Network installation method

By FTP server
By HTTP server
By NFS server
By PXE server

Keep ready of FTP server
This is the slowest installation method comparative above four methods.
Mount RHEL5 DVD into /mnt

#yum –y install vsftpd
#mkdir /var/ftp/pub/rhel5
#cp -a /mnt/* /var/ftp/pub/rhel5

#service vsftpd start
(Note: – Give anonymous access to this folder if you want makes this as http server)

By HTTP server
This is comparatively fast installation over ftp

Now no need copy once again rhel5 DVD into your web server directory
Because it’s already in /var/ftp/pub/rhel5, just give a link as follows

#yum –y install httpd
#ln –s ../../ftp/pub/rhel5 /var/www/html/pub/rhel5

#service httpd start

By NFS server

This is faster installation method over ftp and httpd

Now make an image of rhel5 DVD.

You can do image in two method

By mounting DVD
Insert your DVD into CD drive
#dd if=/dev/cdrom of=rhel5.iso

By mounting the folder
We already copied rhel5 DVD in /var/ftp/pub/rhel5
#dd if=/var/ftp/pub/rhel5 of=rhel5.iso

#yum –y install nfs portmap
#vi /etc/exports
/var/ftp/pub/rhel5 192.168.0.0/255.255.255.0 (ro,sync) (Your local lan)

#service portmap start
#service nfs start

By PXE server
This is the fastest method over the others
We will discussed about this in next blog