---
title: GeoSite&GeoIP-VPP Case
slug: routing/geositeandgeoip-vpp-case
createdAt: 2025-12-30T06:06:30.213Z
---

# <font color="#1d50a2">**Introduction**</font>

This guide provides a step-by-step tutorial for configuring **Application-Aware Routing** and **Security Compliance** policies using the GeoSite/GeoIP capabilities of the Asterfusion ET2500 Open Intelligent Gateway running AsterNOS-VPP.

## <font color="#1d50a2">**What This Guide Will Accomplish**</font>

By following this guide, you will upgrade a basic routed network into an intelligent, application-aware gateway. Unlike traditional Layer 3 routing based solely on IP addresses, this guide demonstrates how to route and filter traffic based on **Domain Names (GeoSite)** and **Geographic Location (GeoIP)**.

The scenarios covered are:

- **Smart Traffic Steering (App-Aware Routing):** Configuring the gateway to intelligently identify "Office/SaaS" traffic (e.g., Google) and route it through a dedicated **Premium Line**, while keeping general traffic on the standard **ISP Line**.
- **Security Compliance (GeoIP & Filtering):** Implementing security policies to block employee access to "Gaming/Gambling" categories and restricting internal server access to domestic IP addresses only.

***

# <font color="#1d50a2">**Phase 1\: Preparation and Environmental Overview**</font>

## <font color="#1d50a2">**Network Topology Plan**</font>

We will utilize the following interfaces to simulate a dual-uplink enterprise environment based on your current lab setup. We use a secondary laptop to simulate the "Premium" gateway for verification purposes.

- **Ethernet 1 (WAN 1 - ISP):** The standard internet connection (connected to upstream switch).
- **Ethernet 2 (WAN 2 - Premium):** A simulated low-latency line. We will connect a **Laptop** here to act as the traffic destination/analyzer.
- **Ethernet 3 (LAN):** The internal user network.

![](https://api.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/E5JJybfWvxjG4qJM-tp42-20251230-061437.png)

## <font color="#1d50a2">**Target Configuration Plan**</font>

The following table outlines the IP addressing scheme we will implement:

| **Device / Interface** | **IP Address / Subnet** | **Gateway**    | **Role**                                                       |
| ---------------------- | ----------------------- | -------------- | -------------------------------------------------------------- |
| **AsterNOS (Eth1)**    | 192.168.200.166/24      | 192.168.200.1  | **WAN - ISP Line**<br />(Default Internet Access)              |
| **AsterNOS (Eth2)**    | 10.200.200.1/24         | 10.200.200.2\* | **WAN - Premium Line**<br />(Simulated Path for Baidu traffic) |
| **AsterNOS (Eth3)**    | 172.16.10.1/24          | N/A            | **LAN Gateway**<br />(Internal User Gateway)                   |
| **Laptop (Eth2)**      | 10.200.200.2/24         | N/A            | **Traffic Analyzer**<br />(Simulates Premium GW)               |
| **Internal PC**        | 172.16.10.100/24        | 172.16.10.1    | **Internal User**                                              |

:::hint{type="info"}
**Note:**&#x20;&#xA;*&#x20;For the **Laptop** connected to Ethernet 2, you must manually set its static IP to 10.200.200.2. It will capture the traffic steered by the PBR policy.*
:::

## <font color="#1d50a2">**Required Tools**</font>

- **Wireshark:** Installed on the Laptop (Eth2) to verify traffic steering.
- **Ping / Browser:** On the Internal PC to generate traffic.

***

# <font color="#1d50a2">**Phase 2\: Building the Basic Network**</font>

In this phase, we establish the physical connectivity and basic NAT services. We will configure **Ethernet 1** as the ISP link and **Ethernet 2** as the Premium link. Both interfaces will have NAT enabled to ensure internal users can communicate correctly with external networks (or our simulated probe).

## <font color="#1d50a2">**Configuration Steps**</font>

### <font color="#1d50a2">**Step 1\: Configure LAN Interface (Ethernet 3)**</font>

Configure the interface connecting to your internal test PC.

:::BlockQuote
sonic# configure terminal
 <font color="#5fd74e"># Configure LAN Gateway</font>
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 172.16.10.1/24
sonic(config-if-3)# no shutdown
sonic(config-if-3)# exit
:::

### <font color="#1d50a2">**Step 2\: Configure WAN Interfaces (ISP &amp; Premium)**</font>

We configure both WAN interfaces with their respective subnets and enable **NAT Zone 1** on both to support outbound address translation.

:::BlockQuote
<font color="#5fd74e"># Configure WAN 1 (ISP Line)</font>
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 192.168.200.166/24
sonic(config-if-1)# nat-zone 1
sonic(config-if-1)# no shutdown
sonic(config-if-1)# exit
 <font color="#5fd74e"># Configure WAN 2 (Premium Line / Simulation)
# Connect your Laptop here (Static IP\: 10.200.200.2)</font>
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 10.200.200.1/24
sonic(config-if-2)# nat-zone 1
sonic(config-if-2)# no shutdown
sonic(config-if-2)# exit
:::

### <font color="#1d50a2">**Step 3\: Configure Routing and NAT Rules**</font>

We set the default route to the ISP and define NAT pools for **both** uplinks. This ensures that whichever path traffic takes (steered by PBR or Default), it gets a valid source IP.

:::BlockQuote
<font color="#5fd74e"># 1. Default Route (Traffic defaults to ISP)</font>
sonic(config)# ip route 0.0.0.0/0 192.168.200.1
 <font color="#5fd74e"># 2. Enable Global NAT</font>
sonic(config)# nat enable
 <font color="#5fd74e"># 3. Define NAT Pools</font> <font color="#5fd74e"># Pool for ISP Line (matches Eth1 IP)</font>
sonic(config)# nat pool ISP\_POOL 192.168.200.166 <font color="#5fd74e"># Pool for Premium Line (matches Eth2 IP)</font>
sonic(config)# nat pool PREMIUM\_POOL 10.200.200.1
 <font color="#5fd74e"># 4. Bind NAT Pools to the Rule
# Bind for ISP path</font>
sonic(config)# nat binding SNAT\_ISP ISP\_POOL <font color="#5fd74e"># Bind for Premium path (Traffic steered here will use this pool)</font>
sonic(config)# nat binding SNAT\_PREMIUM PREMIUM\_POOL
:::

***

# <font color="#1d50a2">**Phase 3\: Smart Traffic Steering (PBR)**</font>

We will now configure Policy Based Routing (PBR) to intelligently hijack **Baidu** traffic and force it through the **Premium Line** (Ethernet 2).

## <font color="#1d50a2">**Configuration Steps**</font>

### <font color="#1d50a2">**Step 1\: Configure PBR for Smart Steering**</font>

We define the policy map.

:::hint{type="info"}
**Note:**&#x20;
*We include `match src-ip 0.0.0.0/0` to satisfy the flow key requirement, combined with `geosite BAIDU` for application identification.*
:::

:::BlockQuote
sonic# configure terminal
 <font color="#5fd74e"># Create PBR Map matching Baidu</font>
sonic(config)# pbr-map SMART\_STEER seq 10
 <font color="#5fd74e"># Base Match\: All Source IPs (Required for flow key)</font>
sonic(config-pbr-map)# match src-ip 0.0.0.0/0
 <font color="#5fd74e"># Application Match\: Specific Domain Category</font>
sonic(config-pbr-map)# geosite BAIDU
 <font color="#5fd74e"># Action\: Force Next-Hop to Premium Gateway (Laptop)</font>
sonic(config-pbr-map)# set nexthop 10.200.200.2
sonic(config-pbr-map)# exit
:::

### <font color="#1d50a2">**Step 2\: Apply Policy to LAN Interface**</font>

Bind the PBR policy to the interface where traffic enters the gateway (**Ethernet 3**).

:::BlockQuote
sonic(config)# interface ethernet 3
sonic(config-if-3)# pbr-policy SMART\_STEER
sonic(config-if-3)# exit
 <font color="#5fd74e"># Save Configuration</font>
sonic(config)# exit
sonic# write
:::

![](https://api.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/9xzyLDTZ3Vgnktp2qfvRu-20251230-064511.png)

***

# <font color="#1d50a2">**Phase 4\: Security Compliance (ACL + GeoIP)**</font>

In this phase, we will shift focus from routing to security. We will deploy an Access Control List (ACL) to block access to specific content categories and restrict traffic based on geographic location.

## <font color="#1d50a2">**Prerequisites\: Clean Up PBR Policy**</font>

Before applying the new security policies, we must remove the PBR policy configured in Phase 3 to ensure a clean testing environment and avoid policy conflicts.

:::BlockQuote
sonic(config)# interface ethernet 3 <font color="#5fd74e"># Remove the PBR policy from the LAN interface</font>
sonic(config-if-3)# no pbr-policy SMART\_STEER
sonic(config-if-3)# exit
:::

## <font color="#1d50a2">**Configuration Steps**</font>

### <font color="#1d50a2">**Step 1\: Create Security ACL**</font>

We define an ACL named `SECURE_ACL` applied in the inbound direction.

- **Rule 10:** Blocks all websites classified as "Media" (e.g., BBC, CNN).
- **Rule20:** Blocks all IP addresses located in China (CN).
- Default Behavior: Traffic not matching these rules will be permitted by default.

:::BlockQuote
<font color="#5fd74e"># Create the IPv4 Layer 3 ACL</font>
sonic(config)# access-list L3 SECURE\_ACL ingress
 <font color="#5fd74e"># Rule 10\: Block Media Applications (e.g., CNN)
# We use the GeoSite category 'CATEGORY-MEDIA'</font>
sonic(config-l3-acl-SECURE\_ACL)# rule 10 geosite CATEGORY-MEDIA packet-action deny
 <font color="#5fd74e"># Rule 20\: Deny Domestic Traffic (GeoIP\: China)
# We use the GeoIP code 'CN'</font>
sonic(config-l3-acl-SECURE\_ACL)# rule 20 geoip CN packet-action deny
sonic(config-l3-acl-SECURE\_ACL)# exit
:::

### <font color="#1d50a2">**Step 2\: Apply ACL to LAN Interface**</font>

We apply this security policy to the LAN interface. Crucially, we also update the NAT binding. We will replace the global NAT binding with an ACL-based NAT binding. This ensures that only traffic permitted by SECURE\_ACL is translated and allowed to access the Internet.

:::BlockQuote
sonic(config)# interface ethernet 3
sonic(config-if-3)# acl SECURE\_ACL
sonic(config-if-3)# exit

sonic(config)# no nat binding SNAT\_ISP
sonic(config)# nat binding SECURE\_BIND ISP\_POOL SECURE\_ACL
:::

### <font color="#1d50a2">**Step 3\: Save Configuration**</font>

:::BlockQuote
sonic(config)# exit
sonic# write
:::

## <font color="#1d50a2">Verification (Phase 4)</font>

**1. Verify Media Block**

- **Action:** On the Internal PC, try to access an international media site (e.g., `www.cnn.com`).
- **Result:** The connection should fail/timeout.
- **CLI Validation:** Check the counters to see Rule 10 incrementing.

:::BlockQuote
sonic# show counters acl
:::

**2. Verify GeoIP Permit**

- **Action:** Access a China website (e.g., `www.baidu.com`).
- **Result:** The connection should fail/timeout (matches Rule 20 Deny).

**3. Verify Normal Access**

- **Action:** Try to access a non-media, non-CN site (e.g., a US-based technical site like [`www.gnu.org`](http://www.gnu.org) or `stackoverflow.com`).
- **Result:** Access successful. The traffic does not match Rule 10 or 20, so it is permitted and successfully NATed.

# <font color="#1d50a2">**Conclusion**</font>

You have successfully transformed the AsterNOS gateway into an intelligent, application-aware edge device.

- **Routing:** Traffic is steered based on Application Identity (Google -> Premium Line) using PBR.
- **Security:** Traffic is filtered based on Content Category (Games) and Geography (CN) using ACLs.
