From owner-freebsd-net Mon Apr 23 14: 6:47 2001 Delivered-To: freebsd-net@freebsd.org Received: from cody.jharris.com (cody.jharris.com [205.238.128.83]) by hub.freebsd.org (Postfix) with ESMTP id 2CC7837B423 for ; Mon, 23 Apr 2001 14:06:42 -0700 (PDT) (envelope-from nick@rogness.net) Received: from localhost (nick@localhost) by cody.jharris.com (8.11.1/8.9.3) with ESMTP id f3NMEmo25703 for ; Mon, 23 Apr 2001 17:14:49 -0500 (CDT) (envelope-from nick@rogness.net) Date: Mon, 23 Apr 2001 17:14:48 -0500 (CDT) From: Nick Rogness X-Sender: nick@cody.jharris.com To: freebsd-net@freebsd.org Subject: Re: Multi-Destination gif tunnel In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sat, 7 Apr 2001, Nick Rogness wrote: > > Multi-Destination gif tunnel > > Anybody had any success at setting these things up? I have a couple of > questions...maybe someone can answer: Since noone answered the mail, I will post the solution in case someone needs this info and searches the mail archives. Maybe it could be added in the gif man page at some point. > > In gif(4) man: > > "With IFF_LINK0 interface flag, gif can be configured to implement > multi-destination tunnel. With IFF_LINK0, it is able to configure egress > point to IPv4 wildcard address (0.0.0.0) or IPv6 unspecified address > (0::0)." > > Umm ok: > > # ifconfig gif0 link0 > # gifconfig gif0 inet 10.0.0.1 0.0.0.0 > OK, 10.0.0.1 being your outside IP. > "In this case, destination address for the outer IP header is determined > based on the routing table setup." > > Ok, what about the inner header setup? The inner header is setup with ifconfig, no different than it is with a bi-directional gif tunnel. So: hadji# ifconfig gif0 172.16.1.1 172.16.1.2 172.16.1.1 being Your inside source IP and 172.16.1.2 being the inside destination IP. > > And what about the outside destination ip? How do you > configure that to go out gif0 ? With the -iface flag [tried it > didn't work]. The tricky part here is to remove the existing interface route that is added with the above ifconfig command. hadji# route delete 172.16.1.2 I'm sure there are variations on how to get this to work without removing this route, but I chose to remove the route instead. Then add the route for gif outside dest IP like so: hadji# route add 172.16.1.2 24.13.10.5 -iface 172.16.1.1 So the packet going outbound will have a header like this: 10.0.0.1 > 24.13.10.5 : 172.16.1.1 > 172.16.1.2 |____________________| |______________________| ^ ^ Outside header Inside header Now, Setup the other side with the same strategy: thunder# ifconfig gif0 link0 thunder# gifconfig gif0 inet 24.13.10.5 0.0.0.0 thunder# ifconfig gif0 172.16.1.2 172.16.1.1 thunder# route delete 172.16.1.1 thunder# route add 172.16.1.1 10.0.0.1 -iface 172.16.1.2 Nick Rogness - Keep on Routing in a Free World... "FreeBSD: The Power to Serve!" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message