Recently I got into problem to assign 2 IPs on one physical NIC.

There was nothing mentioned in official documentation so I did some research and find the solution.

It is really simple if you are not afraid from command line and VI editor. Unfortunately I did not find a GUI.

Here it is:

  1. Go to command prompt
  2. Be sure that you are root. Otherwise type su – to become.
  3. Type – cd /etc/sysconfig/network-scripts/
  4. Then type ls to see the contents – you should have file ifcfg-eth0 if you have just one interface otherwise if you have multiple interfaces there you’ll find other files like ifcfg-eth1…n.
  5. Then we will copy the file to different name – cp ifcfg-eth0 ifcfg-eth0:0
  6. Next step is to edit newly created file and put the IP we needed.
  7. If needed repeat steps 5 and 6 with different numbers after”:” (1,2,…) to add additional addresses.
  8. If you issue ifconfig you will not see newly created interface, because it is no activated – you need to restart network /etc/init.d/network restart will do it for you.
  9. That’s it.

Comments are welcome.

Recently I monitored one of my servers and started wondering what “Load average” numbers mean:

After long search I found clear explanation here. Here is the summary:

The load average is a number that corresponds to the average number of runnable processes on the system. The load average is often listed as three sets of numbers (as seen here), which represent the load average for the past 1, 5, and 15 minutes

I needed to check multiple addresses for use.

I did not find any ready solution so I wrote a script.

I called it

Here is it(comments are welcomed):

# Sweep ping
# 1-st arg ip 2-nd start 3-d end
# Written by Hristo Benev
# rev 0.3
for i in `seq $2 $3`; do
ping -c 1 -W 1 $1.$i >/dev/null 2>&1
#ping -c 1 -W 1 $1.$i
if [ $? == 0 ]; then
echo "host $1.$i is up"
echo "."
# changelog
# 0.3 added progress