Current setup:
br0|
|-- tun10 -pipe-tun0(192.240.240.1)
|-- tun11 -pipe-tun1(192.240.240.2)
|-- tun12 -pipe-tun2(192.240.240.3)
The pipe program is a custom program that forwards data back2back between two tun interfaces.
The idea is puting 2 programs in .2 and .3 while keeping .1 as the local interface in the current machine. The main problem is that I want to route packets to .2 and to .3 through .1 and br0, but as they are local interfaces, the kernel ignores any routing instruction, it just delivers the packet to the proper interface.
Tried iptables, but the nat table doesn't even see ping packets to those ifaces. A "ping 192.240.240.2" delivers a icmp packet with source and dest .2 to tun1, ideally it should deliver a source .1 dest .2 at tun1 through tun0-br0-tun1
Any hint?
Here the output of some commands:
So you want to have programs using different IP addresses than the 'main' IP address of the system, but these programs are actually running on this system? Do you want other computers external to your box to be able to access your programs directly?
I'm pretty sure your tun/pipe/tun arrangement isn't going to get you there. I don't understand why you want the packets to appear to route through one virtual IP address to another.
Instead of all those tun or tap interfaces, you could create a dummy interface:
Now, software can bind tcp or udp ports to either of those IP addresses. Other computers will need a route (pointing at the address of eth0) to reach those IP addresses.
But why tap10/11/12 hasn't pre configured ip-addresses? When you will assign ip-addresses to interfaces, then you will be able to ping them.
Checkout http://borg.uu3.net/linux-mpath/#loop