Forum Discussion

2 Replies

  • If you are not using SNAT/NAT, you should be able to see the source IP. Assuming that you do have SNAT/NAT, I don't think is possible.

     

    We can do with HTTP, because we can use custom headers. However, I don't think there is any mechanism to do that with TCP or UDP. UDP does not have any extra field, TCP does have an option field but does not look like you can use this for source ip information.

     

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus

    You can indeed use TCP option headers to add the source IP if you're doing SNAT. There's an example in the TCP options documentation page. Sometimes called option 28 stuffing...

     

    However UDP you're pretty much out of luck. There's nowhere really to stuff the info with UDP. Unless you're app is flexible enough for you to add it as the first 4 bytes of the datagram and shift everything along... That would require a bit of work though, and an assumption that the original datagram was also at least 4 Bytes less than the max...