Bug 771673 - NM's ifcfg plugin should not write GATEWAYn
NM's ifcfg plugin should not write GATEWAYn
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: NetworkManager (Show other bugs)
21
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Dan Williams
Fedora Extras Quality Assurance
: Reopened
Depends On: 708409
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-04 10:14 EST by Bill Nottingham
Modified: 2014-08-20 09:30 EDT (History)
12 users (show)

See Also:
Fixed In Version: NetworkManager-0.9.10.0-1.git20140704.fc21
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 708409
Environment:
Last Closed: 2014-08-20 09:30:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bill Nottingham 2012-01-04 10:14:40 EST
If you're doing multiple addresses, NM's connection editor/ifcfg plugin will write
IPADDRn
PREFIXn
GATEWAYn

as configuration items.

GATEWAYn is arguably invalid - even if you have multiple addresses on a device, you can't have multiple gateways. (Unless I'm missing something?)
Comment 1 Jirka Klimes 2012-01-09 10:00:34 EST
Of course, there's just one default route and and NM takes it from the first address (that is address/prefix/gateway triplet).
In case of one address, there's no problem as we only have one gateway.
However, in case of multiple addresses the things gets complicated, because all of a sudden, we have more gateways. We want to save gateway part of the triplet for all addresses, so ifcfg-rh uses GATEWAYn.

Storing addresses:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/settings/plugins/ifcfg-rh/writer.c#n1235

That's why I posted a patch for initscripts to read the gateway from the first address (be it GATEWAY, GATEWAY0, GATEWAY1 or GATEWAY2):
https://bugzilla.redhat.com/show_bug.cgi?id=708409#c5

I suggested in bug 604334 that the gateway part of the address may be redundant, but the Dan preferred to have it with an IP:
https://bugzilla.redhat.com/show_bug.cgi?id=604334#c12

Also, for IPv6 (bug 604334), ifcfg-rh plugin uses IPV6_DEFAULTGW for the default route from ifcfg file (if not present then from global /etc/sysconfig/network). (Here, I think, initscripts should add the description that IPV6_DEFAULTGW can be set in ifcfg file too; this is necessary to have default gateway per network and not just global).
There was no variable to store gateways for multiple addresses for IPv6 (such as IPV6_DEFAULTGW<n>), so NM now simple looses those when writting to ifcfg.

All in all, I think we should come to a conclusion how to store/read the addresses, so that initscripts and NM are consistent and there's no confusion.
Backwards compatibility may make it harder, though. Any thoughts, suggestions?
Comment 2 Bill Nottingham 2012-01-09 17:05:23 EST
Hm, I see why you might want to store it, but it still doesn't read right, as if you have multiple addresses, it will only ever use the first one.
Comment 3 Fedora End Of Life 2013-01-16 08:09:54 EST
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 4 Fedora End Of Life 2013-02-13 08:51:04 EST
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 5 Jirka Klimes 2014-06-19 09:51:26 EDT
Reopening for a fix in NetworkManager ifcfg-rh plugin.

Upstream branch jk/ifcfg-rh-gateway changes a way NM writes the stuff.
It will write the first address info as IPADDR, PREFIX and GATEWAY instead of IPADDR0, PREFIX0, GATEWAY0.
Comment 6 Jirka Klimes 2014-06-19 10:42:58 EDT
We might also prefix GATEWAY1, GATEWAY_2, ... with "NM_", or use another variable name in order not to confuse users. But it would make backwards compatibility much harder.
Comment 7 Dan Williams 2014-06-20 19:09:12 EDT
Patch looks good to me.
Comment 8 Jirka Klimes 2014-06-23 09:07:59 EDT
The patch pushed to upstream master branch:
e554ef6 ifcfg-rh: write GATEWAY instead of GATEWAY0 to be ifup-compatible (rh #771673)

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