From owner-freebsd-questions@FreeBSD.ORG Thu Feb 3 20:03:58 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 911C116A4CE for ; Thu, 3 Feb 2005 20:03:58 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id B39F443D31 for ; Thu, 3 Feb 2005 20:03:57 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a220.otenet.gr [212.205.215.220]) j13K3sc4027533; Thu, 3 Feb 2005 22:03:55 +0200 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id j13K3rIg024358; Thu, 3 Feb 2005 22:03:53 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id j13K3ro3024356; Thu, 3 Feb 2005 22:03:53 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 3 Feb 2005 22:03:53 +0200 From: Giorgos Keramidas To: Erik Norgaard Message-ID: <20050203200353.GD19067@gothmog.gr> References: <4202813D.8050306@locolomo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4202813D.8050306@locolomo.org> cc: freebsd-questions@freebsd.org Subject: Re: Multiple loopback interfaces X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2005 20:03:58 -0000 On 2005-02-03 20:53, Erik Norgaard wrote: > I need to setup a testing environment to properly test a new firewall > ruleset, usually I'll install it on the machine and test it in a > closed environment, but this time I don't have the machine. > > Is it posible or advisable to create multiple loopback intefaces or > are there other suggestions on how to do this? Yes, it is possible. You can even use non-127.0.0.x addresses (lines wrapped to fit in 80 columns): % gothmog:/root# ifconfig lo1 plumb % gothmog:/root# ifconfig lo1 10.6.0.1/24 up % gothmog:/root# tcpdump -s 100 -i lo1 -qvlnn & % [1] 23432 % tcpdump: listening on lo1, link-type NULL (BSD loopback), % capture size 100 bytes % gothmog:/root# ping -c 2 10.6.0.1 >/dev/null 2>&1 ; sleep 01 % 22:02:01.823069 IP (tos 0x0, ttl 64, id 5813, offset 0, flags [none], % length: 84) 10.6.0.1 > 10.6.0.1: icmp 64: echo request seq 0 % 22:02:01.827119 IP (tos 0x0, ttl 64, id 5814, offset 0, flags [none], % length: 84) 10.6.0.1 > 10.6.0.1: icmp 64: echo reply seq 0 % 22:02:02.833529 IP (tos 0x0, ttl 64, id 5827, offset 0, flags [none], % length: 84) 10.6.0.1 > 10.6.0.1: icmp 64: echo request seq 1 % 22:02:02.833568 IP (tos 0x0, ttl 64, id 5828, offset 0, flags [none], % length: 84) 10.6.0.1 > 10.6.0.1: icmp 64: echo reply seq 1 % gothmog:/root# ifconfig lo1 unplumb % gothmog:/root#