forked from ipspace/netlab-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
124 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# DHCP relaying from an EVPN VRF | ||
|
||
This directory contains *netlab* topology file used to test DHCP relaying from an EVPN VRF toward a DHCP server in the network core. | ||
|
||
![DHCP relaying topology](evpn-dhcp-relay.png) | ||
|
||
After starting the lab, the clients (*cl_a* and *cl_b*) should get DHCP-assigned IP address on their lab-facing interfaces. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% for intf in interfaces if intf.dhcp.client is defined and intf.dhcp.client %} | ||
interface {{ intf.ifname }} | ||
no ip address | ||
ip address dhcp | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% for intf in interfaces if intf.dhcp.server is defined and intf.vrf is defined %} | ||
{% if loop.first %} | ||
ip dhcp relay information option | ||
{% endif %} | ||
{% endfor %} | ||
! | ||
{% for intf in interfaces if intf.dhcp.server is defined %} | ||
{% set helper = hostvars[intf.dhcp.server].loopback.ipv4|ipaddr('address') %} | ||
interface {{ intf.ifname }} | ||
ip helper-address {{ helper }}{% if intf.vrf is defined %} vrf default{% endif %} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
logging buffered | ||
no service timestamp debug | ||
! | ||
do debug ip dhcp server packet | ||
do debug ip dhcp server event | ||
! | ||
{% for h,v in hostvars.items() %} | ||
{% for intf in v.interfaces if intf.dhcp.server is defined and intf.ipv4 is defined %} | ||
ip dhcp excluded-address {{ intf.ipv4|ipaddr('address') }} | ||
{% if intf.gateway.ipv4 is defined %} | ||
ip dhcp excluded-address {{ intf.gateway.ipv4|ipaddr('address') }} | ||
{% endif %} | ||
{% endfor %} | ||
{% endfor %} | ||
! | ||
{% for h,v in hostvars.items() %} | ||
{% for intf in v.interfaces if intf.dhcp.server is defined and intf.ipv4 is defined %} | ||
! | ||
ip dhcp pool p_{{ intf.ipv4|ipaddr('network') }} | ||
network {{ intf.ipv4|ipaddr('network') }} {{ intf.ipv4|ipaddr('netmask') }} | ||
{% if intf.gateway.ipv4 is defined %} | ||
default-router {{ intf.gateway.ipv4|ipaddr('address') }} | ||
{% else %} | ||
default-router {{ intf.ipv4|ipaddr('address') }} | ||
{% endif %} | ||
{% endfor %} | ||
{% endfor %} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
addr: | | ||
{{ " {0:20} {1:>18} {2}".format("Interface","IPv4 address","Description") }} | ||
{{ "=" * 80 }} | ||
{% for n,d in nodes.items() %} | ||
{% if not loop.first %} | ||
{% endif %} | ||
{{ n }} ({{ d.loopback.ipv4 }}) | ||
{% for intf in d.interfaces if 'ipv4' in intf %} | ||
{{ "{0:20} {1:>18} {2}".format(intf.ifname,intf.ipv4,intf.name) }}{% if 'vrf' in intf | ||
%} (VRF: {{ intf.vrf }}){% endif +%} | ||
{% endfor %} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
message: | | ||
This topology sets up a simple VXLAN network using DHCP relay | ||
functionality. It includes a DHCP server (running on Cisco | ||
IOSv), DHCP client (also on Cisco IOSv) and two intermediate | ||
VXLAN-enabled switches. | ||
defaults.attributes: | ||
link.dhcp: | ||
client: bool | ||
server: str | ||
|
||
groups: | ||
dhcp_server: | ||
members: [ srv ] | ||
module: [ ospf ] | ||
config: [ dhcp-server ] | ||
device: csr | ||
dhcp_client: | ||
members: [ cl_a, cl_b ] | ||
config: [ dhcp-client ] | ||
device: iosv | ||
switch: | ||
members: [ sw1, sw2 ] | ||
module: [ ospf,bgp,vrf,vlan,vxlan,gateway,evpn ] | ||
config: [ dhcp-relay ] | ||
device: eos | ||
|
||
vrfs: | ||
client: | ||
|
||
vlans: | ||
cv1: | ||
gateway: True | ||
ospf.passive: True | ||
vrf: client | ||
|
||
bgp.as: 65000 | ||
gateway.id: 1 | ||
|
||
nodes: [ srv, sw1, sw2, cl_a, cl_b ] | ||
|
||
links: | ||
- srv-sw1 | ||
- srv-sw2 | ||
- sw1-sw2 | ||
- cl_a: | ||
dhcp.client: True | ||
sw1: | ||
dhcp.server: srv | ||
vlan.access: cv1 | ||
- cl_b: | ||
dhcp.client: True | ||
sw2: | ||
dhcp.server: srv | ||
vlan.access: cv1 | ||
|
||
defaults.outputs: | ||
_include: [ outputs/format.yml ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Submodule tools
updated
from 4af21a to 6c7ceb