1

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=10.1.8.32 cidr_netmask=32 nic=eth0 op monitor interval=30s
pcs resource create sip_virtual_ip ocf:heartbeat:IPaddr2 ip=10.251.0.52 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

2

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 192.168.5.4. This IP floats between nodes A & B. Nodes A & B have IP addresses of 192.168.5.2 and 192.168.5.3 respectively. The gateway for this network is at 192.168.5.1.

I want all traffic to appear as if it coming from the virtual IP address of 192.168.5.4 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 192.168.5.1 src 192.168.5.4

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 192.168.5.4 address ever failover. In my cib I have it like so:

primitive asterisk_srcaddr IPsrcaddr \
        params ipaddress=192.168.5.4 cidr_netmask=24

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

3
  • 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 .