[App_rpt-users] Multiple servers and local connections

Doug Crompton doug at crompton.com
Mon Feb 9 19:31:58 UTC 2015


I decided to write something up on this since so many more people are putting multiple servers on LAN's and I get these questions all the time. This is a first cut so let me know if anything needs correction or clarification. I will be putting it out as a howto on the hamvoip site.


Considerations when using more than one Allstar server on a LAN

When you have more than one server on the same private LAN and you want to connect them locally or connect into them from the outside there are some special considerations. Allstar uses a database that is constantly updated with the public IP addresses and ports of all other active nodes on the network including your own. So if you have two (or more) local nodes on different computers and they try to connect to each other they will not be able to. Most routers do not know how to handle their own public IP from within the LAN, so you have to enter the local IP address and port information in the nodes section of each servers rpt.conf file. Here is an example of how to do it:

First you need to go to allstarlink.org and put each server on a different port. The default iax port is 4569 and when you define a server that is what is assigned. If you have two servers you need to pick one and change the port, say to 4568. You do this in the network tab of the server configuration at allstarlink.org. Only change the port, do not change or add any IP addresses. If you have more than two servers just keep assigning new port numbers for each.

Locally the servers port is assigned in /etc/asterisk/iax.conf -

[general]
bindport=4569     <<<<  change this to the same port that you assigned for this server at allstarlink.org

Do this for each server.

Then you need to add entries in /etc/asterisk/rpt.conf. Here is an example for two servers:

If you had two nodes, each on a different server and server1 with node 40000 had an IP address of 192.168.1.101 and port of 4569 and server2 with node 40001 had an IP address of 192.168.0.100 with a port of 4568 then you would put the following in nodes section of your rpt.conf file:  

[nodes]
; Note, if you are using automatic update for allstar link nodes,
; no allstar link nodes should be defined here. Only place a definition
; for your local nodes, and private (off of allstar link) nodes here.

40000 = radio at 127.0.0.1/40000,NONE
40001 = radio at 192.168.1.100:4568/40001,NONE    <<<< IP and port of other local server

On the other server it would be just reversed with the other nodes IP address and port. 4569 is default and would not need to be entered but shown here for clarity.

[nodes]
; Note, if you are using automatic update for allstar link nodes,
; no allstar link nodes should be defined here. Only place a definition
; for your local nodes, and private (off of allstar link) nodes here.

40001 = radio at 127.0.0.1/40001,NONE
40000 = radio at 192.168.1.101:4569/40000,NONE    <<<< IP and port of other local server

In addition to doing this if you want outside connectibility to your nodes you need to open ports in your router. In this example you would add port 4569 udp to IP address 192.168.0.101 and another entry for port 4568 udp to IP address 192.168.0.100

Also if you want outside ssh access there are two things you can do. If you want direct public ssh access to both servers then you would need to change one servers ssh port since they would both be on port 222. You do this in /etc/ssh/sshd_config on the BBB or in /etc/sshd_config on Centos. Change the port number and remember what it is as you will have to use this port to log into this server in the future. One could stay at 222 and the other might be 223. You would then add both entries to your routers port forwarding. If server1 was port 222 and server2 was 223 then add port 222 tcp 192.168.0.101 and port 223 tcp 192.168.0.100 entries to your router.

Another option would be to leave them both at port 222 and then you can log into which ever one is port forwarded. You would only forward one server in your router. Lets say port 222 was routed to 192.168.0.101, server1. When you ssh from the outside to your public IP address at port 222 it would go to that server. But you really want to get to server2. So once you log into server1 you simply type -  ssh root at 192.168.0.100 -p 222  - Now you get the server2 login, enter your password and you are connected there.

If you only want LAN ssh access not public then you can just connect by local IP address. No port change and no router entries are necessary. 

If you are using lsnodes or Allmon and you want public access to multiple servers behind a LAN you will need to change the web server ports on the 2nd and subsequent servers and forward them appropriately in your router. The default is port 80 but this could be changed to some more obscure series of ports of your choosing. Again if you just want local access no changes are necessary, just use the servers local IP address.

Always restart Asterisk whenever you make these changes.
73 Doug
WA3DSP
http://www.crompton.com/hamradio
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.keekles.org/pipermail/app_rpt-users/attachments/20150209/1f5136da/attachment.html>


More information about the App_rpt-users mailing list