Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
A solution https://access.redhat.com/solutions/1257153 advertises that policy based routing can be set using NetworkManager, however the solution is not working for VPN interfaces.
Version-Release number of selected component (if applicable):
NetworkManager-dispatcher-routing-rules-1.4.0-20.el7_3.noarch
How reproducible:
Always
Steps to Reproduce:
1. define OpenVPN connection, explicitly specify interface tun5 to avoid automatic assignment.
2. add /etc/sysconfig/network-scripts/rule-tun5 file with a desired rule.
3. bring up OpenVPN connection.
Actual results:
no new rule appears in the output of
ip rule list
Expected results:
a new rule should appear in the output of
ip rule list
Additional info:
I added three lines to /etc/NetworkManager/dispatcher.d/10-ifcfg-rh-routes.sh
echo "CONNECTION_FILENAME=$CONNECTION_FILENAME" >> /tmp/10-ifcfg.log
echo "DEVICE_IP_IFACE=$DEVICE_IP_IFACE" >> /tmp/10-ifcfg.log
echo "ARGS=$@" >> /tmp/10-ifcfg.log
contents of /tmp/10-ifcfg.log:
CONNECTION_FILENAME=/etc/NetworkManager/system-connections/myvpn
DEVICE_IP_IFACE=eth0
ARGS=tun5 vpn-pre-up
CONNECTION_FILENAME=
DEVICE_IP_IFACE=tun5
ARGS=tun5 pre-up
CONNECTION_FILENAME=/etc/NetworkManager/system-connections/myvpn
DEVICE_IP_IFACE=eth0
ARGS=tun5 vpn-up
CONNECTION_FILENAME=
DEVICE_IP_IFACE=tun5
ARGS=tun5 up
NetworkManager does not support policy routing yet. With rhel-7.4, it will gain support for additional routing properties, but configuring routes outside the main table, or configuring routing rules is not yet supported. It's planned in the future.
The workaround for that is to use dispatcher scripts. Since you seem already willing to edit files in /etc, you can just as well create a dispatcher script that configures the routes to your liking.
10-ifcfg-rh-routes.sh exists precisely to workaround the missing feature when upgrading from initscripts. initscripts don't support VPN, so 10-ifcfg-rh-routes.sh doesn't support it either. 10-ifcfg-rh-routes.sh is not going to be extended for VPN.
https://access.redhat.com/solutions/1257153 should be clearer about that, but:
- the article is talking about what to do if you previously had policy routing
configured for initscripts, after enabling NetworkManager (initscripts never
supported VPN).
- openvpn is not (yet) one of the core RHEL packages. The solution doesn't
apply to it. Arguably, NetworkManager-libreswan *is* a core RHEL package,
and you have the same problem there too.
The long-term solution will be to implement policy routing in NetworkManager. I duplicate this bug to bug 1436531, which is about that.
The short-term solution is to write your own dispatcher scripts (see `man NetworkManager` for documentation).
*** This bug has been marked as a duplicate of bug 1436531 ***
FWIW I simply removed three last if statements from the 10-ifcfg-rh-routes.sh and rules/routes started to work with VPN.
All logic is sufficiently carried out by ifup-routes and ifdown-routes for source policy routing at least for my use case.