Sure, you can follow along here to build a virtual machine with RRAS router (internal to external vSwitch) role.
https://www.dell.com/support/kbdoc/en-us/000118763/configuring-windows-server-2012-r2-as-a-router
https://blogs.technet.microsoft.com/jhoward/2008/06/17/hyper-v-what-are-the-uses-for-different-types-of-virtual-networks/
--please don't forget to Accept as answer if the reply is helpful--