How to share an internet connection between two VLAN?

How to share an internet connection between two VLAN? (If it's possible)

Let's say a single internet connection (Asus RT-AC87U router) that I want it to serve 192.168.1.0/24 and 10.0.0.0/24 VLAN on the same switch (HP 1820-24G Switch J9980A).


Generally, you need some router between your VLANs.

You could use an L3 switch (the HPE 1820 is L2 only), or a VLAN-capable router (the RT-AC87U might do, can't say for sure).

With a router, you need to trunk the VLANs from the switch to the router. On the switch, configure both VLANs as 802.1q-tagged towards the router (one "native" VLAN may stay untagged if you prefer). On the router, create a virtual subinterface for each VLAN (tagging needs to mirror the switch config). If everything's done correctly, a client from each VLAN should be able to ping its default gateway.