> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aviatrix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Aviatrix Gateway to Cisco Ios Router

> This document describes how to build an IPsec tunnel based Site2Cloud connection between an Aviatrix Gateway and a Cisco IOS router.

This document describes how to build an IPsec tunnel based Site2Cloud connection
between an Aviatrix Gateway and a Cisco IOS router.

The network setup is as follows:

**VPC/VNet-AVX (with Aviatrix Gateway)**

*VPC/VNet CIDR: 10.100.0.0/24*

**On-Prem (with Cisco IOS Router)**

*On-Prem Network CIDR: 10.10.2.0/24*

<a id="creating-s2c-connection" />

## Creating a Site2Cloud Connection

1. In Aviatrix CoPilot, launch an
   <a href={"/docs/enterprise/" + "10.1" + "/reference/ui/cloud-fabric/gateways#view-transit-gateways"}>Aviatrix Transit Gateway</a>
   at the subnet (public subnet for AWS, GCP, or OCI) of VPC/VNet-AVX. Collect
   the Gateway's public IP addresses (52.4.65.172 in this example).

2. Navigate to Networking > Connectivity > External Connections (S2C) to create
   a Site2Cloud connection using the values for one of the below options:

   | Static Route-Based                                                                                                                              | Static Policy-Based                                                                                                                               |
   | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
   | [Static Route-Based](https://legacy.docs.aviatrix.com/documentation/latest/network/external-connection-create-static-route-based-unmapped.html) | [Static Policy-Based](https://legacy.docs.aviatrix.com/documentation/latest/network/external-connection-create-static-policy-based-unmapped.html) |

   Substitute the following values:

   * Remote Device Type: Generic
   * Algorithms: turn Off
   * Remote Device IP: Public IP of IOS Router WAN port (52.9.196.2 in this
     example)
   * Remote Subnet CIDR(s): 10.10.2.0/24 (On-Prem Network CIDR) (VPC2 private
     subnet)
   * Local Subnet CIDR(s): 10.100.0.0/24 (VPC/VNet-AVX CIDR) (VPC1 private
     subnet)

3. After the connection is created, select the vertical ellipsis <img src={"/docs/enterprise/" + "10.1" +
   "/guides/connectivity/vpn/images/threedot.png"} alt="25" style={{display: 'inline', verticalAlign: 'middle', height: '1em'}} /> menu
   for that connection and select **Download Configuration**.

4. In the Download Configuration dialog, select **Cisco** from the **Vendor**
   dropdown menu.

5. Select **ISR, ASR, or CSR** from the Platform dropdown menu.

6. Select the appropriate Software version.

7. Click **Download**.

8. Save the configuration file as a reference for configuring your Cisco IOS
   router.

   The following is a sample configuration based on the Site2Cloud configuration
   above.

   <img src="https://mintcdn.com/aviatrix-14b37c43/Gre8pdluiL7JmlpL/images/guides/connectivity/vpn/s2c-sample-config.png?fit=max&auto=format&n=Gre8pdluiL7JmlpL&q=85&s=fa42ff57d49bae07b6a627e58d2376aa" alt="s2c sample config" width="1280" height="720" data-path="images/guides/connectivity/vpn/s2c-sample-config.png" />

## Configuring Cisco IOS Router

1. Either ssh into the Cisco router or connect to it directly through its
   console port.
2. Apply the following IOS configuration to your router.

<Note>
  From version 5.0, we use the gateway's public IP address as the identifier, so
  the "match identity address" should use the public IP instead of the private
  IP as shown below.
</Note>

<img src="https://mintcdn.com/aviatrix-14b37c43/Gre8pdluiL7JmlpL/images/guides/connectivity/vpn/s2c-ios.png?fit=max&auto=format&n=Gre8pdluiL7JmlpL&q=85&s=5b1b79f39e434578eb51ac66f5ed2d1d" alt="image1" width="1280" height="720" data-path="images/guides/connectivity/vpn/s2c-ios.png" />

## Verifying the Connection Status

In CoPilot, go to the Diagnostics > Cloud Routes > External Connections tab to
confirm the Status and Tunnel Status of the external connection.

## Troubleshooting

You can use the Diagnostic Tools (under Diagnostics in the left navigation menu)
to troubleshoot any connection issues.

For support, please open a support ticket at
[Aviatrix Support Portal](https://support.aviatrix.com).

## Appendix 1: Transit Connection to Cisco ISR/ASR Over the Internet

The following is the topology used for the sample configuration below:

<img src="https://mintcdn.com/aviatrix-14b37c43/1zOMu4WXCFpEtXhJ/images/guides/connectivity/vpn/external-device-internet.png?fit=max&auto=format&n=1zOMu4WXCFpEtXhJ&q=85&s=cc25da31a725b586938eb4d1ffb005e1" alt="External-Device-Internet" width="517" height="623" data-path="images/guides/connectivity/vpn/external-device-internet.png" />

For connection over the Internet, an Aviatrix Transit Gateway and Cisco ISR/ASR
use each other's public IP to create an IPsec tunnel and establish a BGP
connection.

The following diagrams display mappings between a sample downloaded
configuration and its corresponding Cisco ISR/ASR router configuration:

<img src="https://mintcdn.com/aviatrix-14b37c43/Gre8pdluiL7JmlpL/images/guides/connectivity/vpn/transitgw-phase1.png?fit=max&auto=format&n=Gre8pdluiL7JmlpL&q=85&s=c8c7205765e8573610bfb334b2482533" alt="500" width="1280" height="654" data-path="images/guides/connectivity/vpn/transitgw-phase1.png" />

<img src="https://mintcdn.com/aviatrix-14b37c43/Gre8pdluiL7JmlpL/images/guides/connectivity/vpn/transitgw-phase2.png?fit=max&auto=format&n=Gre8pdluiL7JmlpL&q=85&s=eba30f0250eb07b16a4952994bb73dee" alt="500" width="1280" height="665" data-path="images/guides/connectivity/vpn/transitgw-phase2.png" />

<img src="https://mintcdn.com/aviatrix-14b37c43/Gre8pdluiL7JmlpL/images/guides/connectivity/vpn/transitgw-tunnel.png?fit=max&auto=format&n=Gre8pdluiL7JmlpL&q=85&s=91a0e9f97febb67a83f4b58439d6fd97" alt="500" width="1280" height="671" data-path="images/guides/connectivity/vpn/transitgw-tunnel.png" />

<img src="https://mintcdn.com/aviatrix-14b37c43/Gre8pdluiL7JmlpL/images/guides/connectivity/vpn/transitgw-bgp.png?fit=max&auto=format&n=Gre8pdluiL7JmlpL&q=85&s=e2be856a671ec1d0af6aeddfa939c481" alt="500" width="1280" height="668" data-path="images/guides/connectivity/vpn/transitgw-bgp.png" />

## Appendix 2: Transit Connection to Cisco ISR/ASR over Direct Connect

The following is the topology used for the sample configuration below:

<img src="https://mintcdn.com/aviatrix-14b37c43/1zOMu4WXCFpEtXhJ/images/guides/connectivity/vpn/external-device-dx.png?fit=max&auto=format&n=1zOMu4WXCFpEtXhJ&q=85&s=973fb902b33414e662b263a5b208fa09" alt="500" width="665" height="617" data-path="images/guides/connectivity/vpn/external-device-dx.png" />

For connection over Direct Connect, the Aviatrix Transit Gateway and Cisco
ISR/ASR use each other's private IP to create an IPsec tunnel and establish BGP
connection.

<Note>
  The ASN number of the Aviatrix Transit Gateway created earlier in this
  document (Local ASN) should be the same as the VGW's ASN number (7224 in this
  example). Without it, the Transit VPC/VNet CIDR advertised from VGW to on-prem
  ASR/ISR will be advertised by ASR/ISR back to the Aviatrix Transit Gateway.
  With the same ASN number, the Aviatrix Transit Gateway will drop the route to
  the Transit VPC/VNet CIDR.
</Note>

The following diagrams display mappings between a sample configuration from
[Creating a Site2Cloud Connection](#creating-a-site2cloud-connection) and its
corresponding Cisco ISR/ASR router configuration:

<img src="https://mintcdn.com/aviatrix-14b37c43/Gre8pdluiL7JmlpL/images/guides/connectivity/vpn/transitgw-phase1-dx.png?fit=max&auto=format&n=Gre8pdluiL7JmlpL&q=85&s=6af56ea23d52f21807944893536edfd0" alt="500" width="1147" height="639" data-path="images/guides/connectivity/vpn/transitgw-phase1-dx.png" />

<img src="https://mintcdn.com/aviatrix-14b37c43/Gre8pdluiL7JmlpL/images/guides/connectivity/vpn/transitgw-phase2-dx.png?fit=max&auto=format&n=Gre8pdluiL7JmlpL&q=85&s=b3f8c59a08e73d37155364be7160b01d" alt="500" width="1167" height="650" data-path="images/guides/connectivity/vpn/transitgw-phase2-dx.png" />

<img src="https://mintcdn.com/aviatrix-14b37c43/Gre8pdluiL7JmlpL/images/guides/connectivity/vpn/transitgw-tunnel-dx.png?fit=max&auto=format&n=Gre8pdluiL7JmlpL&q=85&s=96ef17f0b2052734e6696ef8b0104c02" alt="500" width="1156" height="647" data-path="images/guides/connectivity/vpn/transitgw-tunnel-dx.png" />

<img src="https://mintcdn.com/aviatrix-14b37c43/Gre8pdluiL7JmlpL/images/guides/connectivity/vpn/transitgw-bgp-dx.png?fit=max&auto=format&n=Gre8pdluiL7JmlpL&q=85&s=8d8c7d35dc4c983854a1d0f5bac683df" alt="500" width="1162" height="658" data-path="images/guides/connectivity/vpn/transitgw-bgp-dx.png" />

## Related Topics

* <a href={"/docs/enterprise/" + "10.1" + "/concepts-architectures/architecture/connectivity/transit-externaldevice-usecase"}>Overview of Transit Gateway to External Devices</a>
* [Externaldevice Settings](https://legacy.docs.aviatrix.com/documentation/latest/network/externaldevice-settings.html)
