We have kafka behind NAT with *only one broker*. Let say we have internal (A) and external (B) network.
When we try to reach the broker from external network (we use bootstrap.servers parameter set to B address) then what is obvious the broker responds with internal network's address (A) which is not resolvable in external network. We cannot set advertised.listeners to external network's address because the broker is also used from internal network. Only solution I am aware is to set name instead of IP in advertised.listeners parameter and use DNS or HOSTS file in internal and external network. Unfortunatelly we cannot use this solution. Is there any other way - beside kafka code change - to make the broker to handle requests from internal and external networks. In other words - is there any way to connect directly to the broker which address we provided to the client? I hope that somebody dealt with simillar problem. Thanks for any help.