[Click] KernelTun usage

Mike Miller michael.g.miller at gmail.com
Wed Mar 2 19:48:38 EST 2011


I'm trying to route packets to another user-level process on my system using
KernelTun:

tun::KernelTun(1.0.0.1/8);
tun[0] -> Print("Shouldn't get packets") -> Discard;
tun[1] -> Print("Error!") -> Discard;

udpSocket -> { Some processing junk which creates a UDP packet destined for
1.0.0.1 } -> tun;

I have the user-level process listen via a UDP socket bound explicitly to
1.0.0.1 and interface tun0(I've verified my program fails to start if click
isn't running to create the tun0 interface).

However, the packets never arrive at my program! `sudo tcpdump -i tun0`
shows that packets destined for 1.0.0.1 are getting to the tun0 interface,
but they are not appearing at my program. Does click(or tun or linux)
somehow hijack sent packets to 1.0.0.1 so that other user-level processes
can't receive them? If so, what's the best solution here?

Thanks!
Mike


More information about the click mailing list