Bug 1298663

Summary: os-net-config cannot handle IPv6 static routes
Product: Red Hat OpenStack Reporter: Dan Sneddon <dsneddon>
Component: os-net-configAssignee: Dan Sneddon <dsneddon>
Status: CLOSED ERRATA QA Contact: yeylon <yeylon>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0 (Kilo)CC: dmacpher, hbrock, jslagle, mburns, mcornea, rhel-osp-director-maint, srevivo
Target Milestone: y3   
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: os-net-config-0.1.4-7.el7ost Doc Type: Bug Fix
Doc Text:
'os-net-config' only wrote IPv4 routes to /etc/sysconfig/network-scripts/route-*. However, IPv6 routes used /etc/sysconfig/network-scripts/route6-* files. This fix modifies 'os-net-config' to detect whether a route is IPv4 or IPv6 and write to the appropriate file. This allows 'os-net-config' to define IPv6 in the Linux configuration.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-18 16:49:52 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:

Description Dan Sneddon 2016-01-14 17:06:02 UTC
Description of problem:
os-net-config does not handle IPv6 static routes (they appear in the wrong file, so the route never gets installed).

Version-Release number of selected component (if applicable):
os-net-config.noarch               0.1.4-6.el7ost

How reproducible:
100%

Steps to Reproduce:
1. Configure a static IPv6 route in os-net-config template
2. Run os-net-config
3. 

Actual results:
The IPv6 route gets put into /etc/syssconfig/network-scripts/route-<iface>, but it never gets installed.

Expected results:
The IPv6 route should be installed.

Additional info:
os-net-config is only capable of writing to /etc/default/sysconfig/route-<iface>, while for IPv6 routes we need to write to /etc/sysconfig/network-scripts/route6-<iface>

I think we can use a basic regex to determine if we have an IPv6 or IPv4 route, and deal with it accordingly.

Comment 2 Dan Sneddon 2016-01-17 21:11:44 UTC
Upstream patch submitted for os-net-config to support IPv6 routes: https://review.openstack.org/#/c/268806/

Comment 3 Dan Sneddon 2016-01-18 09:30:45 UTC
Created downstream review for rhos-7.0-patches: https://code.engineering.redhat.com/gerrit/65764

Comment 5 Marius Cornea 2016-01-19 11:40:48 UTC
Destination subnet is in IPv4 format:
[root@overcloud-controller-0 ~]# cat /etc/sysconfig/network-scripts/route6-vlan10 
0.0.0.0/0 via 2001:db8:fd00:1000:dead:beef:cafe:f00 dev vlan10

IPv6 format:
[root@overcloud-controller-0 ~]# cat /etc/sysconfig/network-scripts/route6-vlan10 
::/0 via 2001:db8:fd00:1000:dead:beef:cafe:f00 dev vlan10

Comment 6 Marius Cornea 2016-01-19 11:48:43 UTC
I've just realized that I need to adjust the nic templates with the ipv6 formatted default route. Moving this back to ON_QA.

Comment 7 Marius Cornea 2016-01-19 11:57:40 UTC
Looks good after updating the nic templates:

in controller.yaml:
-
  type: vlan
  vlan_id: {get_param: ExternalNetworkVlanID}
  addresses:
  -
    ip_netmask: {get_param: ExternalIpSubnet}
  routes:
    -
      ip_netmask: ::/0
      next_hop: {get_param: ExternalInterfaceDefaultRoute}

[root@overcloud-controller-0 heat-admin]# ip -6 r | grep default
default via 2001:db8:fd00:1000:dead:beef:cafe:f00 dev vlan10  metric 1024

Comment 9 errata-xmlrpc 2016-02-18 16:49:52 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://rhn.redhat.com/errata/RHBA-2016-0264.html