Hello Folks,
I'm able to set up a VPN connection between two networks when I know my peer VPN gateway address. I need to set up our VPN gateway in such a way that our staff can access our internal network from any where in the world. What this means is that we don't know the IP address that they will be connecting from, but they know our VPN gateway's IP address. I tried setting up our isakmpd.conf in a similar manner, except that I put 0.0.0.0/0 for the peer gateway, but then isakmpd complains that it can't create a connection to the IP address 0.0.0.0. I've tried googling and searching on the 'Net for such a config, but I can't seem to find any. Could you help me out or point me in the right direction.
Regards,
g
racoon?
sorry, not for isakmpd... but I've one for racoon:
http://www.lacave.net/~fred/racoon/config.html
you can try 'openvpn'
you can try 'openvpn' if ipsec setup is too complicated or impossible (nat).
To be fair, IPSec does have
To be fair, IPSec does have NAT traversal when used with UDP encapsulation.
roaming salesperson vpn gateway with isakmpd (its easy, really!)
Assuming you're using FQDN and RSA preshared keys, here is the entirety of my IPsec vpn gateway's isakmpd.conf:
And my isakmpd.policy:
Yes, I need to figure out how to populate this properly for ipsec.conf, but with the above as the vpn gateway, a client can do something as simple as:
... or an even more fun example (for me), lets get our IPv6 fix over IPsec since a lot of friends networks do not have IPv6 yet:
Finally, for completeness, lets say you have setup a few IPv6 networks around, and want to use the native IPv6 to build a tunnel to do `private' v4 between two systems. Why? Because some applications/protocols *cough*nfs*cough*amanda*cough*afs*cough* do not support IPv6 yet...
Please note, in all cases, you must add the local `internal' IP of the tunnel to some network interface. In the IPv4 case, you must also add a route to the internal IP to get the source IP to be correct. In the IPv6 case, you must add a v6 default route or packets will not flow. This is because the routing table is first consulted to see if packets can get anywhere, and then the IPsec stack nabs the packet on its way out and encapsulates, encrypts, and finally transmits the encrypted packet.
Realize, also, I only added IPv6 capabilities recently which means to use ipsecctl and IPv6 you'll need to run -current.
Happy VPN'ing!
Thank You!
Thank you everyone for your help. I've got the VPN working now and I had to use Passive-connections instead of Connections in the VPN gateway's isakmpd.conf file. This helpful advice was provided by Hans-Joerg Hoexer in the OpenBSD misc mailing list.
Once again, thank you!
g
TheCloud, Could you please
TheCloud,
Could you please post an example of your working ipsec.conf configuration? I am looking for an example config for dynamic ipsec connections with 3DES and pre share key. The windows clients will be using GreenBow vpn client. Thanks for any assistance!
iamatt
UPDATE- greenbow roadwarrior to openbsd using ipsec.conf and PSK
Messed with this using greenbow and have a working config in case anyone cares.
This is a simple setup which uses pre-share key with a road warrior
using the GreenBow vpn client.
IPSEC.CONF
# ls -la /etc/ipsec.conf
-rw------- 1 root wheel 141 Aug 26 02:45 /etc/ipsec.conf
# cat /etc/ipsec.conf
ike passive esp tunnel from any to any \
main auth hmac-sha enc 3des group grp2 \
psk 1234
ISAKMPD.POLICY
# ls -la /etc/isakmpd/isakmpd.policy
-rw------- 1 root wheel 272 Aug 29 23:58 /etc/isakmpd/isakmpd.policy
# cat /etc/isakmpd/isakmpd.policy
KeyNote-Version: 2
Authorizer: "POLICY"
Licensees: "passphrase:1234"
conditions: app_domain == "IPsec policy" && doi == "ipsec" &&
esp_present == "yes" && ah_present == "no" &&
(esp_enc_alg == "3des" || esp_enc_alg == "aes") -> "true";
GREENBOW CONFIG EXPORT (*.TGB FILE)
(You will have to edit the address isakmpd.example.com to reflect the
gateway/domain/ip address of the openbsd running isakmpd)
8<-------------------------------------------------------
# Do not edit this file. It is overwritten by VpnConf.
# SIGNATURE MD5 = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Creation Date : 2007-08-29 at 22:53:04
# Written by VpnConf 2.51
#
[General]
Shared-SADB = Defined
Retransmits = 5
Exchange-max-time = 80
Default-phase-1-lifetime = 1800,360:28800
Bitblocking = 0
Xauth-interval = 20
[Default-phase-2-lifetime]
LIFE_TYPE = SECONDS
LIFE_DURATION = 1200,300:28800
# ==================== PHASES 1 ====================
[Phase 1]
isakmpd.example.com = CnxVpn1-P1
[CnxVpn1-main-mode]
DOI = IPSEC
EXCHANGE_TYPE = ID_PROT
Transforms = 3DES-SHA-GRP2
[CnxVpn1-P1]
Phase = 1
Local-address = *
Address = isakmpd.example.com
Transport = udp
Configuration = CnxVpn1-main-mode
Authentication = 1234
# ==================== PHASES 2 ====================
[Phase 2]
Passive-connections = CnxVpn1-CnxVpn1-P2
[CnxVpn1-CnxVpn1-P2]
Phase = 2
ISAKMP-peer = CnxVpn1-P1
Local-ID = CnxVpn1-local-addr
Remote-ID = CnxVpn1-remote-addr
Configuration = CnxVpn1-quick-mode
AutoStart = 0
USBStart = 0
# ==================== Ipsec ID ====================
[CnxVpn1-local-addr]
ID-type = IPV4_ADDR
Address = 192.168.1.30
[CnxVpn1-remote-addr]
ID-type = IPV4_ADDR
Address = 192.168.3.13
# ==================== TRANSFORMS ====================
[CnxVpn1-quick-mode]
DOI = IPSEC
EXCHANGE_TYPE = QUICK_MODE
Suites = CnxVpn1-quick-mode-suite
[CnxVpn1-quick-mode-suite]
Protocols = TGBQM-ESP-AES128-SHA-TUN
[TGBQM-ESP-AES128-SHA-TUN]
PROTOCOL_ID = IPSEC_ESP
Transforms = TGBQM-ESP-AES128-SHA-TUN-XF
[TGBQM-ESP-AES128-SHA-TUN-XF]
TRANSFORM_ID = AES
KEY_LENGTH = 128,128:256
AUTHENTICATION_ALGORITHM = HMAC_SHA
ENCAPSULATION_MODE = TUNNEL
Life = Default-phase-2-lifetime
8<-------------------------------------------------------
save as foo.tgb and import into Greenbow.
Start isakmpd on OpenBSD
#isakmpd -4v
Load ipsec.conf rules
#ipsecctl -F -f /etc/ipsec.conf
"Open tunnel" on the Greenbow client.
Checking #ipsecctl -sa
# ipsecctl -sa
FLOWS:
flow esp in from 192.168.1.30 to 192.168.3.13 peer 192.168.1.30 srcid
isakmpd.example.com/32 dstid 192.168.1.30/32 type use
flow esp out from 192.168.3.13 to 192.168.1.30 peer 192.168.1.30 srcid
isakmpd.example.com/32 dstid 192.168.1.30/32 type require
SAD:
esp tunnel from 192.168.1.30 to isakmpd.example.com spi 0x0a006089
auth hmac-sha1 enc aes
esp tunnel from isakmpd.example.com to 192.168.1.30 spi 0xccd342c4
auth hmac-sha1 enc aes
--
Matt Bettinger