Let’s see how to turn a host into a router.
For this purpose, I have two VMs – Ubuntu-VM and Ubuntu-VM Clone.
Let’s say we want to turn Ubuntu-VM into a router. To be able to do that, two NICs have to be enabled and put in two different subnets and ip-forwarding should be enabled on Ubuntu-VM. Remember to have the interfaces on VMs in bridged mode.


Network setup should look something like this, see Fig 3:

Once you configure all the interfaces, check internet connectivity on the host (Ubuntu-VM Clone)

At this point, we have to enable ip forwarding on our router host and add some rules to netfilter/iptable.


It is convenient to make a bash script like the one above.
Host might not still have DNS. You would have to edit /etc/resolv.conf to add “nameserver 8.8.8.8” (8.8.8.8 being Google’s public DNS). Let’s see if our host has internet now.

It also means that router host is forwarding packets from its external interface to internal interface. One of the functions of a router has been accomplished.
References:
1. Jungwoo Ryoo’s topic on LinkedIn Learning – Host as a router
