We have designed a device to be used as one device, but using ethernet ipv4 inside to communicate with internal not linux-based ipv4-speaking peripherals, juste like what we could do using pci or usb, for example. Now comes the problem that the external network interface must be able to accept any ipv4 address. How should we attribute ip addresses to the internal interface and peripherals ? There is one process that must be able to communicate with both the internal peripherals and the external world, thus speaking to both networks.
We already tried to bind the socket to our peripherals to a specific interface using SO_BINDTODEVICE, while using the 169.254.0.0 range for the internal peripherals, but as soon as our external interface also has an address in that range (with the zeroconf protocol), we do not receive the packets from our peripherals anymore.
I have already thought of alternative methods, using linux network namespaces or restricting the address range of the loopback interface to be able to use a part of the 127.0.0.0 network for our internal peripherals, but I am puzzled. Are there any pitfall with those methods, that we have not tried yet.