Bug 1746575

Summary: unable to ignore default router from router advertisement
Product: Red Hat Enterprise Linux 7 Reporter: Dominik Holler <dholler>
Component: initscriptsAssignee: Jan Macku <jamacku>
Status: CLOSED WONTFIX QA Contact: Daniel Rusek <drusek>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.7CC: initscripts-maint-list, jamacku, lnykryn, mtessun
Target Milestone: rc   
Target Release: ---   
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: 2020-03-12 09:08:20 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:
Bug Depends On:    
Bug Blocks: 1080725    
Attachments:
Description Flags
terminal log of reproducer
none
rc.debug terminal log none

Description Dominik Holler 2019-08-28 19:50:18 UTC
Created attachment 1609112 [details]
terminal log of reproducer

Description of problem: If the router sends the default router via a router advertisement, it is used as default gateway, even if it should be ignored.


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


How reproducible:
100%

Steps to Reproduce:
1. Ensure that the lines
IPV6INIT=no
NM_CONTROLLED=no
IPV6_AUTOCONF=no
are in the related ifcfgfile

2. reboot
3.

Actual results:
# ip -6 r  | grep ra
default via fe80::5054:ff:fe3b:9e8f dev eth0 proto ra metric 1024 expires 1388sec hoplimit 64 pref medium



Expected results:
# ip -6 r  | grep ra
 no output



Additional info:

Comment 2 Dominik Holler 2019-09-02 10:21:41 UTC
Even if a gateway is set manually, gateway from ra is still there:
[root@ra_test ~]# cat  /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
USERCTL="yes"
PEERDNS="yes"
IPV6INIT="yes"
PERSISTENT_DHCLIENT="1"
IPV6ADDR=fde4:e66c:9a7c:dd91::a9/64
IPV6_DEFAULTGW=fde4:e66c:9a7c:dd91::1
IPV6_AUTOCONF=no
NM_CONTROLLED=no
[root@ra_test ~]# ip -6 r
unreachable ::/96 dev lo metric 1024 error -113 pref medium
unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -113 pref medium
unreachable 2002:a00::/24 dev lo metric 1024 error -113 pref medium
unreachable 2002:7f00::/24 dev lo metric 1024 error -113 pref medium
unreachable 2002:a9fe::/32 dev lo metric 1024 error -113 pref medium
unreachable 2002:ac10::/28 dev lo metric 1024 error -113 pref medium
unreachable 2002:c0a8::/32 dev lo metric 1024 error -113 pref medium
unreachable 2002:e000::/19 dev lo metric 1024 error -113 pref medium
unreachable 3ffe:ffff::/32 dev lo metric 1024 error -113 pref medium
fde4:e66c:9a7c:dd91::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
default via fde4:e66c:9a7c:dd91::1 dev eth0 metric 1 pref medium
default via fe80::5054:ff:fe3b:9e8f dev eth0 proto ra metric 1024 expires 1788sec hoplimit 64 pref medium

Comment 3 Jan Macku 2019-09-12 08:26:11 UTC
I tried to reproduce this issue, but I wasn't able to get same results as you.

But I think that problem would be in that initscripts are changing kernel default value for router advertisement after kernel already read this value.

Can you please run your reproducer with "rc.debug" enabled on kernel cmd while rebooting. And please send me output from 

# journalctl -b -u network

Thank you.


Also I was thinking about two workarounds.

1. You can turn off router advertisement by adding option "IPV6_AUTOCONF=no" into "/etc/sysconfig/network". But be aware that this will turn off ra for all devices by default.

2. Or you can add option "net.ipv6.conf.<device_name>.accept_ra = 0" into "/etc/sysctl.conf". This will affect default values only for specific device.

Would you mind to test one of those workarounds and let me know?
Thank you.

Comment 4 Dominik Holler 2019-09-12 13:25:56 UTC
Created attachment 1614521 [details]
rc.debug terminal log

(In reply to Jan Macku from comment #3)
> I tried to reproduce this issue, but I wasn't able to get same results as
> you.
> 

I just use the official RHEL7 image attached to a libvirt network.
The config if this libvirt network is in the output.

> But I think that problem would be in that initscripts are changing kernel
> default value for router advertisement after kernel already read this value.
> 
> Can you please run your reproducer with "rc.debug" enabled on kernel cmd
> while rebooting. And please send me output from 
> 
> # journalctl -b -u network
> 
> Thank you.
> 

Please find the output in the attachment.

> 
> Also I was thinking about two workarounds.
> 
> 1. You can turn off router advertisement by adding option "IPV6_AUTOCONF=no"
> into "/etc/sysconfig/network". But be aware that this will turn off ra for
> all devices by default.
> 

Should IPV6_AUTOCONF in /etc/sysconfig/network-scripts/ifcfg-eth0 overwrite this?

> 2. Or you can add option "net.ipv6.conf.<device_name>.accept_ra = 0" into
> "/etc/sysctl.conf". This will affect default values only for specific device.
> 

This seems to be a workaround to configure on interface level.

> Would you mind to test one of those workarounds and let me know?

Thanks for your ideas.

> Thank you.

Comment 5 Jan Macku 2019-09-12 14:06:13 UTC
(In reply to Dominik Holler from comment #4)
> Created attachment 1614521 [details]
> rc.debug terminal log
> 
> (In reply to Jan Macku from comment #3)
> > I tried to reproduce this issue, but I wasn't able to get same results as
> > you.
> > 
> 
> I just use the official RHEL7 image attached to a libvirt network.
> The config if this libvirt network is in the output.
> 
> > But I think that problem would be in that initscripts are changing kernel
> > default value for router advertisement after kernel already read this value.
> > 
> > Can you please run your reproducer with "rc.debug" enabled on kernel cmd
> > while rebooting. And please send me output from 
> > 
> > # journalctl -b -u network
> > 
> > Thank you.
> > 
> 
> Please find the output in the attachment.

Thank you, I'll have a look.
 
> > 
> > Also I was thinking about two workarounds.
> > 
> > 1. You can turn off router advertisement by adding option "IPV6_AUTOCONF=no"
> > into "/etc/sysconfig/network". But be aware that this will turn off ra for
> > all devices by default.
> > 
> 
> Should IPV6_AUTOCONF in /etc/sysconfig/network-scripts/ifcfg-eth0 overwrite
> this?

Yes. The first are applied values from /etc/sysconfig/network then from /etc/sysctl.conf and as last from /etc/sysconfig/network-scripts/ifcfg-*.
The problem is that if you set IPV6_AUTOCONF=no in /etc/sysconfig/network and try to overwrite it in some of the /etc/sysconfig/network-scripts/ifcfg-* to yes, it will set a kernel value to 1 (yes). That's correct. But kernel probably won't set router advertisement for that device. So I would suggest to use /etc/sysctl.conf instead in such a case.

> > 2. Or you can add option "net.ipv6.conf.<device_name>.accept_ra = 0" into
> > "/etc/sysctl.conf". This will affect default values only for specific device.
> > 
> 
> This seems to be a workaround to configure on interface level.
> 
> > Would you mind to test one of those workarounds and let me know?
> 
> Thanks for your ideas.
> 
> > Thank you.

Comment 6 Jan Macku 2020-03-12 08:44:11 UTC
Hi Dominik,
does workaround works for you?

I'm thinking about closing this bug as WOTNFIX. To fix this issue would require to rewrite quite big chunk of code. This would cause regression, so I don't really want to do it if it's not necessary.

Cheers
Jan

Comment 7 Dominik Holler 2020-03-12 08:53:03 UTC
(In reply to Jan Macku from comment #6)
> Hi Dominik,
> does workaround works for you?
> 

No, but I tried only once.

> I'm thinking about closing this bug as WOTNFIX. To fix this issue would
> require to rewrite quite big chunk of code. This would cause regression, so
> I don't really want to do it if it's not necessary.
> 

From my point of view, WONTFIX would be fine. Even it is working for most cases, dynamic IPv6 is not officially supported on RHV.
I am more afraid of regressions on RHEL 7 than this bug itself.

> Cheers
> Jan

Comment 8 Jan Macku 2020-03-12 09:08:20 UTC
I'm closing this bug as WONTFIX for reasons mentioned above.

Please feel free to reopen it, in case of any problems related to the bug.