[Openswan Users] Openswan to Openswan (behind a NAT)

Paul Wouters paul at xelerance.com
Mon Sep 21 13:06:01 EDT 2009

On Mon, 21 Sep 2009, JT Edwards wrote:

> conn ait-2-torden-xen
>         type=tunnel
>         aggrmode=no
>         compress=no
>         authby=secret
>         right= #Public IP of local Openswan server
>         rightid= #Public IP of local Openswan server
>         rightnexthop= #Public IP of Gateway front of local Openswan server
>         rightsubnet= # Subnet on local Openswan server  virbr0
>         rightsourceip= # IP address within network
>         left=    #LAN IP of remote Openswan server
>         leftid=  #Public IP of router in front of Openswan server
>         leftnexthop= #Public IP of Gateway of router in front of remote Openswan server
>         leftsubnet= # Subnet on remote Openswan server  virbr0
>         leftsourceip= # IP address within network
>         auto=start

If you are behind NAT then you need to specify (assuming your left) left=localip and on the
other side, the "remote end" needs to point to the publicip. Note that this makes the
configuration file assymettrical (and you cannot use the identical conn description on
both ends).

the nexthop and sourceip settings are only relevant locally (they are not exchanged) and
should match the local setup. so a nexthop is really the ip of the default gateway if
you're behind NAT (usually the same as the ip specified as remote on the other end)


More information about the Users mailing list