About this task
The L2 and L3 parameters are configured as
part of encap object, and the encap object is attached to an egress object to encapsulate
packets.
Procedure
-
Enable encapsulation.
-
Configure the encapsulation type.
# encap-type [ gre | erspan ]
-
Configure the source IPv4 or MAC address.
# source-ipv4-addr ip-addr
-
Configure the destination IPv4 or MAC address.
- Destination IPv4 address:
# destination-ipv4-addr ip-addr
-
Configure the VLAN ID.
-
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