2 servers setup

Guys,
I got a question.
If ever I setup 2 servers which the first will serve as my voip gateway
and the other server will register to the first server for outbound call.
How do I configure it? Do I have to use SIP or IAX?
I can easily setup the new server as separate. But the reason why i'm doing
this is sometimes I can't connect (UNREACHABLE) to my VOIP provider
directly using my other Public IP which is used by my 2nd server. So instead
I will use my existing server as VOIP GATEWAY (it uses a different public ip).
I hope this make sense.. LOL
I got a question.
If ever I setup 2 servers which the first will serve as my voip gateway
and the other server will register to the first server for outbound call.
How do I configure it? Do I have to use SIP or IAX?
I can easily setup the new server as separate. But the reason why i'm doing
this is sometimes I can't connect (UNREACHABLE) to my VOIP provider
directly using my other Public IP which is used by my 2nd server. So instead
I will use my existing server as VOIP GATEWAY (it uses a different public ip).
I hope this make sense.. LOL