# write configuration to file(take effect after next boot) cat > /etc/sysconfig/network-scripts/ifcfg-lo:elastic <<EOF DEVICE=lo:elastic # use your elastic ip here, supposed 2.2.2.2 here IPADDR=2.2.2.2 NETMASK=255.255.255.255 ONBOOT=yes NAME=elasticIP EOF
cat > /etc/ipsec.d/ofc.conf <<EOF config setup protostack=netkey conn ofc authby=secret auto=start # Amazon does not route ESP/AH packets, so these must be encapsulated in UDP encapsulation=yes # the following 4 lines must be matched with # configuration at checkpoint in the office ike=aes128-SHA1;modp1024 ikelifetime=24h esp=aes128-SHA1 salifetime=24h left=%defaultroute # set our ID to your (static) elastic IP leftid=2.2.2.2 leftsubnets=10.0.0.0/24,2.2.2.2/32 # remote endpoint IP right=3.3.3.3 rightsubnet=10.0.1.0/24 dpdaction=restart dpddelay=10 dpdtimeout=60 EOF