Configure Encapsulation

About this task

The L2/L3 parameters are configured as part of encap object and the encap object is attached to egress object to encapsulate packets.

Procedure

  1. Enable encapsulation.
    # encap encap-name
  2. Configure the encapsulation type.
    # encap-type [ gre | erspan ]
  3. Configure the source IPv4 or MAC address.
    • Source IPv4 address:
    # source-ipv4-addr ip-addr
    • Source MAC address:
      # source-mac-addr mac-addr
  4. Configure the destination IPv4 or MAC address.
    • Destination IPv4 address:
    # destination-ipv4-addr ip-addr
    • Destination MAC address:
      # destination-mac-addr mac-addr
  5. Configure the VLAN ID.
    # vlan-id vlan-id-value
  6. Configure the VLAN priority (PCP) value.
    # vlan-pcp vlan-pcp-value

Example

encap encap1 
 source-mac-addr 00:00:00:11:11:11 
 destination-mac-addr 00:00:00:22:22:22 
 source-ip-addr 1.1.1.1 
 destination-ip-addr 2.2.2.2 
 vlan-id 100 
 vlan-pcp 3 
 
interface ethernet 1/1 
  no  shutdown 
 
interface ethernet 1/2 
  no shutdown 
 
interface ethernet 1/1 
  ingress-group ingg1 
 
egress eg1 
set encap encap1  
  precedence 10  interface ethernet 1/2 
quit 
 
set egress-group egg1 
    egress eg1 
quit 
  
ip access-list v4 
 seq 10 permit ip any any 
quit 
 
route-map rm1 10 
  match ip access-list v4 
  egress-group egg1 
quit 
  
ingress-group ingg1 
  route-map rm1 
quit