Problem to register a trunk whit backup conection

Good morning, I have an asterisk switchboard behind a firewall that balances connectivity through a main ip or a backup ip. Everything works correctly but when the main line goes down and goes through the backup, it does not register the trunk.

For some reason it sends the main ip in the headers and not the backup one, so it cannot complete the connection…

In which part of the configuration can I establish the connection ip or what do I have to modify for the configuration that I have established to work for me?