I'm trying to create some subnets on an ESXi (version 6.7) host and have some VMs within these subnets with one or more that act as gateway between them. I'm trying to do this creating another VLAN on the same vSwitch but I can't find a solution that works. The following is an example that I want to realize: I have the management network that is 10.0.0.0/24 I want a second network like this 10.0.1.0/24 So some VMs will be on the 10.0.0.0/24 network, others will be on the 10.0.1.0/24 network and some will have an interface on both networks.
Surely there could be other networks (10.0.2.0/24, 10.0.3.0/24 and so on) but this is the most simple example that describes my goal. I tried to assign a static ip to the VM that have an interface on the second network (actually I'm doing these tests only with Ubuntu VMs) through the netplan configuration file and I've also tried to setup the routes but it didn't work. The ping is the only thing that works but if I try to connect to something on the Internet it didn't work. I know that something could seem silly but I'm not very good on these networking stuff and I'm new to ESXi, I hope that someone could help me, thanks in advance.
Ps. Tell me if you need some additional information about my environment.