Multiple loopback interfaces

Giorgos Keramidas keramida at ceid.upatras.gr
Thu Feb 3 12:03:58 PST 2005


On 2005-02-03 20:53, Erik Norgaard <norgaard at locolomo.org> 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#



More information about the freebsd-questions mailing list