<div>A few points.</div>
<div> </div>
<div>Firstly, If you are going to run 2 different instances on the same server, they should have different ports (e.g. 5060 for the 1st instance and 5062 for 2nd).<br> </div>
<div>Secondly, if you are trying to resolve 2 different Local IPs to the same server (in your case <a href="http://192.168.1.112">192.168.1.112</a> and <a href="http://192.168.1.113">192.168.1.113</a>), one of any of these should happen:
</div>
<div>1. you should either have 2 network card interfaces in your server, or </div>
<div>2. Linux does this thing where it is able to split a single (physical) NIC interface into seperate virtual interfaces (e.g. for a single interface <strong>eth0</strong> splits it into <strong>eth0:<font color="#ff0000">
0</font></strong> for the 1st virtual interface and <strong>eth0:<font color="#3333ff">1</font></strong> for the 2nd, etc). The process is called <strong>IP aliasing</strong>. You should then allocate the 2 local IPs to the 2 virtual interfaces like so:
</div>
<div> eth0:0 -> <a href="http://192.168.1.112">192.168.1.112</a>, and</div>
<div> eth0:1 -> <a href="http://192.168.1.113">192.168.1.113</a></div>
<div> </div>
<div>commands are something like this:</div>
<div> </div>
<div> ifconfig eth0 <i>XXX.XXX.XXX.XXX</i> netmask <a href="http://255.255.255.0">255.255.255.0</a> broadcast <i>XXX.XXX.XXX</i>.255<br> ifconfig eth0:0 <a href="http://192.168.1.112">192.168.1.112</a> netmask
<a href="http://255.255.255.0">255.255.255.0</a> broadcast <a href="http://192.168.1.255">192.168.1.255</a><br> ifconfig eth0:1 <a href="http://192.168.1.113">192.168.1.113</a> netmask <a href="http://255.255.255.0">
255.255.255.0</a> broadcast <a href="http://192.168.1.255">192.168.1.255</a><br><br> route add -host <i>XXX.XXX.XXX.XXX</i> dev eth0<br> route add -host <a href="http://192.168.1.112">192.168.1.112</a> dev eth0<br> route add -host
<a href="http://192.168.1.113">192.168.1.113</a> dev eth0<br> route add default gw <Gateway IP></div>
<div> </div>
<div>where <em>XXX.XXX.XXX.XXX</em> in the 1st instance refers to another local IP e.g. <a href="http://192.168.1.3">192.168.1.3</a>.</div>
<div>(I am no Linux guru so maybe the gurus here could pipe in). :)</div>
<div> </div>
<div>Method 1 is probably the simpler and more straight-forward, but if you can't afford 2 NICs I don't think Method 2 will be too difficult either.</div>
<div> </div>
<div> </div>
<div>Simply putting the entries in etc/hosts is not enough as the server needs to be able to identify them as 2 separate instances. This is why you are getting that error - it's because only one interface was identified and that has already been "bound" to the first Local IP (
<a href="http://192.168.1.112">192.168.1.112</a>).</div>
<div> </div>
<div>Also, if I understand your <em>ifconfig</em> output correctly, then this is not setup correctly. You seem to be mixing private and public IP addresses. If you are going through a router or NATed environement you don't need to assign the external interfaces to the NIC(s), nor do you specifically need to define them in your
openser.cfgs (i.e. listen=external IP). You only need this if you are in a non-NATed environment, so it's a case of either or.</div>
<div> </div>
<div>Hope that made sense.</div>
<div><br> </div>
<div> </div>
<div><span class="gmail_quote">On 05/01/07, <b class="gmail_sendername">Gerardo Amaya</b> <<a href="mailto:openser@gerardoamaya.com">openser@gerardoamaya.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hello All. I'm trying to install 2 Instances of openser on the same<br>machine with the following interfaces:
<br><br>Instance #1 -----> <a href="http://172.16.18.2">172.16.18.2</a> and <a href="http://192.168.1.112">192.168.1.112</a><br>Instance #2 -----> <a href="http://172.16.1.2">172.16.1.2</a> and <a href="http://192.168.1.113">
192.168.1.113</a><br><br>I made one installation on the default OpenSER folders and one in the<br>/usr/loca/openser_1/<br><br>The configuration went quite smooth. The first instance of the server is<br>running with no problem at all, but when I try to start the second
<br>instance I got an error that it was unable to resolve the IP addresses I<br>add the following lines to the /etc/hosts file:<br><br>### OpenSER 1st interface configuration ####<br><a href="http://192.168.1.112">192.168.1.112
</a> openser1_internal<br><a href="http://172.16.18.2">172.16.18.2</a> openser1_external<br>### OpenSER 1st Interface configuration ####<br><br>### OpenSER 2nd Interface configuration ####<br><a href="http://192.168.1.113">
192.168.1.113</a> openser1_internal<br><a href="http://172.16.1.2">172.16.1.2</a> openser1_external<br>### OpenSER 2nd Interface configuration ####<br><br><br>After that Now I have the following error:<br><br>Jan 5 17:26:30 atel-router ./openser[17772]: ERROR: tcp_init: bind(7,
<br>0x813e194, 16) on <a href="http://192.168.1.112:5060">192.168.1.112:5060</a> : Address already in use<br><br><br>Any Help will be appreciated, of better is there a How-to on OpenSER<br>multiple instances please let me know.
<br><br>Thanks in advance<br><br>Gerardo Amaya<br><br>Here is the configuration file for each instance:<br><br>OpenSER.cfg Instance #1<br><br>#<br># $Id: ser.cfg,v <a href="http://1.25.2.1">1.25.2.1</a> 2005/02/18 14:30:44 andrei Exp $
<br>#<br># simple quick-start config script<br>#<br><br># ----------- global configuration parameters ------------------------<br><br>debug=5 # debug level (cmd line: -dddddddddd)<br>fork=yes<br>log_stderror=no # (cmd line: -E)
<br><br>/* Uncomment these lines to enter debugging mode<br>#fork=no<br>#log_stderror=yes<br>*/<br><br>check_via=no # (cmd. line: -v)<br>dns=no # (cmd. line: -r)<br>rev_dns=no # (cmd. line: -R)<br>listen=
<a href="http://192.168.1.112">192.168.1.112</a><br>listen=<a href="http://172.16.18.2">172.16.18.2</a><br>port=5060<br>mhomed=1<br>children=4<br>fifo="/tmp/ser_fifo"<br><br># ------------------ module loading ----------------------------------
<br><br># Uncomment this if you want to use SQL database<br>loadmodule "/usr/local/lib/openser/modules/mysql.so"<br><br>loadmodule "/usr/local/lib/openser/modules/sl.so"<br>loadmodule "/usr/local/lib/openser/modules/tm.so"
<br>loadmodule "/usr/local/lib/openser/modules/rr.so"<br>loadmodule "/usr/local/lib/openser/modules/maxfwd.so"<br>loadmodule "/usr/local/lib/openser/modules/usrloc.so"<br>loadmodule "/usr/local/lib/openser/modules/registrar.so"
<br>loadmodule "/usr/local/lib/openser/modules/textops.so"<br>loadmodule "/usr/local/lib/openser/modules/uri.so"<br>loadmodule "/usr/local/lib/openser/modules/uri_db.so"<br>loadmodule "/usr/local/lib/openser/modules/domain.so"
<br>loadmodule "/usr/local/lib/openser/modules/mediaproxy.so"<br>loadmodule "/usr/local/lib/openser/modules/nathelper.so"<br><br># Uncomment this if you want digest authentication<br># mysql.so must be loaded !
<br>loadmodule "/usr/local/lib/openser/modules/auth.so"<br>loadmodule "/usr/local/lib/openser/modules/auth_db.so"<br><br># ----------------- setting module-specific parameters ---------------<br><br># -- usrloc params --
<br><br>#modparam("usrloc", "db_mode", 0)<br><br># Uncomment this if you want to use SQL database<br># for persistent storage and comment the previous line<br>modparam("usrloc", "db_mode", 2)
<br><br># -- auth params --<br># Uncomment if you are using auth module<br>#<br>#modparam("auth_db", "calculate_ha1", yes)<br>#<br># If you set "calculate_ha1" parameter to yes (which true in this config),
<br># uncomment also the following parameter)<br>#<br>#modparam("auth_db", "password_column", "password")<br><br># -- rr params --<br># add value to ;lr param to make some broken UAs happy<br>
modparam("rr", "enable_full_lr", 1)<br><br># -- nathelper and mediaproxy params --<br>modparam("nathelper", "natping_interval", 30)<br>modparam("nathelper", "ping_nated_only", 1)
<br>modparam("nathelper", "rtpproxy_sock", "unix:/var/run/rtpproxy.sock")<br># -- End of nathelper and mediaproxy params --<br><br># -- auth_db database params for domain.so module to work properly --
<br><br>modparam("auth_db|domain|uri_db|usrloc","db_url","mysql://root:codevoz@localhost/openser")<br>modparam("auth_db", "calculate_ha1", 1)<br>modparam("auth_db", "password_column", "password")
<br># -- End of database params --<br><br><br># ------------------------- request routing logic -------------------<br><br># main routing logic<br><br>route{<br><br> # initial sanity checks -- messages with<br> # max_forwards==0, or excessively long requests
<br> if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483","Too Many Hops");<br> return;<br> };<br> if (msg:len >= 2048 ) {<br> sl_send_reply("513", "Message too big");
<br> return;<br> };<br><br><br> if (method == "REGISTER" || ! search("^Record-Route:")) {<br><br> fix_nated_contact(); # Rewrite contact with source IP of<br>signalling
<br> #if (method == "INVITE") {<br> # fix_nated_sdp("1"); # Add direction=active to SDP<br> #};<br><br> force_rport(); # Add rport parameter to topmost Via<br><br> }
<br><br><br> if (method == "INVITE") {<br> if (dst_ip == <a href="http://192.168.1.112">192.168.1.112</a>){<br> if (force_rtp_proxy("FAII"))<br> t_on_reply("1");
<br> } else if (dst_ip == <a href="http://172.16.18.2">172.16.18.2</a>){<br> if (force_rtp_proxy("FAEI"))<br> t_on_reply("1");<br> } else if (dst_ip == <a href="http://192.168.1.112">
192.168.1.112</a>){<br> if (force_rtp_proxy("FAIE"))<br> t_on_reply("1");<br> } else if (dst_ip == <a href="http://172.16.18.2">172.16.18.2</a>){<br> if (force_rtp_proxy("FAEE"))
<br> t_on_reply("1");<br> }<br> };<br> # Record-route all messages -- to make sure that<br> # subsequent messages will go through our proxy; that's<br> # particularly good if upstream and downstream entities
<br> # use different transport protocol<br><br> # This is the Call Tear Down Section<br> if (method=="BYE" || method=="CANCEL") {<br> unforce_rtp_proxy();<br> };<br><br>
route(1);<br>}<br><br>route[1] {<br><br> t_on_reply("1");<br><br> #force_rtp_proxy();<br> t_relay("udp:<a href="http://192.168.1.2:5060">192.168.1.2:5060</a>");<br><br><br>}<br>
<br>onreply_route[1] {<br><br> if (!search("^Content-Length:[ ]*0")) {<br> force_rtp_proxy();<br> };<br><br> if (nat_uac_test("1")) {<br> fix_nated_contact();
<br> };<br>}<br><br><br>OpenSER.cfg Instance #2<br>#<br># $Id: ser.cfg,v <a href="http://1.25.2.1">1.25.2.1</a> 2005/02/18 14:30:44 andrei Exp $<br>#<br># simple quick-start config script<br>#<br><br># ----------- global configuration parameters ------------------------
<br><br>debug=5 # debug level (cmd line: -dddddddddd)<br>fork=yes<br>log_stderror=no # (cmd line: -E)<br><br>/* Uncomment these lines to enter debugging mode<br>#fork=no<br>#log_stderror=yes<br>*/<br><br>check_via=no # (cmd. line: -v)
<br>dns=no # (cmd. line: -r)<br>rev_dns=no # (cmd. line: -R)<br>listen=udp:<a href="http://192.168.1.113:5060">192.168.1.113:5060</a><br>listen=udp:<a href="http://172.16.1.2:5060">172.16.1.2:5060</a><br>#port=5060
<br>mhomed=1<br>children=4<br>fifo="/tmp/ser_fifo2"<br><br># ------------------ module loading ----------------------------------<br><br># Uncomment this if you want to use SQL database<br>loadmodule "/usr/local/lib/openser/modules/mysql.so"
<br><br>loadmodule "/usr/local/openser_1/lib/openser/modules/sl.so"<br>loadmodule "/usr/local/openser_1/lib/openser/modules/tm.so"<br>loadmodule "/usr/local/openser_1/lib/openser/modules/rr.so"
<br>loadmodule "/usr/local/openser_1/lib/openser/modules/maxfwd.so"<br>loadmodule "/usr/local/openser_1/lib/openser/modules/usrloc.so"<br>loadmodule "/usr/local/openser_1/lib/openser/modules/registrar.so"
<br>loadmodule "/usr/local/openser_1/lib/openser/modules/textops.so"<br>loadmodule "/usr/local/openser_1/lib/openser/modules/uri.so"loadmodule<br>"/usr/local/openser_1/lib/openser/modules/nathelper.so"
<br><br># Uncomment this if you want digest authentication<br># mysql.so must be loaded !<br>loadmodule "/usr/local/openser_1/lib/openser/modules/auth.so"<br>loadmodule "/usr/local/openser_1/lib/openser/modules/auth_db.so"
<br><br># ----------------- setting module-specific parameters ---------------<br><br># -- usrloc params --<br><br>#modparam("usrloc", "db_mode", 0)<br><br># Uncomment this if you want to use SQL database
<br># for persistent storage and comment the previous line<br>modparam("usrloc", "db_mode", 2)<br><br># -- auth params --<br># Uncomment if you are using auth module<br>#<br>#modparam("auth_db", "calculate_ha1", yes)
<br>#<br># If you set "calculate_ha1" parameter to yes (which true in this config),<br># uncomment also the following parameter)<br>#<br>#modparam("auth_db", "password_column", "password")
<br><br># -- rr params --<br># add value to ;lr param to make some broken UAs happy<br>modparam("rr", "enable_full_lr", 1)<br><br># -- nathelper and mediaproxy params --<br>modparam("nathelper", "natping_interval", 30)
<br>modparam("nathelper", "ping_nated_only", 1)<br>modparam("nathelper", "rtpproxy_sock", "unix:/var/run/rtpproxy_1.sock")<br># -- End of nathelper and mediaproxy params --
<br><br># -- auth_db database params for domain.so module to work properly --<br><br>modparam("auth_db|domain|uri_db|usrloc","db_url","mysql://root:codevoz@localhost/openser")<br>modparam("auth_db", "calculate_ha1", 1)
<br>modparam("auth_db", "password_column", "password")<br># -- End of database params --<br><br><br># ------------------------- request routing logic -------------------<br><br># main routing logic
<br><br>route{<br><br> # initial sanity checks -- messages with<br> # max_forwards==0, or excessively long requests<br> if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483","Too Many Hops");
<br> return;<br> };<br> if (msg:len >= 2048 ) {<br> sl_send_reply("513", "Message too big");<br> return;<br> };<br><br><br> if (method == "REGISTER" || ! search("^Record-Route:")) {
<br><br> fix_nated_contact(); # Rewrite contact with source IP of<br>signalling<br> #if (method == "INVITE") {<br> # fix_nated_sdp("1"); # Add direction=active to SDP<br> #};
<br><br> force_rport(); # Add rport parameter to topmost Via<br><br> }<br><br><br> if (method == "INVITE") {<br> if (dst_ip == <a href="http://192.168.1.113">192.168.1.113</a>){<br>
if (force_rtp_proxy("FAII"))<br> t_on_reply("1");<br> } else if (dst_ip == <a href="http://172.16.1.2">172.16.1.2</a>){<br> if (force_rtp_proxy("FAEI"))
<br> t_on_reply("1");<br> } else if (dst_ip == <a href="http://192.168.1.113">192.168.1.113</a>){<br> if (force_rtp_proxy("FAIE"))<br> t_on_reply("1");
<br> t_on_reply("1");<br> } else if (dst_ip == <a href="http://192.168.1.113">192.168.1.113</a>){<br> if (force_rtp_proxy("FAIE"))<br> t_on_reply("1");
<br> } else if (dst_ip == <a href="http://172.16.1.2">172.16.1.2</a>){<br> if (force_rtp_proxy("FAEE"))<br> t_on_reply("1");<br> }<br> };<br> # Record-route all messages -- to make sure that
<br> # subsequent messages will go through our proxy; that's<br> # particularly good if upstream and downstream entities<br> # use different transport protocol<br><br> # This is the Call Tear Down Section
<br> if (method=="BYE" || method=="CANCEL") {<br> unforce_rtp_proxy();<br> };<br><br> route(1);<br>}<br><br>route[1] {<br><br> t_on_reply("1");<br><br> #force_rtp_proxy();
<br> t_relay("udp:<a href="http://192.168.1.2:5060">192.168.1.2:5060</a>");<br><br><br>}<br><br>onreply_route[1] {<br><br> if (!search("^Content-Length:[ ]*0")) {<br> force_rtp_proxy();
<br> };<br><br> if (nat_uac_test("1")) {<br> fix_nated_contact();<br> };<br>}<br><br>loadmodule "/usr/local/openser_1/lib/openser/modules/uri_db.so"<br>loadmodule "/usr/local/openser_1/lib/openser/modules/domain.so"
<br>loadmodule "/usr/local/openser_1/lib/openser/modules/mediaproxy.so"<br><br><br><br><br><br>ifconfig output<br><br>eth0 Link encap:Ethernet HWaddr 00:0E:2E:0A:61:68<br> inet addr:<a href="http://172.16.18.2">
172.16.18.2</a> Bcast:<a href="http://172.16.18.255">172.16.18.255</a> Mask:<a href="http://255.255.255.0">255.255.255.0</a><br> inet6 addr: fe80::20e:2eff:fe0a:6168/64 Scope:Link<br> UP BROADCAST MULTICAST MTU:1500 Metric:1
<br> RX packets:216465 errors:0 dropped:0 overruns:0 frame:0<br> TX packets:323925 errors:0 dropped:0 overruns:0 carrier:0<br> collisions:0 txqueuelen:1000<br> RX bytes:18190685 (17.3 MiB) TX bytes:118579358 (
113.0 MiB)<br> Interrupt:185 Base address:0xaf00<br><br>eth1 Link encap:Ethernet HWaddr 00:0E:2E:06:EC:17<br> inet addr:<a href="http://172.16.1.2">172.16.1.2</a> Bcast:<a href="http://172.16.1.255">
172.16.1.255</a> Mask:<a href="http://255.255.255.0">255.255.255.0</a><br> UP BROADCAST MULTICAST MTU:1500 Metric:1<br> RX packets:0 errors:0 dropped:0 overruns:0 frame:0<br> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
<br> collisions:0 txqueuelen:1000<br> RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)<br> Interrupt:209 Base address:0xce00<br><br>eth2 Link encap:Ethernet HWaddr 00:0C:76:BE:E5:87<br> inet addr:
<a href="http://192.168.1.112">192.168.1.112</a> Bcast:<a href="http://192.168.1.255">192.168.1.255</a> Mask:<a href="http://255.255.255.0">255.255.255.0</a><br> inet6 addr: fe80::20c:76ff:febe:e587/64 Scope:Link
<br> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br> RX packets:1155321 errors:0 dropped:0 overruns:0 frame:0<br> TX packets:664343 errors:0 dropped:0 overruns:0 carrier:0<br> collisions:0 txqueuelen:1000
<br> RX bytes:187622098 (178.9 MiB) TX bytes:125573054 (119.7 MiB)<br> Interrupt:217 Base address:0xed00<br><br>eth2:0 Link encap:Ethernet HWaddr 00:0C:76:BE:E5:87<br> inet addr:<a href="http://192.168.1.113">
192.168.1.113</a> Bcast:<a href="http://192.168.1.255">192.168.1.255</a> Mask:<a href="http://255.255.255.0">255.255.255.0</a><br> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br> Interrupt:217 Base address:0xed00
<br><br><br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openser.org">Users@openser.org</a><br><a href="http://openser.org/cgi-bin/mailman/listinfo/users">http://openser.org/cgi-bin/mailman/listinfo/users
</a><br></blockquote></div><br>