*BSD News Article 61945


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!newshost.telstra.net!testpattern.telstra.net!usenet
From: Wayne Farmer <wayne@telstra.net>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Multiple IP Addresses on same Machine
Date: Fri, 23 Feb 1996 12:00:56 +1100
Organization: Telstra Internet
Lines: 15
Message-ID: <312D11C8.41C67EA6@telstra.net>
NNTP-Posting-Host: pizza.telstra.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0 (X11; I; FreeBSD 2.1.0-RELEASE i386)

AS I had posted on this subject previously, I thought I would add
something that does not appear to have been included in other comments
on the subject.

To add another IP address, do the following :

ifconfig "network_interface" inet a.b.c.d netmask 255.255.255.255 alias
route add route add a.b.c.d localhost

where network interface is ed0, ep0 etc.

The 255.255.255.255 is required if you wish to talk to yourself using
that IP address (e.g. web serving multiple virtual domains)

Most previous answers have omitted the netmask.