There are providers in the web which allow the usage of virtualized NICs. In this case, it is easy because you can clearly assign one NIC as WAN interface to your VM and one NIC as LAN interface to your VM.
This means everything is very similar to a setup which you would do when doing it at a machine locally.
The only task for you is to find a provider which allows the usage of virtualized NICs. But there are many of them in the web!