# Configuring VxLAN

<figure><img src="https://2662483853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhNXO6wTLpx5wBGAVjtJV%2Fuploads%2FOyFN1k2pf9eM260WX1JG%2FScreenshot%202022-09-26%20at%2012.02.41%20PM.png?alt=media&#x26;token=c16a2c11-df28-4697-8fef-cf2d29e02beb" alt=""><figcaption><p>VxLAN</p></figcaption></figure>

### Tunnel Configuration

#### Reference

<table data-header-hidden><thead><tr><th></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>Command</td><td>tunnel &#x3C;tunnelname><br>no tunnel &#x3C;tunnelname></td><td></td></tr><tr><td>Description</td><td>Create tunnel</td><td></td></tr><tr><td>Parameters</td><td>Tunnelname</td><td></td></tr><tr><td>Mode</td><td>CONFIG</td><td></td></tr></tbody></table>

#### Example

```
pbnoscli(config)# tunnel tunnel1
pbnoscli(config)# no tunnel tunnel1
```

### Tunnel Attributes

Using this command, you can configure the attributes of the tunnel. Gateway is provisioned only when the nodes are not directly connected&#x20;

**Note**: Updation of tunnel is not supported. Tunnel must be deleted and re-configured for any change

#### Reference

<table data-header-hidden><thead><tr><th></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>Command</td><td>[no] tunnel &#x3C;tunnel-name></td><td></td></tr><tr><td>Description</td><td>Create tunnel</td><td></td></tr><tr><td>Parameters</td><td><p><strong>interface</strong>: Configure tunnel ports </p><p><strong>source-ip</strong> : Source IP address<br><strong>destination-ip</strong> : Destination IP address <strong>gateway</strong> : Gateway IPv4 Address </p><p><strong>vni</strong> : VXLAN network identifier[ range: 4096 - 16777215] </p><p><strong>source-port</strong> : Tunnel Source Port<br><strong>vlan-tagging   : Tunnel VLAN Tagging</strong></p></td><td></td></tr><tr><td>Mode</td><td>TUNNEL</td><td></td></tr></tbody></table>

#### Example

```
pbnoscli(config)# tunnel tunnel1
pbnoscli(config-tunnel-tunnel1)# interface Ethernet4/1
pbnoscli(config-tunnel-tunnel1)# source-ip 1.1.1.1
pbnoscli(config-tunnel-tunnel1)# destination-ip 2.2.2.2
pbnoscli(config-tunnel-tunnel1)# source-port 10
pbnoscli(config-tunnel-tunnel1)# vlan-tagging enable
pbnoscli(config-tunnel-tunnel1)# vni 4096
pbnoscli(config-tunnel-tunnel1)#

```

**Flow based Encap Configuration**

You can set the rules for the VxLAN Encap using flow. Here the tool port must be the tunnel name created using tunnel config command.

#### Reference

<table data-header-hidden><thead><tr><th></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>Command</td><td><p>flow flowname </p><p>network-ports Ethernet4/1 </p><p>tool-ports tunnel1 </p><p>rule 1 permit match all</p></td><td></td></tr><tr><td>Description</td><td>Add flow</td><td></td></tr><tr><td>Parameters</td><td><p><strong>description</strong>  Configure description for flow<br><strong>enable</strong>  Enable the flow </p><p><strong>end</strong>  Exit to Exec Prompt </p><p><strong>exit</strong>  Exit from the Current Prompt<br><strong>from</strong>  Configure network or TAP ports </p><p><strong>no</strong>  no form </p><p><strong>rule</strong>  Configure rule </p><p><strong>to</strong>  Configure network tool or analyzer ports</p></td><td></td></tr><tr><td>Mode</td><td>FLOW</td><td></td></tr></tbody></table>

#### Example

```
pbnoscli(config)# flow flow1
pbnoscli(config-flow-flow1)# network-ports Ethernet4/1
pbnoscli(config-flow-flow1)# tool-ports tunnel1
pbnoscli(config-flow-flow1)# rule 1 permit match-all
pbnoscli(config-flow-flow1)# end
pbnoscli#
```

### Flow-Based Decap Configuration

You can set the rules for the VxLAN Decap using flow\.. Here the Network port must be the tunnel name created using tunnel config command.

#### Reference

<table data-header-hidden><thead><tr><th></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>Command</td><td><p>flow flowname </p><p>network-ports tunnel1</p><p>tool-ports Ethernet10/1</p><p>rule 1 permit match all</p></td><td></td></tr><tr><td>Description</td><td>Add flow</td><td></td></tr><tr><td>Parameters</td><td><p><strong>description</strong>  Configure description for flow<br><strong>enable</strong>  Enable the flow </p><p><strong>end</strong>  Exit to Exec Prompt </p><p><strong>exit</strong>  Exit from the Current Prompt<br><strong>from</strong>  Configure network or TAP ports </p><p><strong>no</strong>  no form </p><p><strong>rule</strong>  Configure rule </p><p><strong>to</strong>  Configure network tool or analyzer ports</p></td><td></td></tr><tr><td>Mode</td><td>FLOW</td><td></td></tr></tbody></table>

#### Example

```
pbnoscli(config)# flow flow1
pbnoscli(config-flow-flow1)# network-ports tunnel1
pbnoscli(config-flow-flow1)# tool-ports Ethernet10/1
pbnoscli(config-flow-flow1)# rule 1 permit match-all
pbnoscli(config-flow-flow1)# end
pbnoscli#
```

### Show VXLAN Tunnel Command

You can display the Vxlan tunnel configurations using this command.

#### Reference

<table data-header-hidden><thead><tr><th></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td>Command</td><td>vxlan ("VxLAN Tunnel") tunnel ("Tunnel Information") (all ("Displays all VXLAN Tunnel configuration") | ("Displays specific VXLAN Tunnel configuration")  &#x3C;tunnelid:string length[10]> ("Tunnel Name")),</td><td></td></tr><tr><td>Description</td><td>Displays VXLAN tunnel</td><td></td></tr></tbody></table>

#### Example

```
pbnoscli# show vxlan tunnel all

===============================================
VXLAN Tunnel - tunnel
===============================================

===============================================
VXLAN Tunnel - tunnel1
===============================================
Tunnel Port       : Ethernet4/1
Source IP         : 1.1.1.1
Destination IP    : 2.2.2.2
Source MAC        : 1c:34:da:23:77:00
VN-ID             : 1335637472
pbnoscli#
```
