Bug 1789482

Summary: [RFE] NM should provide a way to automatically choose interface's IP address as source when creating iproute2 rule
Product: Red Hat Enterprise Linux 8 Reporter: Mai Ling <mailinglists35>
Component: NetworkManagerAssignee: NetworkManager Development Team <nm-team>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.4CC: aloughla, atragler, bgalvani, fge, lrintel, pasik, rkhan, sukulkar, thaller, till
Target Milestone: rcKeywords: FutureFeature
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-01 07:55:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mai Ling 2020-01-09 16:53:48 UTC
Description of problem:

The key "ipv4.routing-rules" creates an iproute2 rule with user specified IP address/network as source, or with source 0.0.0.0/0 if IP address/network is not mentioned.

However, I would like to be able to automatically add the interface IP address as the source. This is also currently impossible if the interface is configured via DHCP, as you would not know what IP address will get before the connection is up.

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

How reproducible:
always

Steps to Reproduce:

1a. nmcli connection modify conn1 ipv4.routing-rules "priority 30000 table 200" ipv4.method auto; nmcli up conn1

1b. nmcli connection modify conn1 ipv4.routing-rules "priority 30000 table 200 from 192.168.1.1/32" ipv4.method auto; nmcli up conn1

Actual results:
1a.
$ ip -N ru sh prio 30000
30000:	from all lookup 200

1b.
$ ip -N ru sh prio 30000
30000:	from 192.168.1.1 lookup 200


Expected results:
nmcli connecton modify conn1 ipv4.routing-rules-use-interface-ip yes
nmcli connection modify conn1 ipv4.routing-rules "priority 30000 table 200" ipv4.method auto
nmcli up conn1

(connection receives an IP over dhcp...)

$ ip -4 a sh dev wlp1s0|grep inet|awk '{print $2}'
192.168.137.187/24

$ ip -N ru sh prio 30000
30000:	from 192.168.137.187 lookup 200


Additional info:

Comment 3 Gris Ge 2021-03-03 02:50:44 UTC
Hi Mai Ling,

This might be done by dispatch script of NetworkManager.
Could you give it a go to see whether it fit your needs?

Thank you!

Comment 4 Till Maas 2021-04-01 07:55:12 UTC
Thank you for your report Mai Ling. Since we did not get any feedback we are assuming the issue is addressed by using a dispatcher script.

Comment 5 Red Hat Bugzilla 2023-09-15 00:20:36 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days