From owner-freebsd-net@FreeBSD.ORG Sat Jun 28 22:18:20 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FF74106566B for ; Sat, 28 Jun 2008 22:18:20 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outZ.internet-mail-service.net (outz.internet-mail-service.net [216.240.47.249]) by mx1.freebsd.org (Postfix) with ESMTP id 269368FC0C for ; Sat, 28 Jun 2008 22:18:19 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 29BAD2360; Sat, 28 Jun 2008 15:18:20 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 864E92D60BD; Sat, 28 Jun 2008 15:18:18 -0700 (PDT) Message-ID: <4866B8BB.1040908@elischer.org> Date: Sat, 28 Jun 2008 15:18:35 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: serg vasilyev References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: setfib with mpd - ifconfig on p-t-p link trouble X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jun 2008 22:18:20 -0000 serg vasilyev wrote: > Hi ! > there's must be a restriction in ifconfig or in kernel that preventing from > adding a multiple p-t-p interface with same destination address. > i'm trying to build a test system with setfib and multiple mpd instances > which are creating PPPoE connection to same destination gateway and run into > problem with second p-t-p interface. > mpd did not add an IP and gateway for it this is a misunderstanding of what setfib does. You can only have one point to poitn interface with the same destination address. Having multiple routing tables does not automatically make it possible to have tow tunnels to the same place, (though theoretically maultipath routing might make this possible) because you still need to specify the remote address to specify the route's action. If you have multiple p2p links with the same remote address, you cannot specify which interface to use for a particular route. > > setfib 1 mpd1 -p /tmp/mpd1.pid -f mpd1.conf > sleep 2 > setfib 2 mpd2 -p /tmp/mpd2.pid -f mpd2.conf > > on a first interface ng0 i have both src ip and dst ip but on second i have > nothing > > # ifconfig ng0 > ng0: flags=88d1 mtu 1492 > inet x.x.x.x --> y.y.y.y netmask 0xffffffff > # ifconfig ng1 > ng1: flags=88d1 mtu 1492 > > when i try to add ip's personally > # ifconfig ng1 z.z.z.z y.y.y.y > ifconfig: ioctl (SIOCAIFADDR) File exist > > How to remove the given restriction on an ifconfig or kernel or something > else > P.S. Sorry for my english... you MAY be able to manually remove the link addresses from both routing tables after adding the first p2p link, and then add the second interface, and then remove the link address from the first fib, and add back the first link route from the first p3p link to teh first FIB. but I have not tested this. currently, adding an interface addres teh link layer route to ALL fibs, leaving it up to the admin to remove them from the fibs he does not want them in. This was a decision I took but the other option would have been to add it to only the 'current' fib, which would have been even more disruptive. ok I tested this with gre tunnels: ifconfig gre0 create ifconfig gre1 create ifconfig gre0 1.1.1.1 2.2.2.2 # remove conflicting routes setfib -0 route delete 2.2.2.2 setfib -1 route delete 2.2.2.2 #now set up the second link ifconfig gre1 3.3.3.3 2.2.2.2 # and remove the rotue we don't want setfib -0 route delete 2.2.2.2 # and replace it with the one we DO want, # (or one that is equivalent) setfib -0 route add 2.2.2.2 -iface gre0 wsa05:rjulian 34] ifconfig [...] gre0: flags=9011 mtu 1476 inet 1.1.1.1 --> 2.2.2.2 netmask 0xff000000 gre1: flags=9011 mtu 1476 inet 3.3.3.3 --> 2.2.2.2 netmask 0xff000000 wsa05:rjulian 35] setfib -0 netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif [...] 2.2.2.2 3.3.3.3 UH 0 0 gre1 [...] wsa05:rjulian 36] setfib -1 netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif [...] 2.2.2.2 gre0 UGHS 0 0 gre0 [...] wsa05:rjulian 37] which would do what you want. now to make mpd know how to do that :-) > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"