Setting Up a NAT Network for the RADV Router
Setting Up a NAT Network for the RADV Router
In this post, I’ll be focusing on the first essential step before deploying the Router Advertisement Daemon (RADV) router: establishing a NAT network that enables external connectivity. To streamline this process, I’ll utilise VirtualBox’s command line tool, VBoxManage
, to automate the network creation. This approach not only enhances consistency within my lab environment but also aligns perfectly with my Infrastructure as Code (IaC) principles, ensuring that every network configuration is repeatable and version-controlled.
Git plays a crucial role in managing and tracking these changes. Every script and configuration is stored in a Git repository, making it easy to roll back or redeploy setups elsewhere. This practice ensures that each network modification, such as adding a NAT network, is committed to the repository, promoting full transparency and traceability—key practices to carry into production environments.
For the RADV router, an IPv4 NAT network is essential for enabling external access while keeping the internal lab environment isolated. This configuration allows the router to communicate with external networks (like the internet) while safeguarding internal services.
Scripted Process for NAT Network Setup
Below are the steps I followed using VBoxManage
to create the NAT network. As always, this script has been saved to my Git repository for future reference and reuse.
Creating the NAT Network
The first step was to create a NAT network for the RADV router's external communications. I selected the network range 10.0.3.0/24
and disabled DHCP, as it’s not needed in this case.
VBoxManage.exe natnetwork add --netname IPv6TestLabNAT --network "10.0.3.0/24" --dhcp on --ipv6 off
VBoxManage dhcpserver add --netname "IPv6TestLabNAT" --ip "10.0.3.1" --lower-ip "10.0.3.10" --upper-ip "10.0.3.100" --netmask "255.255.255.0"
This command creates a NAT network named LABEXNATNetwork
with a static IP address range but without DHCP enabled, as all IP assignments will be handled manually within the lab.
Why a NAT Network?
The NAT network enables the RADV router, running inside my host machine, to access external networks like the internet. A NAT (Network Address Translation) network allows VMs to appear as if they’re communicating from a single IP address (the host machine) when reaching out externally. This isolates the internal lab network while allowing the router to send and receive packets to external services—particularly useful when the lab environment contains sensitive or test services that should not be directly exposed.
The Internal IPv6-Only Network
In addition to the NAT network, I plan to establish an internal IPv6-only network for the other VMs in the lab. This network will be completely isolated from the outside world, with no internal IPv4 traffic permitted. The RADV router will handle the advertising of IPv6 addresses to the other VMs, and all internal communication will occur over IPv6. This setup will be complemented by DHCPv6, which will manage the dynamic assignment of IPv6 addresses, automating IP configuration within the internal network.
Since my ISP doesn’t support IPv6, implementing a NAT64 gateway and DNS64 server is crucial for providing internet access to the VMs. Without DNS64, resolving domain names would be problematic, complicating software installations and patching. The NAT64 gateway ensures that the IPv6-only VMs can translate addresses and access the internet.
Network Diagram
The diagram below illustrates the core elements of the lab’s network, showcasing how the NAT network connects the RADV router to the internet while maintaining an internal IPv6-only network for the VMs:
With the NAT network now established for the RADV router, I’m laying the groundwork for further configurations in the lab. In the next post, I’ll focus on selecting an appropriate address space for IPv6 and generating a Unique Local Address (ULA) for the internal network.
I’ll also explore the necessary steps for managing IPv6 addresses, which will set the stage for future configurations of the RADV router and the overall network structure.
Comments
Post a Comment