RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1582685 - [IPsrcaddr] Local route table not updating
Summary: [IPsrcaddr] Local route table not updating
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: resource-agents
Version: 7.5
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1729984 1744224
TreeView+ depends on / blocked
 
Reported: 2018-05-26 00:21 UTC by Reid Wahl
Modified: 2023-09-07 19:10 UTC (History)
10 users (show)

Fixed In Version: resource-agents-4.1.1-46.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1744224 (view as bug list)
Environment:
Last Closed: 2020-03-31 19:47:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch (9.38 KB, patch)
2018-09-06 01:04 UTC, Reid Wahl
no flags Details | Diff
test cases (8.92 KB, text/plain)
2018-09-06 01:05 UTC, Reid Wahl
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github ClusterLabs resource-agents pull 1212 0 'None' closed Medium: IPsrcaddr: Add "update_local_route" attribute 2020-11-19 23:27:49 UTC
Red Hat Knowledge Base (Solution) 3459471 0 None None None 2018-05-26 00:21:45 UTC
Red Hat Product Errata RHBA-2020:1067 0 None None None 2020-03-31 19:48:00 UTC

Description Reid Wahl 2018-05-26 00:21:46 UTC
Description of problem:

The `ocf:heartbeat:IPsrcaddr` resource agent updates the default route to use a specified IP address (`OCF_RESKEY_ipaddress`) as the preferred source IP. It does not make any changes to the local route table.

`IPsrcaddr` is often paired with `IPaddr2` to provide a virtual IP address and then use that virtual IP as the preferred source IP for outgoing connections on the default route. Some applications make local connections to the virtual IP address, and a subset of those require that the source IP for the connection be the virtual IP.

In other words, the local connection in these cases needs to be:
    virtual_ip -> virtual_ip

However, this is what is occurring:
    primary_ip -> virtual_ip


The local routing table determines the source IP for these connections. For routes in the local routing table, the default src IP address has always been the primary IP address of the interface. After adding an `IPaddr2` resource, there will be a local route like this:

    # ip route show table local to exact <virtual_ip>
    local <virtual_ip> dev <iface> proto kernel scope host src <primary_ip>


On RHEL 6, due to a bug, the kernel ignored the src specification when handling local routing. Instead, it used the destination IP as the source IP. So applications that depended on "virtual_ip -> virtual_ip" behavior behaved normally. For more information, see "Source IP address selection is different in RHEL7 compared to RHEL6 for local connections" (https://access.redhat.com/solutions/3458491).

On RHEL 7, the kernel respects the src specification for local routes. So applications that depend on "virtual_ip -> virtual_ip" behavior will break.

The IPsrcaddr resource agent needs to be able to update the local route to `OCF_RESKEY_ipaddress` in addition to updating the default route.


--------------------

Version-Release number of selected component (if applicable):

resource-agents-3.9.5-124.el7.x86_64
master


--------------------

How reproducible:

Always


--------------------

Steps to Reproduce:

1. Create a resource group containing both an IPaddr2 resource and an IPsrcaddr resource with the same IP address ($IPADDR).

    # pcs resource show ip
     Group: ip
      Resource: vip (class=ocf provider=heartbeat type=IPaddr2)
       Attributes: ip=192.168.122.61
       Operations: monitor interval=60s timeout=20s (vip-monitor-interval-60s)
                   stop interval=0s timeout=20s (vip-stop-interval-0s)
                   start interval=0s timeout=20s (vip-start-interval-0s)
      Resource: ipsrc (class=ocf provider=heartbeat type=IPsrcaddr)
       Attributes: ipaddress=192.168.122.61
       Operations: monitor interval=10 timeout=20s (ipsrc-monitor-interval-10)
                   start interval=0s timeout=20s (ipsrc-start-interval-0s)
                   stop interval=0s timeout=20s (ipsrc-stop-interval-0s)


2. Verify that the default route has been updated to use "$IPADDR" as the source IP.

    # ip route show to exact 0.0.0.0/0
    default via 192.168.122.1 dev eth0 proto static src 192.168.122.61 metric 100 


3. Observe that the local route to "$IPADDR" still uses the primary IP address as the source IP.

    # ip route show table local to exact 192.168.122.61
    local 192.168.122.61 dev eth0 proto kernel scope host src 192.168.122.51 


--------------------

Actual results:

    # ip route show table local to exact 192.168.122.61
    local 192.168.122.61 dev eth0 proto kernel scope host src 192.168.122.51 


--------------------

Expected results:

    # ip route show table local to exact 192.168.122.61
    local 192.168.122.61 dev eth0 proto kernel scope host src 192.168.122.61 


--------------------

Additional info:

N/A

Comment 6 Reid Wahl 2018-05-27 09:19:13 UTC
Submitted upstream PR: https://github.com/ClusterLabs/resource-agents/pull/1150

Comment 9 Reid Wahl 2018-09-06 01:04:20 UTC
Created attachment 1481183 [details]
patch

Comment 10 Reid Wahl 2018-09-06 01:05:56 UTC
Created attachment 1481184 [details]
test cases

Comment 14 Oyvind Albrigtsen 2019-08-15 14:33:22 UTC
Destination and table parameters are now used instead of the update_* parameters mentioned above.

E.g. to only use src IP 192.168.122.220 when you connect to 192.168.122.70:
"destination=192.168.122.70/32 ipaddress=192.168.122.220 table=local"

Comment 16 Oyvind Albrigtsen 2019-08-16 08:07:21 UTC
Link to PR: https://github.com/ClusterLabs/resource-agents/pull/1382

Comment 19 Oyvind Albrigtsen 2019-11-28 15:14:57 UTC
Additional patch to solve issues found by QE when moving IPaddr2+IPsrcaddr back and forth between nodes:
https://github.com/ClusterLabs/resource-agents/pull/1437

Comment 24 Oyvind Albrigtsen 2020-01-10 14:40:52 UTC
Additional patch to fix probe issues found by QE: https://github.com/ClusterLabs/resource-agents/pull/1445

Comment 27 Oyvind Albrigtsen 2020-01-16 14:59:31 UTC
Additional patch to fix hardcoded interface when trying to find primary IP during stop (found by QE in RHEL8 testing):
https://github.com/ClusterLabs/resource-agents/pull/1447

Comment 29 errata-xmlrpc 2020-03-31 19:47:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1067


Note You need to log in before you can comment on or make changes to this bug.