Multiple Network Interfaces

It is possible to use BVR Linux with multiple network interfaces. This can be particularly useful in scenarios where some traffic should go via a public network interface and other traffic should go via a private network interface. For example, BVR may receive calls on the public interface but use the private interface for MRCP sessions.

The main things to consider here are:
  1. The bind address: This is the address that various components of BVR can bind to and is configured on a per-component basis (e.g. SIP, streaming etc.). In order for the configured component to be able to accept and send traffic on more than one network interface, the bind address must be "any".
  2. The presentation address: This is the address that BVR presents as being its IP address and is generally referred to in any SIP messaging.
  3. The network routing tables: These determine which route traffic to a specific subnet should take. This allows traffic to certain addresses to always go via a certain gateway and/or from a specific network adapter.

Configuring Bind Addresses

There are 3 bind addresses that can be configured: SIP, Streaming and MRCP. These can be configured individually using the bind_address option in the [sip], [streaming] and [mrcp] sections. If multiple presentation addresses are to be used in these protocols, the bind_address must be set to "any" so that BVR is able to receive traffic on the specified interface.

For further information on these configuration parameters, please refer to SIP Configuration Options, Streaming Configuration Options and MRCPv2 Configuration Options.

Configuring Presentation Addresses

The presentation address can be modified in 3 distinct areas:

The presentation address can be set for SIP, Streaming and MRCP in their respective configuration sections ([sip], [streaming] and [mrcp]). However, this may not be flexible for all scenarios such as when multiple network adapters are in use.

For a more flexible solution, BVR has options to configure the presentation addresses based on the subnet of the destination using the [[network]] configuration section (see Network Configuration Options). Within this section are a few parameters:

For example, if the following is specified:
BVR will set the presentation_address for SIP messages, Streaming and MRCP to "" when the destination is in the IP range.

The "destination" refers to the actual destination the SIP message is sent to and not necessarily the address provided in the To header. This is because the address in the To header is not always necessarily the next hop - for example, when using proxies. It is also possible that the To: header may not even contain an IP address, e.g. if a tel: URI is used (along with a proxy).

Note: Due to the way SIP works, it may be necessary to set the ignore_sent_by_check parameter in the [sip] section to "true" if multiple presentation addresses are to be used for SIP. See SIP Configuration Options for further details.
Note: Due to the way RTP works, it may be necessary to set the symmetric_rtp parameter in the [streaming] section to "false" if multiple presentation addresses are to be used for RTP streaming. See Streaming Configuration Options for further details.

Configuring routing tables

Routing tables can be manipulated temporarily using the ip command and can be viewed by running.

ip route

Manipulation of the routing tables should be done while BVR is not running. To avoid any unexpected behaviours, it is also highly recommended that any changes to the routing tables that will affect BVR are added permanently and the system rebooted.

The routing tables can be manipulated temporarily using "ip route add" or permanently by adding an entry to /etc/sysconfig/network-scripts/route-INSERT_DEVICE_NAME_HERE. If adding a permanent route, a restart of the network service will be required by running "service network restart". Note that running this command may cause your SSH session to disconnect. It is recommended that you test any routing changes using the "ip route add" command before adding them as a permanent setting primarily to determine that the system is still usable.

Adding a route to the script uses exactly the same syntax as the ip route add command, but without the "ip route add" at the beginning. A route definition consists of a subnet that this route applies to, the via parameter which determines gateway to send this traffic out on, and the dev parameter for the device to send the traffic out on. So, as an example, if you want all traffic to 1.1.1.x to go via a gateway on network adapter eth1, the syntax would be: via dev eth1
The via and dev parameters are both optional - for example it is possible to limit all traffic to a specific subnet to just go out on one adapter and ignore the via parameter. To apply this temporarily, run:
ip route add via dev eth1
and to apply it permanently, open /etc/sysconfig/network-scripts/route-eth1 in your preferred text editor and add the line: via dev eth1
A route can be temporarily removed by running: ip route del SUBNET So to delete the above, run:
ip route del 1.1.10/24
To permanently remove a route, simply remove it from the relevant route file it was added to and restart the network interface.