How to configure asterisk box with two IP addresses?

I have a asterisk with two broadband connection from two different ISPs, therefore, two ip addresses.

The reason why I have two ip addresses for my asterisk box is some users have fast connection to my asterisk box with different ISP.

How do I configure parameter externip in sip.conf so that my asterisk can utilize two ip address?

Your help is greatly appreciated.

I’ve got a client with a dual homed box (two internal subnets, not two ISP connections) and I can connect phones to either ip. I could be high but I’d figure if you have bindaddr=0.0.0.0 in your sip.conf you should be golden.

Tom

that will only address incoming connections. outgoing connections will use the machine’s default route - unless you can set up one for each ISP connection, you won’t be using both…

So there’s a delay on the return path, at least he can listen on both connections. :smile:

Tom

The best way to solve the default route issue might be to use a broadband router that is designed to handle two internet connections. Then you give Asterisk a single internal IP address and advertise the two public IP’s to your SIP clients. Not sure if this would work with Asterisk. Something like a Linksys RV042 should do the trick. Let us know if you have any luck!

I second the call for the RV042. Great little routers.

Tom

There is a problem with this because in the sip.conf, you have to define your external IP to fix SIP NAT issue.

So if you want user to access remotly, you have to “bind” them I think

I was under the impression there was a way to tell Asterisk your internal network (net=?) so everything else was treated as natted. Am I high?

I can’t be high. Let me look it up.

Yes, localnet=x.x.x.x/x.x.x.x. Doesn’t that do the trick?

Tom

Yep, you need to tell Asterisk his local subnet but you also need to tell him his external IP. This is where I see a problem. You can’t tell Asterisk two external IP.

that is what I want to know how can we tell Asterisk two external IPs.

I would use round robin DNS (or so I think it is called) and have the phone re-register often.

NO, round robin DNS do not solve the problem. Since users using ISP A broadband would need to connect to IP address from ISP A to have better connection to * box, and so do users using ISP B broand connections would have better connection when connecting to IP address from ISP B.

Then how about a proxy. Or a second server that just sets up and tears down the calls and have the RTP streams all use the main server. Aslo have you tried the asterisk users list ?