From owner-freebsd-hackers Tue May 16 13:41:36 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id NAA19873 for hackers-outgoing; Tue, 16 May 1995 13:41:36 -0700 Received: from rrnet.com (rrnet.com [198.81.198.5]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id NAA19863 for ; Tue, 16 May 1995 13:41:29 -0700 Received: from localhost (erich@localhost) by rrnet.com (8.6.5/8.6.5) id PAA05480; Tue, 16 May 1995 15:42:15 -0500 Date: Tue, 16 May 1995 15:42:11 -0500 (CDT) From: "Eric L. Hernes" Subject: Re: alias ( secondary IP ) for Ethernet Ifaces in FreeBSD To: "Rodney W. Grimes" cc: rashid@haven.ios.com, hackers@FreeBSD.org In-Reply-To: <199505161914.MAA08933@gndrsh.aac.dev.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: hackers-owner@FreeBSD.org Precedence: bulk On Tue, 16 May 1995, Rodney W. Grimes wrote: > > > > > > > > On Mon, 15 May 1995, Rashid Karimov. wrote: > > > > > For example , I have ep0 iface and I want to assign the > > > secondary( alias) IP address to it . > > > What command should be issued ? > > > > > > ifconfig ep0 alias 199.199.199.22 > > > > should be > > ifconfig ep0 199.199.199.22 alias > > > > while we're on the subject is there an ``official'' place in /etc/rc* > > that these should go??? > > Can the alias appear on the same command as the ifconfig that brings > the interface up? If so the place to do this is /etc/sysconfig, > ifconfig_ep0="blah blah". I think that they need different ifconfig's here's what I tried... bash$ sudo ifconfig ep0 172.16.0.30 204.124.122.99 alias bash$ ifconfig -au ed0: flags=8863 mtu 1500 inet 204.124.120.30 netmask 0xffffff00 broadcast 204.124.120.255 ether 02:60:8c:dc:5b:e8 lo0: flags=8009 mtu 16384 inet 127.0.0.1 netmask 0xff000000 (no ep0) bash$ sudo ifconfig ep0 172.16.0.30 alias 204.124.122.99 bash$ ifconfig -au ed0: flags=8863 mtu 1500 inet 204.124.120.30 netmask 0xffffff00 broadcast 204.124.120.255 ether 02:60:8c:dc:5b:e8 lo0: flags=8009 mtu 16384 inet 127.0.0.1 netmask 0xff000000 (still no ep0, but we've already kind of decided that the position of `alias' isn't important) bash$ sudo ifconfig ep0 172.16.0.30 bash$ sudo ifconfig ep0 204.124.122.99 alias ifconfig: ioctl (SIOCAIFADDR): File exists bash$ netstat -i Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll ed0 1500 02.60.8c.dc.5b.e8 4565771 256 454861 0 3249 ed0 1500 204.124.120 jake 4565771 256 454861 0 3249 ed0 1500 204.124.121 jake1 4565771 256 454861 0 3249 ed0 1500 204.124.122 204.124.122.30 4565771 256 454861 0 3249 lp0* 1500 0 0 0 0 0 ep0 1500 00.20.af.d3.f3.8c 17684 0 25790 1 0 ep0 1500 172.16 jake0 17684 0 25790 1 0 ep0 1500 204.124.122 204.124.122.99 17684 0 25790 1 0 lo0 16384 68 0 68 0 0 lo0 16384 your-net localhost 68 0 68 0 0 now they are there, and i probably should have been doing `netstat -i' all along. ed0 and ep0 both have a few aliases. > If not I'll have to enhance the current handling of ifconfig in > /etc/netstart and /etc/sysconfig to deal with it. > right now i've got the ifconfig stuck into /etc/rc.local but it's ugly. > > -- > Rod Grimes rgrimes@gndrsh.aac.dev.com > Accurate Automation Company Custom computers for FreeBSD > erich. -- erich@rrnet.com erich@lodgenet.com