≡ Menu

ip address

Iptables: Unblock / Delete an IP Address Listed in IPtables Tables

I am a brand new user of a Linux iptables and I can’t find how to instruct my iptables to delete or unblock an IP address listed in iptables firewall. I’m using Debian Linux version. Can you help please?
[click to continue…]

Linux / FreeBSD: Multiple IP Addresses on One Interface

Q. Can one Linux / BSD system respond to multiple IP address on a single Ethernet interface? I need to run multiple web sites and mod_ssl with a single server. How do I configure my box for multiple IP address?
[click to continue…]

How To AIX UNIX Configure TCP/IP Networking ( NIC )

Q. How do I configuring TCP/IP and the network interface under AIX UNIX operating system?
[click to continue…]

Diagnosing a dos Attack Under Linux

Q. How do I find out if I Linux box is under DoS attack or not form a shell prompt?
[click to continue…]

BIND Change the IP Address of a Domain or HOST

Q. How do I Change the IP Address of a Domain or Host under BIND 8 or 9?
[click to continue…]

How to: Detect Duplicate IP Address With arping command under Linux

Q. I run quite large network with different subnets. I’d like to know how can I find out duplicate IP address under Linux / UNIX?

A. You can use arpping command. The arping utility performs an action similar to ping command, but at the Ethernet layer. You can send ARP REQUEST to a neighbor host / computers.

Task: Send ARP request

Let us find out reachability of an IP on the local Ethernet with arping i.e send ARP request
$ sudo arping -I eth0 -c 3

ARPING from ra0
Unicast reply from [00:18:39:6A:C6:8B]  2.232ms
Unicast reply from [00:18:39:6A:C6:8B]  1.952ms
Sent 3 probes (1 broadcast(s))
Received 3 response(s)


  • -I eth0 : Specify network interface i.e. name of network device where to send ARP REQUEST packets. This option is required.
  • -c 3 : Stop after sending 3 ARP REQUEST packets

Task: Find duplicate IP

The -D option specifies duplicate address detection mode (DAD). It returns exit status 0, if DAD succeeded i.e. no replies are received.
$ sudo arping -D -I eth0 -c 2
If duplicated you should see zero exit status:
$ echo $?
Always use following syntax for duplicate address detection with arping:
$ sudo arping -D -I <interface-name> -c 2 <IP-ADDRESS-TO-TEST>
$ echo $?


Lighttpd virtualhost configuration ~ name-based virtual hosting

Q. How do I configure lighttpd web server as virtual host for serving multiple web site from a single public IP address (name-based virtual hosting)?

A. Virtual hosting is a method that servers such as webservers use to host more than one domain name on the same server, sometimes on the same IP address.

There are two basic methods of accomplishing virtual hosting .
(A) name-based virtual hosting : You use multiple host names for the same webserver IP address. For example domain nixcraft.com and theos.in uses same IP address called

(B) ) IIP address / ip-based virtual hosting

How do I configure Lighttpd for name-based virtual hosting?

Let us say your setup is as follows:

  • Public IP address:
  • Domain names: domain1.com and domain2.net
  • Default Document Root: /home/lighttpd/default/http
  • Default Document Root for domain1.com: /home/lighttpd/domain1.com/http
  • Default Document Root for domain2.net: /home/lighttpd/domain2.net/http

First, create required directories:
# mkdir -p /home/lighttpd/default/http
Next, open lighttpd.conf file:
# vi /etc/lighttpd/lighttpd.conf
Setup default document root:
server.document-root = "/home/lighttpd/default/http/"
Setup public IP address:
server.port = 80
server.bind = ""

At the bottom of the file, add:
include "domain1.com.conf"
include "domain2.net.conf"

Save and close the file.

Create domain1.com virtual host configuration

Create required directories:
# mkdir -p /home/lighttpd/domain1.com/http
# mkdir -p /home/lighttpd/domain1.com/logs

Open /etc/lighttpd/domain1.com.conf file:
# vi /etc/lighttpd/domain1.com.conf
Add following configuration directive:

$HTTP["host"] =~ "domain1\.com" {
            server.document-root = "/home/lighttpd/domain1.com/http"
            accesslog.filename         = "/home/lighttpd/domain1.com/logs/access.log"

Save and close the file.

Create domain2.net virtual host configuration

Create required directories:
# mkdir -p /home/lighttpd/domain2.net/http
# mkdir -p /home/lighttpd/domain2.net/logs

Open /etc/lighttpd/domain2.net.conf file:
# vi /etc/lighttpd/domain2.net.conf
Add following configuration directive:

$HTTP["host"] =~ "domain2\.net" {
            server.document-root = "/home/lighttpd/domain2.net/http"
            accesslog.filename         = "/home/lighttpd/domain2.net/logs/access.log"

Save and close the file.

Restart the lighttpd web server:
# /etc/init.d/lighttpd restart

Make sure document root is owned by your web server user such as www-data or lighttpd:
# chown -R lighttpd:lighttpd /home/lighttpd/

Block ip address of spammers with iptables under Linux

Q. How do I block ip address of spammers with iptables based firewall under CentOS Linux 5?

A. You can simply block IP address of spammers by editing /etc/sysconfig/iptables file under:

a) CentOS Linux
b) Fedora Linux
c) RHEL 4.x/5.x etc

Open file /etc/sysconfig/iptables:
# vi /etc/sysconfig/iptables
Append ip address of spammers as follows:
-A RH-Firewall-1-INPUT -s SPAMMER-IP -j DROP

Save and close the file. Just restart the firewall:
# /etc/init.d/iptables restart

You can also create a small shell script to block lots of IP address at a time.

HowTo Bind A Range Of IP’s in Debian / Ubuntu Linux

I‘ve recently installed Debian Linux 4.0 on my server and Ubuntu Linux 7.04 on Laptop. I would love to have a multiple IP address that I can use for verity of purposes. I would like to bind 4 IP’s to the ‘eth0’ device or NIC. How do I achieve this?
[click to continue…]

HowTo Test or Check Reverse DNS on a Linux / Unix

I am a new Linux and Unix command line user. How do I test or check reverse DNS for given IP address under Linux, OS X, BSD, Unix-like or Windows XP/Server 2003 based systems?
[click to continue…]