From owner-freebsd-questions Sun Jan 5 05:43:55 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id FAA29876 for questions-outgoing; Sun, 5 Jan 1997 05:43:55 -0800 (PST) Received: from cyclone.degnet.baynet.de (root@cyclone.degnet.baynet.de [194.95.214.129]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id FAA29837 for ; Sun, 5 Jan 1997 05:41:26 -0800 (PST) Received: from nada (ppp3 [194.95.214.133]) by cyclone.degnet.baynet.de (8.6.12/8.6.9) with SMTP id PAA18108; Sun, 5 Jan 1997 15:42:55 +0100 Message-Id: <3.0.32.19970105143359.0069d1f8@cyclone.degnet.baynet.de> X-Sender: moos@cyclone.degnet.baynet.de (Unverified) X-Mailer: Windows Eudora Pro Version 3.0 (32) Date: Sun, 05 Jan 1997 14:34:10 -0100 To: Vincent Poy From: Darius Moos Subject: Re: FreeBSD ethernet alias setup Cc: questions@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > I know, I lost the reply and couldn't find it. I found this in >the FreeBSD Mailig List archives, would this also work? Not as is. Some little modifications are needed under FreeBSD-2.1.5: When chaining alias-arguments in one ifconfig-command, ifconfig only executes the first alias, the trailing aliases are dropped. So every alias needs an own ifconfig-call. You would have to shift through the words of the line >alias_ed1="alias x.x.x.x alias y.y.y.y alias z.z.z.z" and extract the appropriate arguments for ifconfig in the for-loop. Darius Moos. At 00:10 05.01.97 -0800, you wrote: >On Sun, 5 Jan 1997, Darius Moos wrote: > >> In FreeBSD-2.1.5 there is a special mechanism for doing this. >> Howto: >> In /etc/sysconfig: >> Set your network-devices but don't specify any arguments for them. >> In your case: >> ... >> network_interfaces="ed1 eth0 lo0" >> # no ifconfig_ed1-, ifconfig_eth0- or ifconfig_lo0-options here >> >> Then create files /etc/start_if.ed0, /etc/start_if.eth0 and /etc/start_if.lo0 >> In /etc/start_if.ed0: >> /sbin/ifconfig ed0 inet 206.171.98.29 netmask 255.255.255.0 >> /sbin/ifconfig ed0 inet 206.171.98.1 netmask 0xffffffff alias >> # more aliases if desired. >> >> In /etc/start_if.eth0: >> /sbin/ifconfig eth0 inet 206.13.17.50 206.13.17.49 netmask 255.255.255.252 >> >> In /etc/start_if.lo0: >> /sbin/ifconfig lo0 inet 127.0.0.1 >> >> Reboot. > > The problem with this one is that if you changed your ethernet >card, you might forget about the /etc/start_if.ed1 file. But isn't there >a easier way to do it? > >> BTW, you already asked the same question some time ago and i already answered >> it. > > I know, I lost the reply and couldn't find it. I found this in >the FreeBSD Mailig List archives, would this also work? > >Date: Tue, 14 May 1996 08:24:15 +0100 >From: Paul Walsh >To: Dean Neumann >Sender: owner-questions@FreeBSD.ORG >Subject: Re: ifconfig aliasing > >This is the answer to a similar question posted a few weeks ago ( and >probably a few weeks before that etc..) > >.................................................................... > >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 > >.................................................................... > > >Regards, Paul Walsh (www.nation-net.com) > > >Cheers, >Vince - vince@MCESTATE.COM - vince@GAIANET.NET >Unix Networking Operations >GaiaNet Corporation - M & C Estate >Beverly Hills, California USA 90210 > > >> At 17:29 04.01.97 -0800, you wrote: >> >Greetings, >> > >> > How does one setup a alias for ed1 of 206.171.98.1 when the >> >address for the machine is already 206.171.98.29 for use with the ET >> >Synchronous Serial Card as a router in /etc/sysconfig in FreeBSD 2.1.6R >> >since all the other machines are pointing to 206.171.98.1 for the default >> >route. Here is what I have in /etc/sysconfig now: >> > >> >network_interfaces="ed1 eth0 lo0" >> >ifconfig_ed1="inet 206.171.98.29 netmask 255.255.255.0" >> >ifconfig_eth0="inet 206.13.17.50 206.13.17.49 netmask 255.255.255.252" >> > >> >ifconfig_lo0="inet localhost" >> > >> >defaultrouter=206.13.17.49 >> > >> > >> >Cheers, >> >Vince - vince@MCESTATE.COM - vince@GAIANET.NET >> >Unix Networking Operations >> >GaiaNet Corporation - M & C Estate >> >Beverly Hills, California USA 90210 >> > >> > >> > >> > >> > > >