VM network in Qubes
In Qubes, the standard Xen networking is used, based on backend driver in the driver domain and frontend drivers in VMs. In order to eliminate layer 2 attacks originating from a compromised VM, routed networking is used instead of the default bridging of
vif devices. The default vif-route script had some deficiencies (requires
eth0 device to be up, and sets some redundant iptables rules), therefore the custom vif-route-qubes script is used.
The IP address of
eth0 interface in AppVM, as well as two IP addresses to be used as nameservers (
DNS2), are passed via xenstore to AppVM during its boot (thus, there is no need for DHCP daemon in the network driver domain).
DNS2 are private addresses; whenever an interface is brought up in the network driver domain, the /usr/lib/qubes/qubes_setup_dnat_to_ns script sets up the DNAT iptables rules translating
DNS2 to the newly learned real dns servers. This way AppVM networking configuration does not need to be changed when configuration in the network driver domain changes (e.g. user switches to a different WLAN). Moreover, in the network driver domain, there is no DNS server either, and consequently there are no ports open to the VMs.
Routing tables examples
VM routing table is simple:
Network driver domain routing table is a bit longer: