I need to access externally (via Internet) one device in internal network which has no default gateway configured. Just IP and Mask.
The standard iptable rule to accomplish the first part of this access is quite common:
iptables -t nat -A PREROUTING -i $PUBLIC_ETH -p tcp --dport $EXTERNAL_PORT -d $PUBLIC_IP -m conntrack --ctstate NEW -j DNAT --to-destination $INTERNAL_DEVICE:$INTERNAL_PORT
But as the device doesn't have default gateway, the response to SYN (ie, SYN/ACK) don't come back to Internet. What I need is a rule to make this connection appears to come from $INTERNAL_ETH IP address instead of the public IP of originating requester.
Which second rule I need to accomplish this ?