I'm trying to setup Network Policy for kubernetes, and more general question, that I have can be found here.

For the purpose of this particular question, this is the line I'm getting in nginx logs: - - [18/Mar/2020:19:47:16 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.69.1-DEV" ""

Note the $remote_addr that nginx sees, it's But this is not a real IP address!

I read this question and it appears, that sometimes addresses like that can be valid, but this is not standard.

For the purpose of this question, the CNI plugin that manages is Calico.

For what it worth, if I try to white-list in the NetworkPolicy object, the requests such as above stop coming through, which once again confirms to me that this is not the real IP. But if I white-list they come through no problem.

What makes nginx think, that the request is coming from this x.y.0.0 address? How do I emulate it, say with curl?

  • Maybe it sees that, because that is what is coming in. Probably would be more useful to look at tcpdump output to see if you can trace things down. – Zoredache Mar 18 at 20:18
  • @Zoredache can you explain it more? I understand this is a TCP connection, do you mean that this is the source address in the TCP packet? If it is then the response packets should be sent back to too, but there is nothing there? – Andrew Savinykh Mar 18 at 20:23
  • tcpdump is not a bad idea but it would take me awhile to figure out how to run it in a nginx container inside kubernetes.... – Andrew Savinykh Mar 18 at 20:23
  • 1
    Start a netshoot container, in the same network namespace. - github.com/nicolaka/netshoot That you mention kubernetes makes me wonder if that is some address related to some kind of service mesh/proxy or something. – Zoredache Mar 18 at 21:05
1 is a completely valid IP address - in any subnet with the prefix or shorter, or in the point-to-point subnet.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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