Skip to content
Ask AI

GRE Configuration

[Command]

show gre-tunnel summary|id

[Purpose]

Display the configured GRE tunnel information

[View]

System view

[Use Cases]

sonic# show gre-tunnel summary

[Command]

show counters tunnel [String]

[Purpose]

Display GRE tunnel traffic statistics

[View]

System view

[Use Cases]

sonic# show counters tunnel

[Command]

interface gre gre_id

[Purpose]

Create a GRE tunnel

[View]

System configuration view

[Parameter]

gre_idGRE name ID, range 0–63

[Use Cases]

sonic(config)# interface gre 1

[Command]

src_ip ip_addr

[Purpose]

Configure the source IP of the GRE tunnel

[View]

GRE Tunnel Configuration View

[Parameter]

ip_addrA.B.C.D or A::B

[Use Cases]

sonic(config)# interface gre 1
sonic(config-greif-1)# src_ip 172.1.0.1

[Command]

dst_ip ip_addr

[Purpose]

Configure the destination IP of the GRE tunnel

[View]

GRE Tunnel Configuration View

[Parameter]

ip_addrA.B.C.D or A::B

[Use Cases]

sonic(config)# interface gre 1
sonic(config-greif-1)# dst_ip 172.2.0.1

[Command]

gre-key gre_key

[Purpose]

Configure the key of the GRE tunnel

[View]

GRE Tunnel Configuration View

[Parameter]

gre_keyrange: 1~4294967295

[Use Cases]

sonic(config)# interface gre 1
sonic(config-greif-1)# gre-key 12345

[Command]

ip address ip_addr

[Purpose]

Configure the address of the GRE tunnel

[View]

GRE Tunnel Configuration View

[Parameter]

ip_addrA.B.C.D/mask or A::B/mask

[Use Cases]

sonic(config)# interface gre 1
sonic(config-greif-1)# ip address 1.1.1.1/24

[Command]

ttl-mode uniform|pipe

[Purpose]

Configure the TTL for the GRE tunnel; the default mode is uniform

[View]

GRE Tunnel Configuration View

[Use Cases]

sonic(config)# interface gre 1
sonic(config-greif-1)# ttl-mode pipe

[Command]

tunnel-vrf String

[Purpose]

Configure the VRF isolation for the GRE tunnel

[View]

GRE Tunnel Configuration View

[Use Cases]

sonic(config)# interface gre 1
sonic(config-greif-1)# tunnel-vrf test1