Skip to content

Commit

Permalink
Adding simple VRF examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ipspace committed Mar 18, 2022
1 parent 6f56a2e commit 849353a
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 0 deletions.
46 changes: 46 additions & 0 deletions VRF/vrf-lite-hosts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# VRF Lite with Hosts Test Cases

This directory contains *netsim-tools* topology files describing several simple VRF Lite test cases containing a set of hosts attached to a single router.

The test cases can be used with all network devices supporting VRF configuration module and all virtualization providers supported by *netsim-tools*:

* To change the router device type, use `-s nodes.rtr.device=xxx` CLI argument
* To change the virtualization provider, use `-p` CLI argument.

To start the lab with Cisco IOSv router, use:

```
netlab up -s nodes.rtr.device=iosv <topo-name>
```

To start the lab with Cisco IOS XE router, use:

```
netlab up -s nodes.rtr.device=csr <topo-name>
```

To start the lab with Arista cEOS (using *containerlab*) use:

```
netlab up -s nodes.rtr.device=eos -p clab <topo-name>
```

## Isolated VRFs

The `multi-vrf.yml` topology contains two isolated VRFs:

* VRF *red* containing Linux hosts h1 and h2
* VRF *blue* containing Linux hosts h3 and h4

After starting the lab, h1 should be able to ping h2 but not h3 or h4, and h3 should be able to ping h4 but not h1 or h2.

## Inter-VRF Route Leaking

The `vrf-route-leaking.yml` topology contains two VRFs:

* VRF *red* containing Linux hosts h1 and h2
* VRF *blue* containing Linux hosts h3 and h4

Routes from *red* VRF are imported into *red* and *blue* VRF. Likewise, the routes from *blue* VRF are imported into both VRFs.

After starting the lab, all hosts (h1..h4) should be able to ping all other hosts.
23 changes: 23 additions & 0 deletions VRF/vrf-lite-hosts/multi-vrf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
defaults.device: linux

vrfs:
red:
blue:

nodes:
rtr:
module: [ vrf ]
h1:
h2:
h3:
h4:

links:
- rtr: { vrf: red }
h1:
- rtr: { vrf: red }
h2:
- rtr: { vrf: blue }
h3:
- rtr: { vrf: blue }
h4:
26 changes: 26 additions & 0 deletions VRF/vrf-lite-hosts/vrf-route-leaking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
defaults.device: linux

vrfs:
red:
import: [ red, blue ]
blue:
import: [ red, blue ]

nodes:
rtr:
module: [ vrf ]
bgp.as: 65000
h1:
h2:
h3:
h4:

links:
- rtr: { vrf: red }
h1:
- rtr: { vrf: red }
h2:
- rtr: { vrf: blue }
h3:
- rtr: { vrf: blue }
h4:
41 changes: 41 additions & 0 deletions VRF/vrf-lite-routers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# VRF Lite with CE Routers Test Cases

This directory contains *netsim-tools* topology files describing several simple VRF Lite test cases containing a set of CE routers attached to a pair of PE routers running VRF Lite.

The test cases can be used with all network devices supporting VRF configuration module and all virtualization providers supported by *netsim-tools*:

* To change the router device type for **pe1**, use `-s nodes.pe1.device=xxx` CLI argument
* To change the router device type for **pe2**, use `-s nodes.pe2.device=xxx` CLI argument
* To change the virtualization provider, use `-p` CLI argument.

For example, to start the lab with a Cisco IOSv router and an Arista vEOS router, use:

```
netlab up -s nodes.pe1.device=iosv -s nodes.pe2.device=eos <topo-name>
```

To start the lab with Arista cEOS (using *containerlab*) use:

```
netlab up -p clab -s nodes.pe1.device=eos -s nodes.pe2.device=eos <topo-name>
```

## Isolated VRFs

The `multi-vrf.yml` topology contains two isolated VRFs:

* VRF *red* containing CE-routers **cr1** and **cr2** running OSPF with PE-routers
* VRF *blue* containing CE-router **cb1** and **cb2** running BGP with PE-routers

The link between PE-routers and **cr1** is multi-access link, the other PE-CE links are point-to-point links (Arista vEOS could not establish a VRF BGP session over a multi-access link).

After starting the lab, **cr1** should be able to ping **cr2** but not **cb1** or **cb1**.

## Inter-VRF Route Leaking

The `vrf-route-leaking.yml` topology contains the same devices and links as the *Isolated VRFs* topology, the only difference is the route leaking between *red* and *blue* VRFs:

* Routes from *red* VRF are imported into *red* and *blue* VRF.
* Likewise, the routes from *blue* VRF are imported into both VRFs.

After starting the lab, all CE-routers should be able to ping each other.
42 changes: 42 additions & 0 deletions VRF/vrf-lite-routers/multi-vrf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
defaults.device: cumulus

vrfs:
red:
blue:

module: [ vrf,ospf,bgp ]
bgp.as: 65000

nodes:
pe1:
pe2:
cr1:
module: [ ospf ]
cr2:
module: [ ospf ]
cb1:
module: [ bgp ]
bgp.as: 65101
cb2:
module: [ bgp ]
bgp.as: 65102

links:
- pe1: { vrf: red }
pe2: { vrf: red }
cr1:
ospf.cost: 10
- pe1: { vrf: red }
cr2:
ospf.cost: 10
- pe2: { vrf: red }
cr2:
ospf.cost: 10
- pe1: { vrf: blue }
cb1:
- pe2: { vrf: blue }
cb1:
- pe1: { vrf: blue }
cb2:
- pe2: { vrf: blue }
cb2:
44 changes: 44 additions & 0 deletions VRF/vrf-lite-routers/vrf-route-leaking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
defaults.device: cumulus

vrfs:
red:
import: [ red, blue ]
blue:
import: [ red, blue ]

module: [ vrf,ospf,bgp ]
bgp.as: 65000

nodes:
pe1:
pe2:
cr1:
module: [ ospf ]
cr2:
module: [ ospf ]
cb1:
module: [ bgp ]
bgp.as: 65101
cb2:
module: [ bgp ]
bgp.as: 65102

links:
- pe1: { vrf: red }
pe2: { vrf: red }
cr1:
ospf.cost: 10
- pe1: { vrf: red }
cr2:
ospf.cost: 10
- pe2: { vrf: red }
cr2:
ospf.cost: 10
- pe1: { vrf: blue }
cb1:
- pe2: { vrf: blue }
cb1:
- pe1: { vrf: blue }
cb2:
- pe2: { vrf: blue }
cb2:

0 comments on commit 849353a

Please sign in to comment.