0

there is my network schema

enter image description here

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

3
  • You do know that pretty all IP protocols, especially TCP (ACK packets), require a two-way communication? Your "diode" will cause all kinds of trouble.
    – dirkt
    Feb 22, 2017 at 14:43
  • Thanks for your response. Yes, I know. But "diode" is very importent here for me. This schema is very small part of highly complex network and now I am looking for possibilities. Purpose of "diode" is that nothing must not go through from RED2 to BLUE2.
    – user557323
    Feb 23, 2017 at 6:56
  • Normally you'd use a firewall for this, not any kind of "diode". As you discovered, ARP packets need two-way communication, too. You can't do any normal networking with that setup. You can try to send custom ethernet packets, but that's about all, and you'll have to invent your own protocol stack.
    – dirkt
    Feb 23, 2017 at 20:09

0

You must log in to answer this question.

Browse other questions tagged .