I want to use iptables for provide NAT translation and forward the packets out a different interface.
The network set-up is as follows:
Alias:
eth0:220 with IP address 10.1.1.220 / 255.255.252.0
eth0:221 with IP address 10.1.1.221 / 255.255.252.0
tagged VLAN:
eth1.220 with ip address 192.168.0.1/24
eth1.221 with ip address 192.168.0.1/24
I understand that the following lines with provide the NAT translation:
iptables -t nat -A PREROUTING -i eth0:220 -d 10.1.1.220 -j DNAT --to-destination 192.168.0.23/24
iptables -t nat -A PREROUTING -i eth0:221 -d 10.1.1.221 -j DNAT --to-destination 192.168.0.23/24
But how do I specify which interface the packets to go out on?
eth0:220 needs to leave eth1.220 in order for the packets to become tagged with the correct VLANID.
using -o eth1.220 is not allowed with PREROUTING
does anything need to be done for traffic from eth1.220 to the gateway at 10.1.0.1?
Adding some more information: The idea is that a tester will be connected to the 10.1.0.0/22 network and when they enter in 10.1.1.220 in the webbrowser the website at IP address 192.168.0.23 on VLAN220 will be displayed. This will allow them to change the device under test (DTU) without having to change the default IP address of the DTU. There will about 200 of these VLANs.