From owner-freebsd-hackers Fri Oct 22 1:22:56 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from relay.ucb.crimea.ua (UCB-Async4-CRISCO.CRIS.NET [212.110.129.130]) by hub.freebsd.org (Postfix) with ESMTP id B99B214ECB for ; Fri, 22 Oct 1999 01:21:36 -0700 (PDT) (envelope-from ru@ucb.crimea.ua) Received: (from ru@localhost) by relay.ucb.crimea.ua (8.9.3/8.9.3/UCB) id LAA76283; Fri, 22 Oct 1999 11:19:25 +0300 (EEST) (envelope-from ru) Date: Fri, 22 Oct 1999 11:19:25 +0300 From: Ruslan Ermilov To: Graham Wheeler Cc: hackers@FreeBSD.ORG Subject: Re: aliasing a point-to-point interface Message-ID: <19991022111925.B69348@relay.ucb.crimea.ua> Mail-Followup-To: Graham Wheeler , hackers@FreeBSD.ORG References: <99102118512208.17915@cequrux.com> <19991021202957.C83927@cequrux.com> <9910220959290C.17915@cequrux.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <9910220959290C.17915@cequrux.com>; from Graham Wheeler on Fri, Oct 22, 1999 at 09:58:44AM +0200 X-Operating-System: FreeBSD 3.3-STABLE i386 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Oct 22, 1999 at 09:58:44AM +0200, Graham Wheeler wrote: > On Thu, 21 Oct 1999, Ruslan Ermilov wrote: > > On Thu, Oct 21, 1999 at 06:50:07PM +0200, Graham Wheeler wrote: > > > Hi all > > > > > > Is it possible to assign an IP alias to a point to point interface (in my case, > > > a sync PPP interface)? It doesn't seem to be possible, but perhaps I'm > > > missing something... > > > > Yup, that's possible but is somewhat tricky: > > > > # ifconfig ptpN inet X.X.X.X X.X.X.X alias > > # route delete -host X.X.X.X > > # route add -host X.X.X.X -gateway 127.1 > > # ping X.X.X.X > > I should have mentioned that ip forwarding is turned off so that routing > via the loopback interface is not an option... > The above commands do not rely on the host's forwarding capabilities. The first `route' command will remove the weird `X.X.X.X via X.X.X.X' entry. The second `route' command will install the route allowing you to communicate with X.X.X.X from this host itself. Look: : relay# ifconfig sl9 inet 1.1.1.1 1.1.1.1 alias : relay# netstat -rn | grep ^1.1.1.1 : 1.1.1.1 1.1.1.1 UH 0 0 sl9 : relay# ping 1.1.1.1 : PING 1.1.1.1 (1.1.1.1): 56 data bytes : ^C : --- 1.1.1.1 ping statistics --- : 2 packets transmitted, 0 packets received, 100% packet loss : relay# route delete -host 1.1.1.1 : delete host 1.1.1.1 : relay# route add -host 1.1.1.1 127.1 : add host 1.1.1.1: gateway 127.1 : relay# netstat -rn | grep ^1.1.1.1 : 1.1.1.1 127.0.0.1 UGHS 0 0 lo0 : relay# ping 1.1.1.1 : PING 1.1.1.1 (1.1.1.1): 56 data bytes : 64 bytes from 1.1.1.1: icmp_seq=0 ttl=255 time=0.108 ms : 64 bytes from 1.1.1.1: icmp_seq=1 ttl=255 time=0.170 ms : 64 bytes from 1.1.1.1: icmp_seq=2 ttl=255 time=0.208 ms : ^C : --- 1.1.1.1 ping statistics --- : 3 packets transmitted, 3 packets received, 0% packet loss : round-trip min/avg/max/stddev = 0.108/0.162/0.208/0.041 ms -- Ruslan Ermilov Sysadmin and DBA of the ru@ucb.crimea.ua United Commercial Bank, ru@FreeBSD.org FreeBSD committer, +380.652.247.647 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message