The following is a typical gateway-to-gateway VPN that uses a preshared secret for authentication.
10.5.6.0/24 172.23.9.0/24
| |
--| |--
| +-----------+ /-^-^-^-^--\ +-----------+ |
|-----| Gateway A |=====| Internet |=====| Gateway B |-----|
| AL+-----------+AW \--v-v-v-v-/ BW+-----------+BL |
--| 10.5.6.1 14.15.16.17 22.23.24.25 172.23.9.1 |--
| |
Gateway A connects the internal LAN 10.5.6.0/24 to the Internet. Gateway A's LAN interface has the address 10.5.6.1, and its WAN (Internet) interface has the address 14.15.16.17.
Gateway B connects the internal LAN 172.23.9.0/24 to the Internet. Gateway B's WAN (Internet) interface has the address 22.23.24.25. Gateway B's LAN interface address, 172.23.9.1, can be used for testing IPsec but is not needed for configuring Gateway A.
The IKE Phase 1 parameters used in Scenario 1 are:
The IKE Phase 2 parameters used in Scenario 1 are:
To set up Gateway A for this scenario, use the following steps:
# To Add policy, use: TestIOCTL /add t1.conf # To display SA information, use: TestIOCTL /dump # To display SPD, use: TestIOCTL /dump spd # To flush/delete SPD, use: TestIOCTL /flush spd # To flush/delete SA, use: TestIOCTL /flush
{ laddr 10.5.6.0/24 raddr 172.23.9.0/24 } ipsec { encr_algs 3des encr_auth_algs sha1 tladdr 14.15.16.17 traddr 22.23.24.25 }
For help, run "ike ?"
ike <option>* <ipaddr>*
option:
-m [mode] sets or shows phase 1 exchange mode
-p <ascii> sets pre-shared key
-v <num> sets or shows IKE version
-l <secs> sets IKE_SA lifetime seconds
-L <secs> sets IPsec SA lifetime seconds
-a [eap] sets EAP authenticator protocol
-s [eap] sets EAP supplicant protocol
-h displays this help
-o <file> sets debug console output
-w <secs> sets socket wait time (in seconds)
mode: { main | aggressive | m | a | M | A }
eap : { aka | leap | md5 | mschapv2 | psk | radius | sim | srp | tls }
2001:2::0/64 2001:3::0/64
| |
--| |--
| +-----------+ /-^-^-^-^--\ +-----------+ |
|-----| Gateway A |=====| Internet |=====| Gateway B |-----|
| AL+-----------+AW \--v-v-v-v-/ BW+-----------+BL |
--| 2001:2::1 2001:1::17 2001:1::25 2001:3::1 |--
| |
C:\> ipv6 install
C:\> netsh interface ipv6 add address "Local Area Connection" 2001:1::17 C:\> netsh interface ipv6 add address "Local Area Connection 2" 2001:2::1
C:\> netsh interface ipv6 set interface "Local Area Connection" forwarding=enabled advertise=enabled C:\> netsh interface ipv6 set interface "Local Area Connection 2" forwarding=enabled advertise=enabled
C:\> netsh interface ipv6 add route 2001:1::/64 "Local Area Connection" publish=yes C:\> netsh interface ipv6 add route 2001:2::/64 "Local Area Connection 2" publish=yes C:\> netsh interface ipv6 add route 2001:3::/64 "Local Area Connection" nexthop=2001:1::25 publish=yes
i.e. ping6 2001:1::25 or if using local address, use %<dest scopeid> i.e. ping6 fe80::213:72ff:fec9:6a25%4Note: If ping6 doesn't work, you might have to reboot the machine to make sure the global address is in effect.
ike.exe 2001:1::17 or if you are using Local address, be sure to add the dest scope id: i.e. ike.exe fe80::213:72ff:fec9:8917%4
i.e. { laddr 2001:2::0/112 raddr 2001:3::0/112 } ipsec { encr_algs 3des encr_auth_algs sha1 tladdr 2001:1::17 traddr 2001:1::25}
TestIOCTL.exe /add t1.conf
mknod /dev/moc_memdrv c 250 0 mknod /dev/moc_ipsec c 103 1
/sbin/ifconfig eth1 <2nd interface ipaddr> netmask 255.255.255.0 /sbin/route del default gw gateway1 /sbin/route add -net <dest internal network> netmask 255.255.255.0 gw <dest gw ipaddr>
echo "1" > /proc/sys/net/ipv4/ip_forward
/sbin/insmod moc_memdrv.ko /sbin/insmod moc_ipsec.ko
./ike <local gw address> &Note: For ikev2, use ./ike -v 2 <local gw address> &
./loadConfig -f <policy.conf>
/sbin/ifconfig eth1 10.5.6.1 netmask 255.255.255.0 /sbin/route del default gw gateway1 /sbin/route add -net 172.23.9.0 netmask 255.255.255.0 gw 22.23.24.25 echo "1" > /proc/sys/net/ipv4/ip_forward /sbin/insmod moc_memdrv.ko /sbin/insmod moc_ipsec.ko sleep 3 ./ike 14.15.16.17 & ./loadConfig -f policyA.conf
/sbin/ifconfig eth1 172.23.9.1 netmask 255.255.255.0 /sbin/route del default gw gateway1 /sbin/route add -net 10.5.6.0 netmask 255.255.255.0 gw 14.15.16.17 echo "1" > /proc/sys/net/ipv4/ip_forward /sbin/insmod moc_memdrv.ko /sbin/insmod moc_ipsec.ko sleep 3 ./ike 22.23.24.25 & ./loadConfig -f policyB.conf
2001:2::0/64 2001:3::0/64
| |
--| |--
| +-----------+ /-^-^-^-^--\ +-----------+ |
|-----| Gateway A |=====| Internet |=====| Gateway B |-----|
| AL+-----------+AW \--v-v-v-v-/ BW+-----------+BL |
--| 2001:2::1 2001:1::17 2001:1::25 2001:3::1 |--
| |
ls /proc/net/if_inet6 or /sbin/ifconfig and it should return inet6 information i.e. inet6 addr: fe80::213:72ff:fec9:8917/64 Scope:Link
/sbin/ip addr add 2001:1::17/64 dev eth0 /sbin/ip addr add 2001:2::1/64 dev eth1
/sbin/ip -6 route add 2001:3::/64 via 2001:1::25
i.e. ping6 2001:1::25 or if you are using link local address, use i.e. ping6 fe80::213:72ff:fec9:6a25
./ike 2001:1::17 & or if you are using Local address, be sure to add the dest scope id: i.e. ike.exe fe80::213:72ff:fec9:8917%4
i.e. { laddr 2001:2::0/112 raddr 2001:3::0/112 } ipsec { encr_algs 3des encr_auth_algs sha1 tladdr 2001:1::17 traddr 2001:1::25}
./loadConfig -f t1.conf
Policy format
=============
{laddr <local IP address> raddr <dest IP address> ulp [icmp|tcp|udp|any] } ipsec { encr_algs [3des|aes|blowfish|any]
encr_auth_algs [sha1|md5|any] tladdr <tunnel local address> traddr <tunnel dest address> }
Explanation:
laddr : local IP address
raddr : remote IP address
ulp : upper layer protocol
ipsec : both direction or use permit/apply for unidirection
encr_algs : encryption
encr_auth_algs : authentication
tladdr : local gateway IP address
traddr : remote gateway IP address
policyA.conf
=============
{laddr 10.5.6.0/24 raddr 172.23.9.0/24 } ipsec { encr_algs 3des encr_auth_algs sha1 tladdr 14.15.16.17 traddr 22.23.24.25 }
policyB.conf
=============
{laddr 172.23.9.0/24 raddr 10.5.6.0/24 } ipsec { encr_algs 3des encr_auth_algs sha1 tladdr 22.23.24.25 traddr 14.15.16.17 }
loadConfig -f <policy.conf> to load IPsec policy. It also flush the SA and SPD before loading the new policy.
-F flush SA
-FP flush SPD
-d display key
-dP display policy
In Linux, loadConfig output to /var/log/message. Run tail -f /var/log/message to see output from loadConfig -d