Create virtual network interface to use with NAT

I’m trying to to setup NAT tunelling on my NixOS server. My server has only one physical interface, which is pointed to the world. So I need to create a virtual network interface to define it as internal interface for NAT. My physical interface(let’s assume that it’s eth0) is defined as external interface.
So I’m wondering. how to create a virtual network interface in NixOS configs. I tried doing this way, but it didn’t gave any results:

nat0 = {
        ipv4.addresses = [
	  { address="10.10.10.3"; prefixLength=24; }
	];
      };
    };
  };

Found solution manually in network configuration module, at nixpkgs repo. You have to add virtual parsmeter to the configuration, like this:

nat0 = {
        virtual = true;
        ipv4.addresses = [
	  { address="10.10.10.3"; prefixLength=24; }
	];
      };
    };
  };
1 Like