This topic describes how to deploy two Smart Access Gateway (SAG) devices in inline mode and enable Open Shortest Path First (OSPF)-based dynamic routing to connect a private network to Alibaba Cloud.
Background information
The following figure shows the topology of the private network. A Layer 3 switch is connected to two Layer 2 switches. Local clients and servers are connected to the Layer 2 switches. Two SAG devices are connected to the Layer 3 switch in inline mode to establish network connections between the private network and Alibaba Cloud. The two SAG devices serve as a standby device for each other.

Prerequisites
- A Virtual Private Cloud (VPC) network is created in the China (Beijing) region. For more information, see Create a VPC.
- A Cloud Enterprise Network (CEN) instance is created and associated with the VPC network in the China (Beijing) region. For more information, see Create a CEN instance.
Subnetting
The following CIDR blocks are used in this example. When you allocate CIDR blocks based on your actual requirements, make sure that the CIDR blocks do not overlap with each other.
Object | IP address |
---|---|
VPC network in the China (Beijing) region | 10.0.0.0/16. |
Internet-facing router | Port G1: 192.168.100.2/30. |
Port G2: 192.168.200.2/30. | |
SAG Device 1 |
|
SAG Device 2 |
|
Layer 3 switch |
|
Private network | 172.16.0.0/12. |
Step 1: Purchase SAG devices
After you purchase SAG devices in the SAG console, Alibaba Cloud delivers the devices to the specified address and creates an SAG instance to help you facilitate network management.
You can check whether the order has been placed on the Smart Access Gateway page. The SAG devices will be shipped within two business days. If the order is not shipped within two business days, submit a ticket to query the shipping status.

Step 2: Activate the SAG devices
After you receive the SAG devices, check whether you have received all the accessories. For more information, see Descriptions of an SAG-1000 device.
Step 3: Connect the SAG devices to your private network
After you activate the SAG devices and associate them with the SAG instance, you must connect the devices to your private network.
Before you begin, make sure that the devices are activated, the 4G networks work as expected, and the devices are connected to Alibaba Cloud. Device 1 is used in this example. Repeat this step to connect Device 2 to your private network.
Step 4: Configure ports
After the SAG devices are connected to your private network, you can configure the device ports in the SAG console.
Device 1 is used in this example. Repeat this step to configure the ports of Device 2.
Step 5: Configure OSPF-based dynamic routing
You can configure OSPF-based dynamic routing for SAG devices in the SAG console.
Device 1 is used in this example. Repeat this step to configure OSPF-based dynamic routing for Device 2.
Step 6: Configure the Layer 3 switch and Internet-facing router
The commands used to configure switches vary depending on the switch provider. For more information, see the manuals issued by your providers. A switch and router provided by Cisco are used in this example.- The Layer 3 switch
- Set the port IP addresses and OSPF parameters.
Note For each SAG device, the network type of ports using the OSPF protocol must be set to peer-to-peer (P2P). Otherwise, the SAG device cannot calculate routes correctly.
interface GigabitEthernet 0/11 no switchport ip ospf network point-to-point Set the network type to P2P ip ospf hello-interval 3 ip ospf dead-interval 10 ip address 192.168.50.2 255.255.255.252 The port IP address of the peer switch of Device 1 interface GigabitEthernet 0/12 no switchport ip address 192.168.60.2 255.255.255.252 The port IP address of the peer switch of Device 2 ip ospf network point-to-point Set the network type to P2P ip ospf dead-interval 10 ip ospf hello-interval 3 !
- Specify the loopback address and route advertisement information.
Note OSPF requires a not-so-stubby area (NSSA), automatically generates a default route, and advertises it to SAG.
interface Loopback 0 ip address 192.168.100.3 255.255.255.255 The loopback address of the switch ! router ospf 1 router-id 192.168.100.3 The router ID of the switch network 172.16.0.0 0.15.255.255 area 0 The CIDR block of the local server network 192.168.50.0 0.0.0.4 area 1 The CIDR block of the switch port connected to Device 1 network 192.168.100.3 0.0.0.0 area 0 The loopback address of the switch network 192.168.60.0 0.0.0.4 area 1 The CIDR block of the switch port connected to Device 2 area 1 nssa default-information-originate no-summary !
- Set the port IP addresses and OSPF parameters.
- The Internet-facing router
Configure static routes ip route 192.168.100.0 255.255.255.252 192.168.100.2 The route to Device 1 ip route 192.168.200.0 255.255.255.252 192.168.200.2 The route to Device 2
Step 7: Set up network connections
After you configure the SAG devices, you must set up network connections to connect the private network to Alibaba Cloud.
- Create a Cloud Connect Network (CCN) instance.
- Set up network connections.
- Associate the CCN instance with a CEN instance.
- Configure a security group.
Step 8: Test the connectivity
After you complete the configurations in the preceding steps, access cloud resources deployed in the VPC network from a client in your private network to test the connectivity.