Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Mar 2000 12:22:50 -0800 (PST)
From:      Archie Cobbs <archie@whistle.com>
To:        julian@elischer.org (Julian Elischer)
Cc:        ales@megared.net.mx (Alejandro Ramirez), net@freeBSD.org
Subject:   Re: GRE Support in 4.X ???
Message-ID:  <200003012022.MAA71299@bubba.whistle.com>
In-Reply-To: <38BD77CC.794BDF32@elischer.org> from Julian Elischer at "Mar 1, 2000 12:04:28 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Julian Elischer writes:
> I know Archie did some work with GRE
> but I can't remember how he did it.
> Archie?
> (netgraph? or was it int he ppp daemon?)

You can do GRE in FreeBSD without any modifications simply
by opening a raw IP socket.  This is how mpd does it (actually
using ng_ksocket(8) to create the socket and ng_pptpgre(8) do
do the handling of the GRE packets).

However, really FreeBSD should have built-in support for GRE
so you could say, eg:

  s = socket(PF_INET, SOCK_DGRAM, IPPROTO_GRE);

  sin.sin_addr = 192.168.1.1;
  sin.sin_port = 0x883E;	// GRE protocol number

  bind(s, (struct sockaddr *)&sin, sizeof(sin));

It looks like they have done the first part (create the socket type)
but not the second part (allow you to bind to a specific GRE protocol).

Instead, they hard code the squid protocol number 0x883E into the
kernel, turning GRE (generic routing encapsulation) into SRE (specific
routing encapsulation :-)

These patches would not be necessary if they just used a raw socket.
On the other hand, we should add (complete) GRE support to FreeBSD
anyway.

-Archie

> Alejandro Ramirez wrote:
> >     I Just like to ask if there will be support for GRE in 4.X releases
> > (without tunnels implementations), because its needed by wccp protocol
> > managed by Squid & Cisco routers, to create Cache Engines, there are some
> > patches & files that works in the squid home page, Im using them right now
> > with 3.4, and they work great:
> > 
> > http://www.squid-cache.org/WCCP-support/FreeBSD/gre.patch
> > &
> > http://www.squid-cache.org/WCCP-support/FreeBSD/gre.c
> > 
> > but I think it would be nice to see them integrated in to the base system.
> > 
> > Here it is the Squid description for GRE Support (taken from the webpage):
> > 
> > FreeBSD first needs to be configured to recieve and strip the GRE
> > encapsulation from the packets from the router. To do this you will need to
> > patch and recompile your kernel.
> > 
> > First, a patch needs to be applied to your kernel for GRE support. Apply
> > this patch to your 3.1 kernel. If you use a version other than 3.1 it may
> > not apply. You will need to manually change the appropriate files.
> > 
> > Secondly you will need to download gre.c and copy it to
> > /usr/src/sys/netinet/gre.c.
> > 
> > Finally add "OPTION GRE" to your kernel config file and rebuild your kernel.
> > Note, the opt_gre.h file is created when you run config. Once your kernel is
> > installed you will need to configure FreeBSD for transparent proxying.

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


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?200003012022.MAA71299>