From owner-freebsd-questions Thu Apr 25 04:11:14 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id EAA02168 for questions-outgoing; Thu, 25 Apr 1996 04:11:14 -0700 (PDT) Received: from apollo.is.co.za (apollo.is.co.za [196.4.160.2]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id EAA02161 for ; Thu, 25 Apr 1996 04:11:10 -0700 (PDT) Received: from admin.is.co.za (admin.is.co.za [196.23.0.9]) by apollo.is.co.za (8.7.5/8.7.5/IShub#2) with ESMTP id NAA14704; Thu, 25 Apr 1996 13:10:53 +0200 (GMT) Received: (from robin@localhost) by admin.is.co.za (8.7.5/8.7.5/ISsubsidiary#1) id NAA18815; Thu, 25 Apr 1996 13:10:52 +0200 (GMT) From: Robin Lunn Message-Id: <199604251110.NAA18815@admin.is.co.za> Subject: Re: 2 differents IP on the same interface ? To: Eric.Berenguier@sycomore.fr (Eric Berenguier) Date: Thu, 25 Apr 1996 13:10:51 +0200 (GMT) Cc: questions@freebsd.org In-Reply-To: from "Eric Berenguier" at Apr 25, 96 12:12:46 pm X-Organisation: The Internet Solution (Pty) Ltd. X-Phone: +27-11-4475566; Fax: +27-11-4475567 Reply-To: robin@is.co.za X-AIDAT-Member: See http://www.aidat.org X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Eric Berenguier wrote: > Is it possible to give several adresses to a single network > interface on a FreeBSD system ? > (I know it's possible to do this with latest Linux kernel (IP_ALIAS)) I have no idea how this might be done with ppp or slip, but on ethernet the following: ifconfig alias route add 127.0.0.1 Lazy way to make this permanent: Add these commands to /etc/rc.local More scalable way to permanency: Add the following to /etc/sysconfig: (put them with like config options) -- # network interface aliases interface_aliases="ed1" alias_ed1="alias x.x.x.x" route_alias1="x.x.x.x 127.0.0.1" -- Add the word alias1 to the static_routes= definition. Add the following to /etc/netstart: -- # Set up any aliases to network interfaces. for device in ${interface_aliases}; do eval ifconfig_args=\$alias_${device} ifconfig ${device} ${ifconfig_args} done -- This way if you have more than one alias on an interface you just have: alias_ed1="alias x.x.x.x alias y.y.y.y alias z.z.z.z" route_alias1="x.x.x.x 127.0.0.1" route_alias2="y.y.y.y 127.0.0.1" route_alias3="z.z.z.z 127.0.0.1" static_routes="multicast alias1 alias2 alias3 loopback" All of your network config info is still in one file this way and you can easily see the aliases assigned to an interface. -- _ __ | Only my ideas here unless I say otherwise... ' ) ) / | (BeamJack@IRC) /--' ____/___o __ | "Nondum amabam, et amare amabam... quaerebam quid / \_(_) /_) (__/) )_ | amarem, amans amare." - St Augustine