Amazon VPC |
|
Introduction
Amazon Virtual Private Cloud is a secure and seamless bridge between a company’s existing IT infrastructure and the AWS cloud. Amazon VPC enables enterprises to connect their existing infrastructure to a set of isolated AWS compute resources via a Virtual Private Network (VPN) connection, and to extend their existing management capabilities such as security services, firewalls, and intrusion detection systems to include their AWS resources. For more information please read here. Okapi supports creation of VPN tunnels to Amazon VPC gateway using IPSec and route forwarding using BGP. Following is a diagram showing an example where we require to establish an IPSec tunnel between an customer gateway running Okapi and the Amazon VPC server. The example has been taken from here. In the following, we assume that the reader is familiar with here.
Following is the corresponding example of the configuration information you should get from your integration team. It contains a set of information for each of the two tunnels you must configure. The example configuration refers to two items that you must provide:
The example configuration includes several dummy values we're using to help you understand how configuration works. For example, we're using dummy values for the VPN connection ID (44a8938f), VPN gateway ID (8db04f81), etc.; the IP addresses (e.g., 72.21.209.*, 169.254.255.*, etc.); and the remote ASN (7224). The actual configuration information you get will have real values in place of those dummy values.
AWS utilizes unique identifiers to manipulate the configuration of
Configuration Okapi Router can be used to connect to Amazon Virtual Private Cloud.
Internet Key Exchange (IKE) Configuration A policy is established for the supported ISAKMP encryption, authentication, Diffie-Hellman, lifetime, and key parameters.
Configure the IKE SA as follows for tunnel 1
Okapi(config)# crypto isakmp policy 1 Okapi(config-isakmp)# encryption aes128 Okapi(config-isakmp)# hash sha Okapi(config-isakmp)# authentication pre-share Okapi(config-isakmp)# group 2 Okapi(config-isakmp)# lifetime 28800 Okapi(config-isakmp)# exit
Okapi(config)# crypto isakmp key plain-text-password2 address 72.21.209.193
Okapi(config)# crypto ipsec transform-set ipsec-prop-vpn-8db04f81 esp-aes128 esp-sha-hmac Okapi(cfg-crypt-trans)# mode tunnel
The Customer Gateway and VPN Gateway each have two addresses that relate to this IPSec tunnel. Each contains an outside address, upon which encrypted traffic is exchanged. Each also contain an inside address associated with the tunnel interface. The Customer Gateway outside IP address was provided when the Customer Gateway was created. Changing the IP address requires the creation of a new Customer Gateway. The Customer Gateway inside IP address should be configured on your tunnel interface.
Outside IP Addresses:
Inside IP Addresses
Tunnel 2: Outside IP Addresses:
Inside IP Addresses
Configuring the traffic that is allowed to pass through the tunnel. Here 10.0.0.0/24 is the VPC CIDR block and 10.20.50.0/24 is the subnet in private network. You may configure all the traffic here that you want to encrypt and pass through the tunnel. Okapi(config)# access-list 101 permit all 169.254.255.0 0.0.0.3 169.254.255.0 0.0.0.3 Okapi(config)# access-list 101 permit all 169.254.255.0 0.0.0.3 10.0.0.0 0.0.0.255 Okapi(config)# access-list 101 permit all 10.20.50.0 0.0.0.255 10.0.0.0 0.0.0.255 Okapi(config)# access-list 102 permit all 169.254.255.4 0.0.0.3 169.254.255.4 0.0.0.3 Okapi(config)# access-list 102 permit all 169.254.255.4 0.0.0.3 10.0.0.0 0.0.0.255 Okapi(config)# access-list 102 permit all 10.20.50.0 0.0.0.255 10.0.0.0 0.0.0.255 Configure a crypto map "amazon" with two tunnels. Okapi(config)# crypto map amazon 0 ipsec-isakmp Okapi(config-crypto-map)# match address 101 Okapi(config-crypto-map)# set transform-set ipsec-prop-vpn-44a8938f Okapi(config-crypto-map)# set peer 72.21.209.225 Okapi(config-crypto-map)# exit Okapi(config)# crypto map amazon 1 ipsec-isakmp Okapi(config-crypto-map)# match address 102 Okapi(config-crypto-map)# set transform-set ipsec-prop-vpn-44a8938f Okapi(config-crypto-map)# set peer 72.21.209.193 Okapi(config-crypto-map)# exit Okapi(config)# interface FastEthernet 0 Okapi(config-if-eth)# ip address YOUR_UPLINK_ADDRESS Okapi(config-if-eth)# ip address 169.254.255.2/30 Okapi(config-if-eth)# ip address 169.254.255.6/30 Okapi(config-if-eth)# crypto map amazon Okapi(config-if-eth)# exit BGP The Border Gateway Protocol (BGPv4) is used within the tunnel, between the inside IP addresses, to exchange routes from the VPC to your home network. Each BGP router has an Autonomous System Number (ASN). Your ASN was provided to AWS when the Customer Gateway was created. BGP Configuration Options: Tunnel 1:
Tunnel 2:
Okapi(config)# router bgp YOUR_BGP_ASN Okapi(config-router)# bgp router-id 1.2.3.4 Okapi(config-router)# neighbor 169.254.255.1 remote-as 7224 Okapi(config-router)# neighbor 169.254.255.1 timers 10 30 Okapi(config-router)# neighbor 169.254.255.1 timers connect 10 Okapi(config-router)# neighbor 169.254.255.1 default-originate Okapi(config-router)# neighbor 169.254.255.1 soft-reconfiguration inbound Okapi(config-router)# neighbor 169.254.255.5 remote-as 7224 Okapi(config-router)# neighbor 169.254.255.5 timers 10 30 Okapi(config-router)# neighbor 169.254.255.5 timers connect 10 Okapi(config-router)# neighbor 169.254.255.5 default-originate Okapi(config-router)# neighbor 169.254.255.5 soft-reconfiguration inbound Okapi(config-router)# exit |