0

On my server (FreeBSD 9.2-RELEASE) I have several aliased IP addresses from one subnet:

192.168.0.1/24
192.168.0.2
192.168.0.3

And I am wondering how to correctly detect to wich particular IP a client is connecting to (the remote host IP - src-ip - is known)?

The main problem is that a client can already be connected to one IP and I want to know whether it is connecting to another IP-address.

The final goal is to accept or deny a connection based on the username (it is known) and dst-ip of client.

halt
  • 106
  • 7
  • 1
    What application? What language? – Michael Hampton Dec 10 '15 at 14:08
  • For TCP use `getsockname`. For UDP don't bind to `::` but instead create multiple UDP sockets and bind one to each local IP address. – kasperd Dec 10 '15 at 14:24
  • Application is Dante (proxy server). I am not really sure what you mean "what language"? I think it have to be _a shell command_ to find out known src-ip (client) is connecting to what dst-ip (server) right now. – halt Dec 10 '15 at 15:05

0 Answers0