---
title: GRE Configuration
slug: enterprise-v5p2/gre-configuration
description: gre configuration
createdAt: 2025-11-14T03:58:41.147Z
---

### <font color="#1d50a2">show gre</font>

**\[Command]**
**show gre \[** *gre\_id* **]**

**\[Purpose]**
View the configuration of the GRE tunnel

**\[Parameter]**

| **Parameter** | **Description**        |
| ------------- | ---------------------- |
| *gre\_id*     | The name of GER tunnel |

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show gre
gre tunnel  source ip  src vnet  destination ip  dst vnet  local ips
---------- ----------- -------- -------------- ----------- ------------
Brgre1      30.1.1.2   default   40.1.1.2        default   100.1.1.1/24
```

### <font color="#1d50a2">show counters tunnel</font>

**\[Command]**
**show counters tunnel \[** *name* **]**

**\[Purpose]**
View counters of the GRE tunnel

**\[Parameter]**

| **Parameter** | **Description**        |
| ------------- | ---------------------- |
| *name*        | The name of GER tunnel |

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show counters tunnel
 IFACE  RX_OK  RX_BYTES  RX_PPS  TX_OK  TX_BYTES  TX_PPS
------- ------- ------- -------- ------- -------- --------
 Brgre1   474    N/A     1.00/s   239    N/A      0.00/s
```

### <font color="#1d50a2">gre name</font>

**\[Command]**
**gre name** *gre\_id* **\[vrf** *vrf\_name* **]**
**no gre name** *gre\_id* **\[vrf** *vrf\_name* **]**

**\[Purpose]**
Create GRE tunnel

**\[Parameter]**

| **Parameter** | **Description**             |
| ------------- | --------------------------- |
| *gre\_id*     | GRE name ID, range 0 to 323 |
| *vrf\_name*   | Specify the VRF name        |

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic(config)# gre name 1
```

### <font color="#1d50a2">gre interface-ip name</font>

**\[Command]**
**gre interface-ip \{** *A.B.C.D/M* **|** *X\:X\::X*:&#x58;*/M* **} name** *gre\_id*
**no gre interface-ip \{** *A.B.C.D/M* **|** *X\:X\::X*:&#x58;*/M* **} name** *gre\_id*

**\[Purpose]**
Configuring IP addresses for GRE tunnels

**\[Parameter]**

| **Parameter**         | **Description** |
| --------------------- | --------------- |
| *A.B.C.D/M*           | IPv4 addrss     |
| *X\:X\::X*:&#x58;*/M* | IPv6 address    |
| *gre\_id*             | GRE ID          |

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic(config)# gre interface-ip 1.1.1.1/24 name 1
```

### <font color="#1d50a2">gre dst-ip name</font>

**\[Command]**
**gre dst-ip \{** *A.B.C.D* **|** *X\:X\::X*:X **} \{** *a.b.c.d* **|** *xx\::xx* **} \[vrf** *vrf\_name* **] name** *gre\_id*

**\[Purpose]**
Configure the source and destination IP addresses of the tunnel

**\[Parameter]**

| **Parameter** | **Description**          |
| ------------- | ------------------------ |
| *A.B.C.D*     | Destination IPv4 address |
| *X\:X\::X*:X  | Destination IPv6 address |
| *a.b.c.d*     | Source IPv4 address      |
| *xx\::xx*     | Source IPv6 address      |
| *vrf\_name*   | VRF name                 |
| *gre\_id*     | GRE ID                   |

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic(config)# gre dst-ip 30.1.1.2 40.1.1.2 name 1
```

