FreeS/WAN FAQ

This is a collection of questions and answers, mostly taken from the FreeS/WAN mailing list. See the project web site for more information. All the FreeS/WAN documentation is online there.

Contributions to the FAQ are welcome. Please send them to the project mailing list.


Questions


What is FreeS/WAN?

FreeS/WAN is a Linux implementation of the IPSEC protocols, providing security services at the IP (Internet Protocol) level of the network.

For more detail, see our introduction document or the FreeS/WAN project web site.

How do I report a problem or seek help?

See our problem reporting document. Basically, what it says is give us the output from ipsec barf from both gateways. Without full information, we cannot diagnose a problem. However, ipsec barf produces a lot of output. If at all possible, please make barfs accessible via the web or FTP rather than sending enormous mail messages.

Use the mailing list for problem reports, rather than mailing developers directly. This gives you access to more expertise, including users who may have encountered and solved the same problems. In particular, for problems involving interoperation with another IPSEC implementation, the users often know more than the developers.

Using the list may also be important in relation to various cryptography export laws. A US citizen who provides technical assistance to foreign cryptographic work might be charged under the arms export regulations. Such a charge would be easier to defend if the discussion took place on a public mailing list than if it were done in private mail.

Generic questions

This is too complicated. Isn't there an easier way?

There are a number of Linux distributions or firewall products which include FreeS/WAN. See this list. Using one of these, chosen to match your requirements and budget, may save you considerable time and effort. (If you don't know your requirements, start by reading Schneier's Secrets and Lies. That gives the best overview of security issues I have seen.)

If you want the help of a contractor, or to hire staff with FreeS/WAN expertise, you could:

For companies offerring support, see the next question.

Can I get commercial support for this product?

Many of the distributions or firewall products which include FreeS/WAN (see this list) come with commercial support or have it available as an option.

Various companies specialize in commercial support of open source software. Our project leader was a founder of the first such company, Cygnus Support. It has since been bought by Redhat. Another such firm is Linuxcare.

Can FreeS/WAN talk to ...?

The IPSEC protocols are designed to support interoperation. In theory, any two IPSEC implementations should be able to talk to each other.

In practice, it is considerably more complex. We have a whole interop document devoted to it.

Can different FreeS/WAN versions talk to each other?

Linux FreeS/WAN can interoperate with many IPSEC implementations, including earlier versions of Linux FreeS/WAN itself.

In general, new versions will use existing configuration files, at least until the next major version number change. For example, 1.8 can use files created for 1.7, 1.6, even back to 1.0, but not from 0.92. This behaviour will continue until we release 2.0.

As of 1.8, however, conf file checking has become stricter, so that an error that may have slipped past the checks in an earlier version may be caught in a later one. From 1.8's doc/CHANGES:

      The internal configuration-file reader is progressively getting 
      fussier about what it will accept, which may cause problems for 
      illegal ipsec.conf files whose sins previously passed unnoticed.  
      IN PARTICULAR, the "auto" parameter's values are now checked for 
      legality everywhere.

Does FreeS/WAN run on my version of Linux?

We build and test on Redhat distributions, but FreeS/WAN runs just fine on several other distributions, sometimes with minor fiddles to adapt to the local environment. Details are in our
compatibility document. Also, some distributions or products come with FreeS/WAN included.

FreeS/WAN is intended to run on all CPUs Linux supports. As of June 2000, we know of it being used in production on x86, ARM, Alpha and MIPS. It has also had successful tests on PPC and SPARC, though we don't know of actual use there. Details are in our compatibility document.

FreeS/WAN has been tested on multiprocessor Intel Linux and worked there. Note, however, that we do not test this often and have never tested on multiprocessor machines of other architectures.

Can I modify FreeS/WAN to ...?

You are free to modify FreeS/WAN in any way. See the discussion of licensing in our introduction document.

Can I contribute to the project?

Is there detailed design documentation?

There are: The only formal design documents are a few papers in the last category above. All the other categories, however, have things to say about design as well.

Compilation problems

gmp.h: No such file or directory

Pluto needs the GMP (GNU Multi-Precision) library for the large integer calculations it uses in public key cryptography. This error message indicates a failure to find the library. You must install it before Pluto will compile.

The GMP library is included in most Linux distributions. Typically, there are two RPMs, libgmp and libgmp-devel, You need to install both, either from your distribution CDs or from your vendor's web site.

On Debian, a mailing list message reports that the command to give is apt-get install gmp2.

For more information and the latest version, see the GMP home page.

Life's little mysteries

FreeS/WAN is a fairly complex product. (Neither the networks it runs on nor the protocols it uses are simple, so it could hardly be otherwise.) It therefore sometimes exhibits behaviour which can be somewhat confusing, or has problems which are not easy to diagnose. This section tries to explain those problems.

Setup and configuration of FreeS/WAN are covered in other documentation sections:

However, we also list some of the commonest problems here.

I cannot ping ....

This question is dealt with in the configuration section under the heading multiple tunnels.

The standard subnet-to-subnet tunnel protects traffic only between the subnets. To test it, you must use pings that go from one subnet to the other.

For example, suppose you have:

      subnet a.b.c.0/24
             |
      eth1 = a.b.c.1
         gate1
      eth0 = 1.2.3.4
             |

       ~ internet ~

             |
      eth0 = 4.3.2.1
         gate2
      eth1 = x.y.z.1
              |
       subnet x.y.z.0/24

and the connection description:

conn abc-xyz
     left=1.2.3.4
     leftsubnet=a.b.c.0/24
     right=4.3.2.1
     rightsubnet=x.y.z.0/24

You can test this connection description only by sending a ping that will actually go through the tunnel. Assuming you have machines at addresses a.b.c.2 and x.y.z.2, pings you might consider trying are:

ping from x.y.z.2 to a.b.c.2 or vice versa
Succeeds if tunnel is working. This is the only valid test of the tunnel.
ping from gate2 to a.b.c.2 or vice versa
Does not use tunnel. gate2 is not on protected subnet.
ping from gate1 to x.y.z.2 or vice versa
Does not use tunnel. gate1 is not on protected subnet.
ping from gate1 to gate2 or vice versa
Does not use tunnel. Neither gate is on a protected subnet.

Only the first of these is a useful test of this tunnel. The others do not use the tunnel. Depending on other details of your setup and routing, they:

If required, you can of course build additional tunnels so that all the machines involved can talk to all the others. See multiple tunnels in the configuration document for details.

It takes forever to ...

Users fairly often report various problems involving long delays, sometimes on tunnel setup and sometimes on operations done through the tunnel, occasionally on simple things like ping or more often on more complex operations like doing NFS or Samba through the tunnel.

Almost always, these turn out to involve failure of a DNS lookup. The timeouts waiting for DNS are typically set long so that you won't time out when a query involves multiple lookups or long paths. Genuine failures therefore produce long delays before they are detected.

A mailing list message from project technical lead Henry Spencer:

> ... when i run /etc/rc.d/init.d/ipsec start, i get:
> ipsec_setup: Starting FreeS/WAN IPSEC 1.5...
> and it just sits there, doesn't give back my bash prompt.

Almost certainly, the problem is that you're using DNS names in your
ipsec.conf, but DNS lookups are not working for some reason.  You will
get your prompt back... eventually.  But the DNS timeouts are long.
Doing something about this is on our list, but it is not easy.

In the meanwhile, we recommend that connection descriptions in ipsec.conf(5) use numeric IP addresses rather than names which will require a DNS lookup.

Names that do not require a lookup are fine. For example:

These are fine. The @ sign prevents any DNS lookup. However, do not attempt to give the gateway address as left=camelot.example.org. That requires a lookup.

A post from one user after solving a problem with long delays:

Subject: Final Answer to Delay!!!
   Date: Mon, 19 Feb 2001
   From: "Felippe Solutions" <felippe@solutionstecnologia.com.br>

Sorry people, but seems like the Delay problem had nothing to do with
freeswan.

The problem was DNS as some people sad from the beginning, but not the way
they thought it was happening. Samba, ssh, telnet and other apps try to
reverse lookup addresses when you use IP numbers (Stupid that ahh).

I could ping very fast because I always ping with "-n" option, but I don't
know the option on the other apps to stop reverse addressing so I don't use
it.
This post is fairly typical. These problems are often tricky and frustrating to diagnose, and most turn out to be DNS-related.

One suggestion for diagnosis: test with both names and addresses if possible. For example, try all of:

If these behave differently, the problem must be DNS-related since the three commands do exactly the same thing except for DNS lookups.

I send packets to the tunnel with route(8) but they vanish

IPSEC connections are designed to carry only packets travelling between pre-defined connection endpoints. As project technical lead Henry Spencer put it:
IPsec tunnels are not just virtual wires; they are virtual wires with built-in access controls. Negotiation of an IPsec tunnel includes negotiation of access rights for it, which don't include packets to/from other IP addresses. (The protocols themselves are quite inflexible about this, so there are limits to what we can do about it.)
For fairly obvious security reasons, and to comply with the IPSEC RFCs, KLIPS drops any packets it receives that are not allowed on the tunnels currently defined. So if you send it packets with route(8), and suitable tunnels are not defined, the packets vanish. Whether this is reported in the logs depends on the setting of klipsdebug in your ipsec.conf(5) file.

To rescue vanishing packets, you must ensure that suitable tunnels for them exist, by editing the connection descriptions in ipsec.conf(5). For example, supposing you have a simple setup:

         leftsubnet -- leftgateway === internet === roadwarrior
If you want to give the roadwarrior access to some resource that is located behind the left gateway but is not in the currently defined left subnet, then the usual procedure is to define an additional tunnel for those packets by creating a new connection description.

In some cases, it may be easier to alter an existing connection description, enlarging the definition of leftsubnet. For example, instead of two connection descriptions with 192.168.8.0/24 and 192.168.9.0/24 as their leftsubnet parameters, you can use a single description with 192.168.8.0/23.

If you have multiple endpoints on each side, you need to ensure that there is a route for each pair of endpoints. See our configuration document for an example.

When a tunnel goes down, packets vanish

This is a special case of the vanishing packet problem described in the previous question. Whenever KLIPS sees packets for which it does not have a tunnel, it drops them.

When a tunnel goes away, either because negotiations with the other gateway failed or because you gave an ipsec auto --down command, the route to its other end is left pointing into KLIPS, and KLIPS will drop packets it has no tunnel for.

This is a documented design decision, not a bug. FreeS/WAN must not automatically adjust things to send packets via another route. The other route might be insecure.

Of course, re-routing may be necessary in many cases. In those cases, you have to do it manually or via scripts. We provide the ipsec auto --unroute command for these cases.

From ipsec_auto(8):

Normally, pluto establishes a route to the destination specified for a connection as part of the --up operation. However, the route and only the route can be established with the --route operation. Until and unless an actual connection is established, this discards any packets sent there, which may be preferable to having them sent elsewhere based on a more general route (e.g., a default route).
Normally, pluto's route to a destination remains in place when a --down operation is used to take the connection down (or if connection setup, or later automatic rekeying, fails). This permits establishing a new connection (perhaps using a different specification; the route is altered as necessary) without having a ``window'' in which packets might go elsewhere based on a more general route. Such a route can be removed using the --unroute operation (and is implicitly removed by --delete).
See also this mailing list message.

The firewall ate my packets!

If firewalls filter out:

then IPSEC cannot work. The first thing to check if packets seem to be vanishing is the firewall rules on the two gateway machines and any other machines along the path that you have access to.

For details, see our document on firewalls.

Dropped connections

Networks being what they are, IPSEC connections can be broken for any number of reasons, ranging from hardware failures to various software problems such as the path MTU problems discussed elsewhere in the FAQ. Fortunately, various diagnostic tools exist that help you sort many of the possible problems.

There is one situation, however, where FreeS/WAN (using default settings) may destroy a connection for no readily apparent reason. This occurs when things are misconfigured so that two tunnels from the same gateway expect the same subnet on the far end.

In this situation, the first tunnel comes up fine and works until the second is established. At that point, because of the way we track connections internally, the first tunnel ceases to exist as far as this gateway is concerned. Of course the far end does not know that and a storm of error messages appears on both systems as it tries to use the tunnel.

If the far end gives up, goes back to square one and negotiates a new tunnel, then that wipes out the second tunnel and ...

The solution is simple. Do not build multiple conn descriptions with the same remote subnet.

This is actually intended to be a feature, rather than a bug. Consider the situation where a single remote system goes down, then comes back up and reconnects to the gateway. It is useful to have the gateway tear down the old tunnel and recover resources when the reconnection is made. It recognises that situation by checking the remote subnet for each tunnel it builds and discarding duplicates. This works fine as long as you don't configure multiple tunnels with the same remote subnet.

If this behaviour is inconvenient for you, you can disable it by setting uniqueids=no in ipsec.conf(5).

TCPdump on the gateway shows strange things

Attempting to look at IPSEC packets by running monitoring tools on the IPSEC gateway machine can produce silly results. That machine is mangling the packets for IPSEC, and possibly for firewall or NAT purposes as well. If the internals of the machine's IP stack are not what the monitoring tool expects, then the tool can misinterpret them and produce nonsense output.

At one point, this problem was quite severe. On more recent systems, the problem has been solved. The version of tcpdump shipped with Redhat 6.2, for example, understands IPSEC well enough to be usable on a gateway. If in doubt about your version of tcpdump, you can get the latest version from tcpdump.org.

Even if you have a version of tcpdump that works on gateways however, the most certain way to examine IPSEC packets is to look at them on the wire. For security, you need to be certain, so we recommend doing that. To do so, you need a separate sniffer machine located between the two gateways. This machine can be routing IPSEC packets, but it must not be an IPSEC gateway.

A common test setup is to put a machine with dual Ethernet cards in between two gateways under test. The central machine both routes packets and provides a place to safely run tcpdump or other sniffing tools. What you end up with looks like:

Testing network

      subnet a.b.c.0/24
             |
      eth1 = a.b.c.1
         gate1
      eth0 = 192.168.p.1
             |
             |
      eth0 = 192.168.p.2
         route/monitor box
      eth1 = 192.168.q.2
             |
             |
      eth0 = 192.168.q.1
         gate2
      eth1 = x.y.z.1
              |
       subnet x.y.z.0/24

With p and q any convenient values that do not interfere with other routes you may have. The ipsec.conf(5) file then has, among other things:

conn abc=xyz
      left=192.168.p.1
      leftnexthop=192.168.p.2
      right=192.168.q.1
      rightnexthop=192.168.q.2
Once that works, you can remove the "route/monitor box", and connect the two gateways to the Internet. The only parameters in ipsec.conf(5) that need to change are the four shown above. You replace them with values appropriate for your Internet connection, and change the eth0 IP addresses and the default routes on both gateways.

Note that nothing on either subnet needs to change. This lets you test most of your IPSEC setup before connecting to the insecure Internet.

Testing in stages

It is often useful in debugging to test things one at a time:

  • disable IPSEC entirely, e.g. by turning it off with chkconfig(8), and make sure routing works
  • Once that works, try a manually keyed connection. This does not require key negotiation between Pluto and the key daemon on the other end.
  • Once that works, try automatically keyed connections
  • Once IPSEC works, add packet compression
  • Once everything seems to work, try stress tests with large transfers, many connections, frequent re-keying, ...

FreeS/WAN releases are tested for all of these, so you can be reasonably certain they can do them all. Of course, that does not mean they will on the first try, especially if you have some unusual configuration.

The rest of this section gives information on diagnosing the problem when each of the above steps fails.

Manually keyed connections don't work

Suspect one of:

  • mis-configuration of IPSEC system in the /etc/ipsec.conf file
    e.g. incorrect interface or next hop information
  • mis-configuration of manual connection in the /etc/ipsec.conf file
  • routing problems causing IPSEC packets to be lost
  • bugs in KLIPS
  • mismatch between the transforms we support and those another IPSEC implementation offers.

One manual connection works, but second one fails

This is fairly common problem when attempting to configure multiple manually keyed connections from a single gateway.

Each connection must be identified by a unique SPI value. For automatic connections, these values are assigned automatically. For manual connections, you must set them with spi= statements in ipsec.conf(5).

Each manual connection must have a unique SPI value in the range 0x100 to 0x999. Two or more with the same value will fail. For details, see our HTML doc section Using manual keying in production and the man page ipsec.conf(5).

Manual connections work, but automatic keying doesn't

The most common reason for this behaviour is a firewall dropping the UDP port 500 packets used in key negotiation.

Other possibilities:

IPSEC works, but connections using compression fail

Suspect one of:
  • (especially if small packets are OK, but large ones fail) compatibility issues with other implementations. We follow the RFCs and omit some extra material that many compression libraries add by default. Others may have the extras left in.

  • bugs in the FreeS/WAN IPComp code, which is new for 1.6 and not yet heavily tested

Small packets work, but large transfers fail

If tests with ping(1) and a small packet size succeed, but tests or transfers with larger packet sizes fail, suspect problems with path MTU discovery.

IPSEC makes packets larger by adding an ESP or AH header. This can tickle assorted bugs in path MTU discovery mechanisms and cause a variety of annoying symptoms. Here is one example of a discussion of this problem off the mailing list:

Date: Mon, 3 Apr 2000
From: "Michael H. Warfield" <mhw@wittsend.com>

Paul Koning wrote:

>  Chris>  It appears that the Osicom router discards IP
>  Chris> fragments...

> Amazing.  A device that discards fragments isn't a router, it's at
> best a boat anchor.

        It may not be exactly what it appears.  I ran into a similar problem
with an ISDN link a while ago giving similar symptoms.  Turned out that
the device was negotiating an MTU that it really couldn't handle and the
device in front of it (a Linux box with always defragment enabled) was
defragmenting the huge IPSec datagrams and then refragmenting them into
hunks that the ISDN PPP thought it could handle but couldn't.  Problem was
solved by manually capping the MTU on the ISDN link to a smaller value.

        I gave the FreeSwan guys a hard time until tracking it down since
FreeSwan was the only thing that appeared to be able to tickle the bug.
Nothing else seemed to be broken.  What it really was that MTU discovery
was avoiding the problem on normal links and it was only the IPSEC tunnels
that were creating huge datagrams that went through the defragment/refragment
process.

        Point here is that it "appeared" as though the ISDN link was
failing to handle fragments when it was really a configuration error and
a software bug resulting in a bad MTU that was really the culprit.  So
it may not be that the router is not handling fragments.  It may be that
it's missconfigured or has some other bug that only FreeSwan is tripping
over.

Subnet-to-subnet works, but tests from the gateways don't

This is described under I cannot ping... above.

Interpreting error messages

SIOCADDRT:Network is unreachable

This message is not from FreeS/WAN, but from the Linux IP stack itself. That stack is seeing packets it has no route for, either because your routing was broken before FreeS/WAN started or because FreeS/WAN's changes broke it.

Here is a message from FreeS/WAN "listress" (mailing list tech support person) Claudia Schmeing suggesting ways to diagnose and fix such problems:

You write,
> I have correctly installed freeswan-1.8 on RH7.0 kernel 2.2.17, but when 
> I setup a VPN connection with the other machine(RH5.2 Kernel 2.0.36 
> freeswan-1.0, it works well.) it told me that 
> "SIOCADDRT:Network is unreachable"!  But the network connection is no 
> problem.

Often this error is the result of a misconfiguration. 

Be sure that you can route successfully in the absence of Linux
FreeS/WAN. (You say this is no problem, so proceed to the next step.)

Use a custom copy of the default updownscript. Do not change the route 
commands, but add a diagnostic message revealing the exact text of the 
route command. Is there a problem with the sense of the route command
that you can see? If so, then re-examine those ipsec.conf settings
that are being sent to the route command. 

You may wish to use the ipsec auto --route and --unroute commands to 
troubleshoot the problem. See man ipsec_auto for details.
Since the above message was written, we have modified the updown script to provide a better diagnostic for this problem. Check /var/log/messages.

Connection names in Pluto error messages

From Pluto programmer Hugh Redelmeier:

| Jan 17 16:21:10 remus Pluto[13631]: "jumble" #1: responding to Main Mode from Road Warrior 130.205.82.46
| Jan 17 16:21:11 remus Pluto[13631]: "jumble" #1: no suitable connection for peer @banshee.wittsend.com
| 
|     The connection "jumble" has nothing to do with the incoming
| connection requests, which were meant for the connection "banshee".

You are right.  The message tells you which Connection Pluto is
currently using, which need not be the right one.  It need not be the
right one now for the negotiation to eventually succeed!  This is
described in ipsec_pluto(8) in the section "Road Warrior Support".

There are two times when Pluto will consider switching Connections for
a state object.  Both are in response to receiving ID payloads (one in
Phase 1 / Main Mode and one in Phase 2 / Quick Mode).  The second is
not unique to Road Warriors.  In fact, neither is the first any more
(two connections for the same pair of hosts could differ in Phase 1 ID
payload; probably nobody else has tried this).

Pluto: ... can't orient connection

Each Pluto needs to know whether it is running on the machine which the connection description calls left or on right. It figures that out by:
  • looking at the interfaces given in interfaces= lines in the config setup section
  • discovering the IP addresses for those interfaces
  • searching for a match between those addresses and the ones given in left= or right= lines.

Normally a match is found. Then Pluto knows where it is and can set up other things (for example, if it is left) using parameters such as leftsubnet and leftnexthop, and sending its outgoing packets to right.

If no match is found, it emits the above error message.

Pluto: ... no connection is known

This error message occurs when a remote system attempts to negotiate a connection and Pluto does not have a connection description that matches what the remote system has requested. The most common cause is a configuration error on one end or the other.

The match involves the left, right, leftsubnet and rightsubnet parameters and must be exact. For example, if your left subnet is a.b.c.0/24 then neither a single machine in that net nor a smaller subnet such as a.b.c.64/26 will be considered a match.

The message can also occur when an appropriate description exists but Pluto has not loaded it. Use an auto=add statement in the connection description, or an ipsec auto --add <conn_name> command, to correct this.

An explanation from the Pluto developer:

| Jul 12 15:00:22 sohar58 Pluto[574]: "corp_road" #2: cannot respond to IPsec
| SA request because no connection is known for
| 216.112.83.112/32===216.112.83.112...216.67.25.118

This is the first message from the Pluto log showing a problem.  It
means that PGPnet is trying to negotiate a set of SAs with this
topology:

216.112.83.112/32===216.112.83.112...216.67.25.118
^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^   ^^^^^^^^^^^^^
client on our side  our host         PGPnet host, no client

None of the conns you showed look like this.

Use
        ipsec auto --status
to see a snapshot of what connections are in pluto, what
negotiations are going on, and what SAs are established.

The leftsubnet= (client) in your conn is 216.112.83.64/26.  It must
exactly match what pluto is looking for, and it does not.

Pluto: ... OAKLEY_DES_CBC is not supported.

This message occurs when the other system attempts to negotiate a connection using single DES, which we do not support because it is insecure.

Another FAQ section describes how to deal with systems that attempt to use single DES.

Pluto: ... no acceptable transform

This message means that the other gateway has made a proposal for connection parameters, but nothing they proposed is acceptable to Pluto. Possible causes include: A more detailed explanation, from Pluto programmer Hugh Redelmaier:

Background:

When one IKE system (for example, Pluto) is negotiating with another
to create an SA, the Initiator proposes a bunch of choices and the
Responder replies with one that it has selected.

The structure of the choices is fairly complicated.  An SA payload
contains a list of lists of "Proposals".  The outer list is a set of
choices: the selection must be from one element of this list.

Each of these elements is a list of Proposals.  A selection must be
made from each of the elements of the inner list.  In other words,
*all* of them apply (that is how, for example, both AH and ESP can
apply at once).

Within each of these Proposals is a list of Transforms.  For each
Proposal selected, one Transform must be selected (in other words,
each Proposal provides a choice of Transforms).

Each Transform is made up of a list of Attributes describing, well,
attributes.  Such as lifetime of the SA.  Such as algorithm to be
used.  All the Attributes apply to a Transform.

You will have noticed a pattern here: layers alternate between being
disjunctions ("or") and conjunctions ("and").

For Phase 1 / Main Mode (negotiating an ISAKMP SA), this structure is
cut back.  There must be exactly one Proposal.  So this degenerates to
a list of Transforms, one of which must be chosen.

In your case, no proposal was considered acceptable to Pluto (the
Responder).  So negotiation ceased.  Pluto logs the reason it rejects
each Transform.  So look back in the log to see what is going wrong.

ECONNREFUSED error message

From John Denker, on the mailing list:

1)  The log message
  some IKE message we sent has been rejected with 
  ECONNREFUSED (kernel supplied no details)
is much more suitable than the previous version.  Thanks.

2) Minor suggestion for further improvement: it might be worth mentioning
that the command
  tcpdump -i eth1 icmp[0] != 8 and icmp[0] != 0
is useful for tracking down the details in question.  We shouldn't expect
all IPsec users to figure that out on their own.  The log message might
even provide a hint as to where to look in the docs.

Reply From Pluto developer Hugh Redelmeier

Good idea.

I've added a bit pluto(8)'s BUGS section along these lines.
I didn't have the heart to lengthen this message.
  • klips_debug: ... no eroute! This message means KLIPS has received a packet for which no IPSEC tunnel has been defined.

    Here is a more detailed duscussion from the team's tech support person Claudia Schmeing, responding to a query on the mailing list:

    > Why ipsec reports no eroute! ???? IP Masq... is disabled.
    In general, more information is required so that people on the list may
    give you informed input. See doc/prob.report.
    
    However, I can make some general comments on this type of error.
    
    This error usually looks something like this (clipped from an archived
    message):
    
    > ttl:64 proto:1 chk:45459 saddr:192.168.1.2 daddr:192.168.100.1
    > ... klips_debug:ipsec_findroute: 192.168.1.2->192.168.100.1
    > ... klips_debug:rj_match: * See if we match exactly as a host destination
    > ... klips_debug:rj_match: ** try to match a leaf, t=0xc1a260b0
    > ... klips_debug:rj_match: *** start searching up the tree, t=0xc1a260b0
    > ... klips_debug:rj_match: **** t=0xc1a260c8
    > ... klips_debug:rj_match: **** t=0xc1fe5960
    > ... klips_debug:rj_match: ***** not found.
    > ... klips_debug:ipsec_tunnel_start_xmit: Original head/tailroom: 2, 28
    > ... klips_debug:ipsec_tunnel_start_xmit: no eroute!: ts=47.3030, dropping.
    
    
    What does this mean?
    - --------------------
    
    "eroute" stands for "extended route", and is a special type of route 
    internal to Linux FreeS/WAN. For more information about this type of route, 
    see the section of man ipsec_auto on ipsec auto --route.
    
    "no eroute!" here means, roughly, that Linux FreeS/WAN cannot find an 
    appropriate tunnel that should have delivered this packet. Linux 
    FreeS/WAN therefore drops the packet, with the message "no eroute! ...
    dropping", on the assumption that this packet is not a legitimate 
    transmission through a properly constructed tunnel.
    
    
    How does this situation come about?
    - -----------------------------------
    
    Linux FreeS/WAN has a number of connection descriptions defined in 
    ipsec.conf. These must be successfully brought "up" to form actual tunnels.
    (see doc/setup.html's step 15, man ipsec.conf and man ipsec_auto 
    for details).
    
    Such connections are often specific to the endpoints' IPs. However, in 
    some cases they may be more general, for example in the case of 
    Road Warriors where left or right is the special value %any.
    
    When Linux FreeS/WAN receives a packet, it verifies that the packet has
    come through a legitimate channel, by checking that there is an
    appropriate tunnel through which this packet might legitimately have
    arrived. This is the process we see above.
    
    First, it checks for an eroute that exactly matches the packet. In the 
    example above, we see it checking for a route that begins at 192.168.1.2
    and ends at 192.168.100.1. This search favours the most specific match that
    would apply to the route between these IPs. So, if there is a connection 
    description exactly matching these IPs, the search will end there. If not, 
    the code will search for a more general description matching the IPs.
    If there is no match, either specific or general, the packet will be
    dropped, as we see, above.
    
    Unless you are working with Road Warriors, only the first, specific part 
    of the matching process is likely to be relevant to you.
    
    
    "But I defined the tunnel, and it came up, why do I have this error?"
    - ---------------------------------------------------------------------
    
    One of the most common causes of this error is failure to specify enough
    connection descriptions to cover all needed tunnels between any two 
    gateways and their respective subnets. As you have noticed, troubleshooting
    this error may be complicated by the use of IP Masq. However, this error is
    not limited to cases where IP Masq is used. 
    
    See doc/configuration.html#multitunnel for a detailed example of the 
    solution to this type of problem.
    

    ipsec_setup: Cannot adjust kernel flags

    A mailing list message form technical lead Henry Spencer:
    > When FreeS/WAN IPSEC 1.7 is starting on my 2.0.38 Linux kernel the following
    > error message is generated:
    > ipsec_setup: Cannot adjust kernel flags, no /proc/sys/net/ipsec directory!
    > What is supposed to create this directory and how can I fix this problem?
    
    I think that directory is a 2.2ism, although I'm not certain (I don't have
    a 2.0.xx system handy any more for testing).  Without it, some of the
    ipsec.conf config-setup flags won't work, but otherwise things should
    function. 
    
    You also need to enable the /proc filesystem in your kernel configuration for these operations to work.

    ... trouble writing to /dev/ipsec ... SA already in use

    From the mailing list:
    > When I activate one manual tunnels it works, but when I try to activate
    > another tunnel, it gives an error message...
    > tunnel_2: Had trouble writing to /dev/ipsec SA:tun0x200@202.103.5.63 --
    > SA already in use.  Delete old one first.
    
    Please read the Using manual keying in production discussion in
    config.html, specifically the part about needing a different spi
    (or spibase) setting for each connection. 
    
    This problem is also discussed in this FAQ under the heading One manual connection works, but second one fails.

    Can I ...

    Can I reload connection info without restarting?

    Yes, you can do this. Here are the details, in a mailing list message from Pluto programmer Hugh Redelmeier:
    | How can I reload config's without restarting all of pluto and klips?  I am using
    | FreeSWAN -> PGPNet in a medium sized production environment, and would like to be
    | able to add new connections ( i am using include config/* ) without dropping current
    | SA's.
    | 
    | Can this be done?
    | 
    | If not, are there plans to add this kind of feature?
    
            ipsec auto --add whatever
    This will look in the usual place (/etc/ipsec.conf) for a conn named
    whatever and add it.
    
    If you added new secrets, you need to do
            ipsec auto --rereadsecrets
    before Pluto needs to know those secrets.
    
    | I have looked (perhaps not thoroughly enough tho) to see how to do this:
    
    There may be more bits to look for, depending on what you are trying
    to do.
    

    Can I use several masqueraded subnets?

    Yes. This is done all the time. See the discussion in our setup document. The only restriction is that the subnets on the two ends must not overlap. See the next question.

    Here is a mailing list message on the topic. The user incorrectly thinks you need a 2.4 kernel for this -- actually various people have been doing on 2.0 and 2.2 for quite some time -- but he has it right for 2.4.

    Subject: Double NAT and freeswan working :)
       Date: Sun, 11 Mar 2001
       From: Paul Wouters <paul@xtdnet.nl>
    
    Just to share my pleasure, and make an entry for people who are searching
    the net on how to do this. Here's the very simple solution to have a double
    NAT'ed network working with freeswan. (Not sure if this is old news, but I'm
    not on the list (too much spam) and I didn't read this in any HOWTO/FAQ/doc
    on the freeswan site yet (Sandy, put it in! :)
    
    10.0.0.0/24 --- 10.0.0.1 a.b.c.d  ---- a.b.c.e {internet} ----+
                                                                  |
    10.0.1.0/24 --- 10.0.1.1 f.g.h.i  ---- f.g.h.j {internet} ----+
    
    the goal is to have the first network do a VPN to the second one, yet also
    have NAT in place for connections not destinated for the other side of the
    NAT. Here the two Linux security gateways have one real IP number (cable
    modem, dialup, whatever.
    
    The problem with NAT is you don't want packets from 10.*.*.* to 10.*.*.*
    to be NAT'ed. While with Linux 2.2, you can't, with Linux 2.4 you can.
    
    (This has been tested and works for 2.4.2 with Freeswan snapshot2001mar8b)
    
    relevant parts of /etc/ipsec.conf:
    
            left=f.g.h.i
            leftsubnet=10.0.1.0/24
            leftnexthop=f.g.h.j
            leftfirewall=yes
            leftid=@firewall.netone.nl
            leftrsasigkey=0x0........
            right=a.b.c.d
            rightsubnet=10.0.0.0/24
            rightnexthop=a.b.c.e
            rightfirewall=yes
            rightid=@firewall.nettwo.nl
            rightrsasigkey=0x0......
            # To authorize this connection, but not actually start it, at startup,
            # uncomment this.
            auto=add
    
    and now the real trick. Setup the NAT correctly on both sites:
    
    iptables -t nat -F
    iptables -t nat -A POSTROUTING -o eth0 -d \! 10.0.0.0/8 -j MASQUERADE
    
    This tells the NAT code to only do NAT for packets with destination other then
    10.* networks. note the backslash to mask the exclamation mark to protect it
    against the shell.
    
    Happy painting :)
    
    Paul
    

    Can I use subnets masqueraded to the same addresses?

    No. The notion that IP addresses are unique is one of the fundamental principles of the IP protocol. Messing with it is exceedingly perilous.

    Fairly often a situation comes up where a company has several branches, all using the same non-routable addresses, perhaps 192.168.0.0/24. This works fine as long as those nets are kept distinct. The IP masquerading on their firewalls ensures that packets reaching the Internet carry the firewall address, not the private address.

    This can break down when IPSEC enters the picture. FreeS/WAN builds a tunnel that pokes through both masquerades and delivers packets from leftsubnet to rightsubnet and vice versa. For this to work, the two subnets must be distinct.

    There are only two solutions to this problem.

    • Usually, you re-number the subnets. Perhaps the Vancouver office becomes 192.168.101.0/24, Calgary 192.168.102.0/24 and so on. FreeS/WAN can happily handle this. With, for example leftsubnet=192.168.101.0/24 and rightsubnet=192.168.102.0/24 in a connection description, any machine in Calgary can talk to any machine in Vancouver. If you want to be more restrictive and use something like leftsubnet=192.168.101.128/25 and rightsubnet=192.168.102.240/28 so only certain machines on each end have access to the tunnel, that's fine too.
    • Alternately, you can just give up routing directly to machines on the subnets. Omit the leftsubnet and rightsubnet parameters from your connection descriptions. Your IPSEC tunnels will then run between the public interfaces of the two firewalls. Packets will be masqueraded both before they are put into tunnels and after they emerge. Your Vancouver client machines will see only one Calgary machine, the firewall.

    Can I assign a road warrior an address on my net?

    Yes, but it is tricky. This has been discussed on the mailing list. The discussion was not entirely clear to me, so I cannot yet document the procedures. At this point, all I know is:
    • You can use a variant of the extruded subnet procedure.
    • You have to avoid having the road warrior's assigned address within the range you actually use at home base. See previous question.
    • On the other hand, you want the roadwarrior's address to be within the range that seems to be on your network.

    For example, you might have:

    leftsubnet=a.b.c.0/25
    head office network
    rightsubnet=a.b.c.240/32
    extruded to a road warrior
    a.b.c.0/24
    whole network, including both the above

    Can I use Quality of Service routing with FreeS/WAN?

    From project technical lead Henry Spencer:
    > Do QoS add to FreeS/WAN?
    > For example integrating DiffServ and FreeS/WAN?
    
    With a current version of FreeS/WAN, you will have to add hidetos=no to
    the config-setup section of your configuration file.  By default, the TOS
    field of tunnel packets is zeroed; with hidetos=no, it is copied from the
    packet inside.  (This is a modest security hole, which is why it is no
    longer the default.)
    
    DiffServ does not interact well with tunneling in general.  Ways of
    improving this are being studied.
    
    See ipsec.conf(5) for more on the hidetos= parameter.

    Does FreeS/WAN support X.509 or other PKI certificates?

    FreeS/WAN, as distributed, does not currently support use of
    X.509 or other PKI certificates for authentication of gateways. We are concentrating on moving toward authentication via Secure DNS and opportunistic encryption; X.509 support is not (or at least not yet) on the priority list.

    On the other hand, it is a priority for some users and user-contributed patches are available to add X.509 certificate support to FreeS/WAN now. See the patches section of our web references document for details.

    Does FreeS/WAN support Radius or other user authentication?

    Not yet. So far, there is no standard way to authenticate users for IPSEC, though there is a very active IETF working group looking at the problem, and several vendors have implemented various things already.

    In the absence of a standard, user authentication has not been a priority for the FreeS/WAN team, and is unlikely to become one. This would be a good project for a volunteer, perhaps a staff member or contractor at some company that needs the feature. Certainly our team would co-operate with such an effort; we just don't have time to do it.

    Of course, there are various ways to avoid any requirement for user authentication in IPSEC. Consider the situation where road warriors build IPSEC tunnels to your office net and you are considering requiring user authentication during tunnel negotiation. Alternatives include:

    • If you can trust the road warrior machines, then set them up so that only authorised users can create tunnels. If your road warriors use laptops, consider the possibility of theft.
    • If the tunnel only provides access to particular servers and you can trust those servers, then set the servers up to require user authentication.
    If either of those is trustworthy, it is not clear that you need user authentication in IPSEC.

    Does FreeS/WAN support single DES encryption?

    No, single DES is not used either at the
    IKE level for negotiating connections or at the IPSEC level for actually building them.

    Single DES is insecure.

    But isn't DES support part of the IPSEC standard?

    Yes, but DES is insecure. As we see it, it is more important to deliver real security than to comply with a standard which has been subverted into allowing use of inadequate methods. See this discussion.

    I have to talk to .... which offers only DES. How do I do this?

    Ask the device vendor for the
    triple DES upgrade. These exist for many IPSEC devices. If no cipher stronger than DES is available, we recommend you not use that IPSEC implementation.

    If a 3DES implementation exists but your vendor cannot sell it to you because of export laws, consider complaining to one or more of:

    • the vendor
    • your own government, especially any branch concerned with citizen's privacy and/or protection of communication infrastructure
    • the local embassy of the nation which restricts export to you

    Consider using FreeS/WAN instead. PCs are cheap and we deliver 3DES now.

    As a matter of project policy, we will not help anyone subvert FreeS/WAN to provide insecure DES encryption.

    Why don't you restrict the mailing list to reduce spam?

    As a matter of policy, the list needs to be open to non-subscribers. Project management feel strongly that maintaining this openness is more important than blocking spam.

    This has been discussed several times at some length on the list. See the list archives. Bringing the topic up again is unlikely to be useful. Please don't. Or at the very least, please don't without reading the archives and being certain that whatever you are about to suggest has not yet been discussed.

    Project technical lead Henry Spencer summarised one discussion:

    For the third and last time: this list *will* *not* do address-based filtering. This is a policy decision, not an implementation problem. The decision is final, and is not open to discussion. This needs to be communicated better to people, and steps are being taken to do that.
    Adding this FAQ section is one of the steps he refers to.

    You have various options other than just putting up with the spam or unsubscribing:

    A number of tools are available to filter mail.

    • Many mail readers include some filtering capability.
    • Many Linux distributions include procmail(8) for server-side filtering.
    • The Spam Bouncer is a set of procmail(8) filters designed to combat spam.
    • Roaring Penguin have a MIME defanger that removes potentially dangerous attachments.

    If you use your ISP's mail server rather than running your own, consider suggesting to the ISP that they tag suspected spam as this ISP does. They could just refuse mail from dubious sources, but that is tricky and runs some risk of losing valuable mail or senselessly annoying senders and their admins. However, they can safely tag and deliver dubious mail. The tags can greatly assist your filtering.

    For information on tracking down spammers, see these HowTos, or the Sputum site.

    Here is a more detailed message from Henry:

    On Mon, 15 Jan 2001, Jay Vaughan wrote:
    > I know I'm flogging a dead horse here, but I'm curious as to the reasons for
    > an aversion for a subscriber-only mailing list?
    
    Once again:  for legal reasons, it is important that discussions of these
    things be held in a public place -- the list -- and we do not want to
    force people to subscribe to the list just to ask one question, because
    that may be more than merely inconvenient for them.  There are also real
    difficulties with people who are temporarily forced to use alternate
    addresses; that is precisely the time when they may be most in need of
    help, yet a subscribers-only policy shuts them out.
    
    These issues do not apply to most mailing lists, but for a list that is
    (necessarily) the primary user support route for a crypto package, they
    are very important.  This is *not* an ordinary mailing list; it has to
    function under awkward constraints that make various simplistic solutions
    inapplicable or undesirable. 
    
    > We're *ALL* sick of hearing about list management problems, not just you
    > old-timers, so why don't you DO SOMETHING EFFECTIVE ABOUT IT...
    
    Because it's a lot harder than it looks, and many existing "solutions"
    have problems when examined closely.
    
    > A suggestion for you, based on 10 years of experience with management of my
    > own mailing lists would be to use mailman, which includes pretty much every
    > feature under the sun that you guys need and want, plus some.  The URL for
    > mailman...
    
    I assure you, we're aware of mailman.  Along with a whole bunch of others,
    including some you almost certainly have never heard of (I hadn't!).
    
    > As for the argument that the list shouldn't be configured to enforce
    > subscription - I contend that it *SHOULD* AT LEAST require manual address
    > verification in order for posts to be redirected.
    
    You do realize, I hope, that interposing such a manual step might cause
    your government to decide that this is not truly a public forum, and thus
    you could go to jail if you don't get approval from them before mailing to
    it?  If you think this sounds irrational, your government is noted for
    making irrational decisions in this area; we can't assume that they will
    suddenly start being sensible.  See above about awkward constraints.  You
    may be willing to take the risk, but we can't, in good conscience, insist
    that all users with problems do so. 
    
                                                              Henry Spencer
                                                           henry@spsystems.net
    
    and a message on the topic from project leader John Gilmore:
    Subject: Re: The linux-ipsec list's topic
       Date: Sat, 30 Dec 2000
       From: John Gilmore <gnu@toad.com>
    
    I'll post this single message, once only, in this discussion, and then
    not burden the list with any further off-topic messages.  I encourage
    everyone on the list to restrain themself from posting ANY off-topic
    messages to the linux-ipsec list.
    
    The topic of the linux-ipsec mailing list is the FreeS/WAN software.
    
    I frequently see "discussions about spam on a list" overwhelm the
    volume of "actual spam" on a list. BOTH kinds of messages are
    off-topic messages.  Twenty anti-spam messages take just as long to
    detect and discard as twenty spam messages.
    
    The Linux-ipsec list encourages on-topic messages from people who have
    not joined the list itself.  We will not censor messages to the list
    based on where they originate, or what return address they contain.
    In other words, non-subscribers ARE allowed to post, and this will not
    change.  My own valid contributions have been rejected out-of-hand by
    too many other mailing lists for me to want to impose that censorship
    on anybody else's contributions.  And every day I see the damage that
    anti-spam zeal is causing in many other ways; that zeal is far more
    damaging to the culture of the Internet than the nuisance of spam.
    
    In general, it is the responsibility of recipients to filter,
    prioritize, or otherwise manage the handling of email that comes to
    them.  It is not the responsibility of the rest of the Internet
    community to refrain from sending messages to recipients that they
    might not want to see.  If your software infrastructure for managing
    your incoming email is insufficient, then improve it.  If you think
    the signal-to-noise ratio on linux-ipsec is too poor, then please
    unsubscribe.  But don't further increase the noise by posting to the
    linux-ipsec list about those topics.
    
            John Gilmore
            founder & sponsor, FreeS/WAN project