raw sockets and iptables and route: she's not leaving

Discussion in 'Linux Networking' started by Charles T. Smith, Jun 27, 2014.

  1. Hi.

    I'm working the end of an ip tunnel and trying to set packets free into
    the internet with:

    socket(AF_INET, SOCK_RAW, htons(ETH_P_ALL))

    I can see the pkts traverse my tunnel, enter my application and are sent
    on this socket. But wireshark doesn't see anything, and I can't coax
    iptables to log anything that I can understand.

    Question: do I have to bind(2) the socket to an outgoing interface or is
    that only for reception and the kernel works out, based on the
    destination address what i/f to put it on?

    If that's the case, how does that work with routing?

    If I have a route to my destination, starting from the tunnel, the app
    writes to the tunnel, the data goes through it and ends up at my gateway
    which then tries to eject it. At the far end of the tunnel, does it
    consult the routing tables again? What if I have another route to that
    same destination?
     
    Charles T. Smith, Jun 27, 2014
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.