Linux NAT over VLAN

iptableslinuxnat;vlan

I have a VLAN setup through a switch to act as a trunk. Sending tagged VLAN packets to their respective ports as untagged. On these are various devices that all require the same IP on the same subnet – 192.168.1.1/24. On the Linux host I have all the VLAN interfaces setup, and assigning an IP in the same subnet for each one of those will result in having access to 192.168.1.1 one at a time. So I know the connection at this point works.

What I need to do now is have a way to communicate with these devices on the different VLANs at the same time without changing the IP scheme of the devices. What would be ideal is to have something like 192.168.110.1 traffic go to 192.168.1.1 over VLAN 110, 192.168.120.1 to 192.168.1.1 over VLAN 120, and so on. How would I go about creating this scenario, or is it even possible without having some interim layer 3 device between the two points?

My initial thinking was that I would need a virtual interface to act as the "LAN" client, letting the VLAN interface act as a "gateway", and then just forward ports after that point. It just seems it should be less complicated than that.

(Note: This would be a closed private network with no external access whatsoever. Security doesn't need to exist, the paths just need to work.)

Best Answer

Unfortunately, it does seem like a VM is the only thing, which is okay. I have decided to use X forwarding and basically run a small VM just to isolate the network from the host machine. Works wonders, and there's not much performance lost with Linux KVM or even Virtual Box. Good times.