Multiple interfaces on Asterisk - problem

Hello,

My Linux machine haves one etherenet card (eth0), but I made one virtual ethernet card on eth0 (eth0.1), so I use two IP addresses on one machine (both of them are on the same network).

How can I setup asterisk, so that predifined numbers will call from eth0 and others will call from eth0.1?

Hi

If they are going to defined destinations then set a static route defining the interface to use.

Ian

The problem is, because Asterisk and its two IP’s, are connecting to the same machine with one IP address.

So the static routing is not an option.

Hi

What are trying to acheive ? using one real interface and one virtual on the same lan connecting to one IP on another machine ?

Ian

Yes, one real interface and one virtual on Asterisk box.

My problem is, that I would like to separete calls based on subscriber numbers on Asterisk to other SIP server who has only one IP.

Example:

  1. When I call 555 on Asterisk, the call goes via real interface to other SIP server.
  2. When I call 666 on Asterisk, the call goes via virtual interface to other SIP server.

All is happening on the same network.

Is it even possible?

Hi

How many sip servers do you have ? one or 2 ?

Ian

One asterisk (with real and virtual interface) and one SIP server (with one real interface).

Hi

Then you cant realy do what you want and there is little purpose in doing it realy. If you want to differenciat users create 2 accounts on the sip server and send calls to the diffrerent accounts

Ian