Date: Sun, 5 Jan 1997 00:10:28 -0800 (PST) From: Vincent Poy <vince@mail.MCESTATE.COM> To: Darius Moos <moos@degnet.baynet.de> Cc: questions@freebsd.org Subject: Re: FreeBSD ethernet alias setup Message-ID: <Pine.BSF.3.95.970105000533.3055V-100000@mail.MCESTATE.COM> In-Reply-To: <3.0.32.19970105062634.00722f0c@cyclone.degnet.baynet.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <paul@nation-net.com> To: Dean Neumann <dneum@telelink.com> 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 <device> alias <ip alias> route add <ip alias> 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 > > > > > > > > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970105000533.3055V-100000>