Connect one VirtualBox VM to Internet through other VirtualBox VM

I am trying to learn iptables and stuck with the following task: VirtualBox VM2 has one interface (internal), VirtualBox VM1 has 2 interfaces (NAT and internal). How to make VM2 to have an access to the Internet using iptables?