Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

Output

share|improve this question

3 Answers 3

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:

modprobe dummy
ifconfig dummy0 192.240.240.2
ifconfig dummy0:1 192.240.240.3

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.

share|improve this answer
    
I'm not going to need any outside computer interaction. I'm trying to simulate a network inside my computer, with one program in one virtual iface and another in other viface and manage routing between them. I've managed to do everything except for the kernel special treatment to local ifaces. –  Arkaitz Jimenez Sep 18 '09 at 12:43
    
Your best bet will be to use virtual machines, using for example VMware Server. There's a lot more overhead, but then it's possible to have a virtual network between the host system and one or more guest OSs. With VMware Server, the 'host only networking' setting makes a simulated network that's contained within the host system. –  Heath Sep 18 '09 at 15:19

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.