Example: more sources translation to interface¶
r1
hostname r1
vrf def v1
rd 1:1
exit
int eth1
vrf for v1
ipv4 addr 1.1.1.1 255.255.255.252
ipv6 addr 1234:1::1 ffff:ffff::
exit
r2
hostname r2
vrf def v1
rd 1:1
exit
int eth1
vrf for v1
ipv4 addr 1.1.1.2 255.255.255.252
ipv6 addr 1234:1::2 ffff:ffff::
exit
int eth2
vrf for v1
ipv4 addr 1.1.1.129 255.255.255.128
ipv6 addr 1234:2::1 ffff:ffff::
exit
access-list test4
permit all 1.1.1.128 255.255.255.128 all 1.1.1.0 255.255.255.128 all
exit
access-list test6
permit all 1234:2:: ffff:ffff:: all 1234:1:: ffff:ffff:: all
exit
ipv4 nat v1 srclist test4 interface ethernet1
ipv6 nat v1 srclist test6 interface ethernet1
r3
hostname r3
vrf def v1
rd 1:1
exit
bridge 1
exit
int eth1
bridge-gr 1
exit
int eth2
bridge-gr 1
exit
int eth3
bridge-gr 1
exit
int bvi1
vrf for v1
ipv4 addr 1.1.1.130 255.255.255.128
ipv6 addr 1234:2::2 ffff:ffff::
exit
ipv4 route v1 0.0.0.0 0.0.0.0 1.1.1.129
ipv6 route v1 :: :: 1234:2::1
r4
hostname r4
vrf def v1
rd 1:1
exit
int eth1
vrf for v1
ipv4 addr 1.1.1.131 255.255.255.128
ipv6 addr 1234:2::3 ffff:ffff::
exit
ipv4 route v1 0.0.0.0 0.0.0.0 1.1.1.129
ipv6 route v1 :: :: 1234:2::1
r5
hostname r5
vrf def v1
rd 1:1
exit
int eth1
vrf for v1
ipv4 addr 1.1.1.132 255.255.255.128
ipv6 addr 1234:2::4 ffff:ffff::
exit
ipv4 route v1 0.0.0.0 0.0.0.0 1.1.1.129
ipv6 route v1 :: :: 1234:2::1
r3 tping 100 5 1.1.1.1 vrf v1
r4 tping 100 5 1.1.1.1 vrf v1
r5 tping 100 5 1.1.1.1 vrf v1
r3 tping 100 5 1234:1::1 vrf v1
r4 tping 100 5 1234:1::1 vrf v1
r5 tping 100 5 1234:1::1 vrf v1
r2 output show ipv4 nat v1 tran
r2 output show ipv6 nat v1 tran
- Install ContainerLab as described here
- Fetch crypt-nat06 file
- Launch ContainerLab
crypt-nat06.yml
topology:
containerlab deploy --topo crypt-nat06.yml
crypt-nat06.yml
topology:
containerlab destroy --topo crypt-nat06.yml