I have the following setup:
Box A
eth0 - 192.168.1.101
eth1 - 10.10.2.1
Box B
eth0 - 10.10.2.2
Box A has internet access through eth0. I want Box B to be visible on the 192.168.1.0/24 network, so I can ssh to it directly from another box, but Box A must also be available.
I thought about creating a virtual ip to eth0 on Box A and then forward all traffic to Box B with
ifconfig eth0:0 192.168.1.102
iptables -t nat -A PREROUTING -i eth0:0 -j DNAT --to-destination 10.10.2.2
but that doesn't seem to work.
Also ip forwarding is enabled and Box B has internet access with
iptables -t nat -A POSTROUTING -j MASQUERADE