clab-iol-mpls-l2vpn is a learning lab for Cisco MPLS Layer 2 VPN services on IOS/IOS-XE using CONTAINERlab, Cisco IOL, Ansible, pyATS, and Jinja2-rendered configuration templates.
The repository is organized by feature. Each feature directory contains the jinja2 templates, ansible host config mappings, validation logic, and instructions for a specific Cisco MPLS L2VPN feature, while shared automation lives under automation/.
The repo separates:
-
Shared automation
- common Ansible configuration
- common playbook logic
- reusable
maketargets - shared inventory and topology
-
Feature-specific data
- per-feature
templates/ - per-feature
host_vars/ - per-feature
tests/ - per-feature
README.md - a small feature-local
Makefile
- per-feature
In practice, you choose a feature under features/, read its README.md, and run make from that directory.
clab-iol-mpls-l2vpn/
├── automation/
│ ├── ansible.cfg
│ ├── feature.mk
│ ├── group_vars/
│ └── playbooks/
├── clab-iol-mpls-l2vpn/
│ └── ansible-inventory.yml (created by Containerlab)
├── features/
│ └── feature01/
│ ├── README.md
│ ├── Makefile
│ ├── host_vars/
│ ├── templates/
│ ├── tests/
│ └── parsed_output/
├── README.md
├── requirements.txt
└── setup.yml
- CONTAINERlab
- Cisco IOL container image
>= 17.12.01- refer to Cisco IOL for how to obtain - Python 3
- Python dependencies from
requirements.txt
Update topology.kinds.cisco_iol.image in setup.yml to match your local IOL image tag.
Example:
docker image ls | grep iol
vrnetlab/cisco_iol l2-17.12.01
vrnetlab/cisco_iol 17.12.01
graph TD
west1---core1
east1---core1
client1---east1
client2---west1
core1provides MPLS transport in the provider corewest1andeast1act as provider edge devicesclient1andclient2represent customer attachment circuits- feature-specific configuration is rendered from
features/<feature>/templates - feature-specific validation is implemented under
features/<feature>/tests
For each lab increment:
- choose a feature under
features/ - read that feature's
README.md - run
make allfrom that feature directory - run
make validateto execute feature-specific validation - inspect the resulting device behavior and parsed test artifacts
Example:
cd features/feature01
make all
make validate
make clean
Depending on the feature, you may also use:
make lab
make configure-only
Reference: Ethernet over MPLS
| Feature | Summary | Cisco Reference | Feature Guide |
|---|---|---|---|
| Feature 01 | EoMPLS / VPWS port-mode implementation using protocol-based L2VPN CLI with pyATS validation | Port mode with L2VPN protocol-based commands | Feature 01 README |
| Feature 02 | EoMPLS / VPWS VLAN-mode implementation using protocol-based L2VPN CLI with pyATS validation | VLAN mode with L2VPN protocol-based commands | Feature 02 README |
Shared automation under automation/ provides:
ansible.cfgfor common Ansible behaviorplaybooks/configure.ymlfor shared configuration logicgroup_vars/for common network automation settingsfeature.mkfor reusablemaketargets
Each feature directory provides:
templates/for feature-specific configuration renderinghost_vars/for per-device template selection and feature datatests/for feature-specific pyATS/Genie validation- a local
Makefilethat includes the sharedfeature.mk
Feature validation is feature-scoped and runs through make validate.
For supported network commands, validation uses:
- pyATS for test execution and lifecycle
- Genie parsers for structured command output
- feature-local assertions against parsed service state
For example, Feature 01 validates:
- L2VPN service state on the PE devices using parsed
show l2vpn service name REDoutput - end-to-end client connectivity from
client1toclient2
Parsed command output is written under the feature directory for inspection.
Ethernet over MPLS (EoMPLS) is a transport mechanism used to implement MEF E-Line services.
- MEF E-Line defines a point-to-point Ethernet Virtual Circuit (EVC)
- EoMPLS is the MPLS transport used to carry Ethernet frames across the provider network
- VPWS is the IETF-aligned term for a point-to-point Layer 2 VPN service
- in Cisco terminology, EoMPLS is effectively the Ethernet realization of VPWS
In practice, EoMPLS is the standard way to deliver point-to-point Ethernet services such as:
- EPL (Ethernet Private Line)
- EVPL (Ethernet Virtual Private Line)
over an MPLS core.
VPLS is the corresponding MPLS technology for multipoint Ethernet service models aligned to E-LAN.
The primary MEF document for E-Line is MEF 6.1 - Ethernet Services Definitions.
MEF 6.1:
- defines E-Line as a point-to-point Ethernet Virtual Circuit (EVC)
- defines the service framework and attributes for both E-Line and E-LAN
- is service-oriented and technology-agnostic
- does not prescribe MPLS as the transport mechanism
In essence, MEF defines the service from the customer perspective, while Cisco IOS/IOS-XE and related IETF specifications define how that service is transported over MPLS.
- AToM -> Any Transport over MPLS
- EoMPLS -> Ethernet transport within AToM
- VPWS -> standards-based point-to-point Layer 2 VPN concept
| Scope | Network | Sub-Network | Assignment | Name |
|---|---|---|---|---|
| Management | 10.0.0.0/24 | 10.0.0.2/24 | west1 | |
| Management | 10.0.0.0/24 | 10.0.0.3/24 | core1 | |
| Management | 10.0.0.0/24 | 10.0.0.4/24 | east1 | |
| Router ID (lo0) | 10.10.10.0/24 | 10.10.10.1/32 | west1 | |
| Router ID (lo0) | 10.10.10.0/24 | 10.10.10.2/32 | core1 | |
| Router ID (lo0) | 10.10.10.0/24 | 10.10.10.3/32 | east1 | |
| P2P Links | 10.1.0.0/24 | 10.1.0.0/31 | 10.1.0.0/31 | west1::core1 |
| P2P Links | 10.1.0.0/24 | 10.1.0.0/31 | 10.1.0.1/31 | core1::west1 |
| P2P Links | 10.1.0.0/24 | 10.1.0.2/31 | 10.1.0.2/31 | east1::core1 |
| P2P Links | 10.1.0.0/24 | 10.1.0.2/31 | 10.1.0.3/31 | core1::east1 |
| ASN | Device |
|---|---|
| 64512 | core1 |
| 64512 | east1 |
| 64512 | west1 |
Execution output is written to setup.log in the feature directory where you run make.
This project is licensed under the MIT License. See LICENSE for details.