How to setup a SIP trunk between 2 local Asterisk servers (same LAN, no NAT, no firewalls)


Simple question.
Can anyone please give me a “Hello World” example of setting up a SIP trunk in FreePBX between 2 Asterisk servers on the same network (LAN, no NAT, no firewalls)?

I tried this:

Add SIP trunk:
name: interboxsip
PEER details:

Did the same on the other server (just replaced host IP address).

sip show users and sip show peers seem ok on both systems.

However, when I place a call via SIP from one server to the other and I enable SIP debugging in Asterisk, the “receiving” end complains about:

SIP/2.0 407 Proxy Authentication Required

(but I never setup authentication for this peer; I want to Keep It Simple for now)

What am I missing?

You can try the friends SIP trunk, it’s just as easy. The main difference is that friends authorizes on the IP address while user/peer authorizes on the user/password. Interesting about the CallerID. I wonder if you could add callerid= into the trunk config.

accept anonymous SIP connections

There’s two ways of doing it, one using SIP user/peer trunking and the other using SIP friend trunking. In either case, download the excel spreadsheet: SIP trunk configuration tool, fill in the green section that pertains to your network. The spreadsheet will create the proper configuration for both PBXs that you fill in the FreePBX.

I actually tried the “friends” type, not the user/peer config.
In any case, “fromuser” is necessary otherwise I get an authorization error. It does not work simply with IP addresses even with “friends”.

Someone suggested that it may be because my SIP user names (for authentication) are the same as my extension numbers. I don’t know if this may be true but I’ll try it out on Monday.

I will also try specifying callerid= into the trunk config.

Just one more question…
If I place a call through a friend SIP trunk, I’m not receiving a caller id. The sending end is setting it (am also using “intracompany” route). The receiving end has a blank string/number for caller name / number.

[EDIT]: I think my problem is with “fromuser”.

However, if I remove “fromuser” my trunk doesn’t work.

Thanks, Eugene, your link proved to be very clear, straightforward and complete. Seems that the only thing I was missing was the “fromuser=” option… Works great now.



I had run into this very same issue and found the above post. As soon as I added these to my two peers, the CID started coming through as desired. FYI and FWIW!


Thanks Eugene. I had been struggling with the two frepbx boxes for a long time. I was using IAX2 trunks since I read that they were much simpler to use, but kept getting “All circuits are busy now” message.
With this SIP configuration it went on in a flash and work flaelessly, so far.
Another question. I now have the two boxes in the same LAN, what would you recomend if I need to connect two boxes through Internet ?