there is my network schema
between RED2 and BLUE2 is something like "diode". It is HW, which allows me to communicate only to one direction - from BLUE2 to RED2. I would like to send data from BLUE1 to RED1.
Linux (opensuse leap) is installed on all PCs.
There is my first working solution
BLUE2:
sysctl -w net.ipv4.ip_forward=1
arp -s 4.4.4.2 A:B:C:D:E:F
iptables -t nat -A PREROUTING -d 1.1.1.1 -j DNAT --to-destination 4.4.4.2
(A:B:C:D:E:F is MAC address of RED1)
(static arp entry is necessary, because arp request is not working because diode)
RED1:
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -d 4.4.4.2 -j DNAT --to-destination 2.2.2.2
ip r a default via 4.4.4.1 (or ip r a default dev eth0)
All this is ok and it is working. But I need some solution without static arp entry.
My first idea was use broadcast. But broadcast is not allow to route - so not usable.
Second idea - multicast. But iptables do not allow translate unicast address to multicast address. I found this, tried set up on BLUE2 like example, but not working.
Anybody have any idea? Thanks