I am having trouble setting up a Virtual/Floating IP. In this specific circumstance I am using Pacemaker+Corosync to manage 2 Virtual IP's. One is internal and the other is external to our SIP Trunk. VOIP Asterisk/FreePBX.

The issue seems to be that our SIP Trunk is seeing the packets coming from the IP that is registered directly onto the NIC, not from the Virtual_IP that is tied to the NIC.

Is this possible? Any thoughts on how to troubleshoot/fix this?

Cluster Virtual IP Commands used to create Virtual IP's :

pcs resource create www_virtual_ip ocf:heartbeat:IPaddr2 ip= cidr_netmask=32 nic=eth0 op monitor interval=30s
pcs resource create sip_virtual_ip ocf:heartbeat:IPaddr2 ip= cidr_netmask=32 nic=eth1 op monito

I am using Asterisk 11 + FreePBX 2.12 on CentOS 7. I read this might be an asterisk 11 issue with the 2 IP's on one nic, but vs try to configure Asterisk, I'd like to get this working at the PaceMaker level.

1 Answer 1


I had a similar issue with an IAX2 trunk in a Pacemaker HA setup. The solution is not to disable the primary IP address of the NIC, but rather to source all traffic from the virtual IP address. There is even a pacemaker resource agent just for this. The ocf:heartbeat:IPsrcaddr.

For example I have a virtual (secondary) IP of This IP floats between nodes A & B. Nodes A & B have IP addresses of and respectively. The gateway for this network is at

I want all traffic to appear as if it coming from the virtual IP address of which currently is hosted by nodeA. To do so we can simply add a default route with a specific source address set.

ip route add default via src

You may then want to delete the old default route. You can try this to test initially and see if it resolves your issues.

If that works for you then simply configure the ocf:heartbeat:IPsrcaddr resource agent in your pacemaker cib to set this default source route automatically should the virtual address ever failover. In my cib I have it like so:

primitive asterisk_srcaddr IPsrcaddr \
        params ipaddress= cidr_netmask=24

Just make certain that this asterisk_srcaddr resource starts after the IPaddr2 resource.

  • Man I am driving to work to try this right now! Very promising! Looks like what I need! Commented Jul 28, 2016 at 0:03
  • I have 2 NIC's, but the ipsrcaddr doesn't take the nic= param, any ideas if I have two nics, how I can specify the srcaddr for each nic/gateway? Commented Jul 28, 2016 at 0:52
  • If they're on separate networks simply define two routes. If it's two NIC's on the same subnet then I'm not too sure then. The IPsrcaddr resource agent merely creates and deletes routes. It has no concept of interfaces.
    – Dok
    Commented Jul 28, 2016 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .