Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Apr 2001 17:14:48 -0500 (CDT)
From:      Nick Rogness <nick@rogness.net>
To:        freebsd-net@freebsd.org
Subject:   Re: Multi-Destination gif tunnel
Message-ID:  <Pine.BSF.4.21.0104231653020.25529-100000@cody.jharris.com>
In-Reply-To: <Pine.BSF.4.21.0104070801150.22583-100000@cody.jharris.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <nick@rogness.net>
 - 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0104231653020.25529-100000>