I would like to better understand how the Whonix Gateway manages the networking. I could not find answers in the Wiki documentation or elsewhere.
So far, this is my understanding of the Gateway’s network organisation (please corrrect me if I am wrong):
The Gateway has two virtual network interfaces: eth0 and eth1.
eth0 “gets” the internet from the host machine via the default virtualbox virtual NAT adapter, therefore sudo ifconfig returns 10.0.2.15 as its IP address (default VirtualBox NAT settings)
eth1 is another virtualized interface running on the Gateway whose traffic is completly torrified and to which the Workstation (or any other VM) connects, hence the Workstation doesn’t “know” the clearnet address of the Gateway. This network is known as an Internal Network named “Whonix” in the VirtualBox network settings.
What I don’t understand, is how exactly is this configured in the Gateway? The /etc/network/interfaces.d/30_non-qubes-whonix file return a fairly simple configuration, with eth0 being inet dhcp (default Virtualbox setting), and the eth1 showing only
iface eth1 inet static address 10.152.152.10 netmask 255.255.192.0
How does the Gateway act as a router? Does it run a dhcp server? How is the internal network configured?
I am asking to have a depper understanding of how Whonix work and also to be able to reproduce a similar setting as I like the idea of having a virtualized router for other VMs, even for clearnet activities.