← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1755414] [NEW] VR replaces connected routes

 

Public bug reported:

Hi colleagues,

The idea behind this design is to easily switch VM between different
address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
Subnet-2), using same port/MAC (which always is in E-Network).

If VR connected to subnets belonging to same network (preformatted
scheme also is at https://pastebin.com/AesqkcXa) :

                   E-Network
  +------------------------------------------+
    Subnet-1                        Subnet-2
  +---+----+--+                  +----+------+
      |    |        +----+            |
   VM-+    |        |    |            |
           +--------+ VR +------------+
                   /|    |\
         qr-64.. -/ 0----+ \- qg-16..

using Subnet-1 as LAN connection and Subnet-2 as external gateway
connection, then Neutron swaps connected route to Subnet-1 with same
route but through Subnet-2 interface (3rd entry in the following
sequence):

14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']

which makes it impossible to communicate between VMs in Subnet-1 with
the VR.

Proposed solution:

When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
- function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
- when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.

This will fix routing in case of conflict, will preserve routing model
if there is no conflict and will preserve compatibility with other
functions calling add_route (no keyword "metric" - no changes in
behavior).

Openstack: Pike
Neutron: 11.0.2
Ubuntu: 16.04

Thank you.

** Affects: neutron
     Importance: Undecided
         Status: New


** Tags: neutron

** Description changed:

  Hi colleagues,
  
  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).
  
  If VR connected to subnets belonging to same network:
- 
-                  E-Network
+ <pre>
+                  E-Network
  +------------------------------------------+
-   Subnet-1                        Subnet-2
+   Subnet-1                        Subnet-2
  +---+----+--+                  +----+------+
-     |    |        +----+            |
-  VM-+    |        |    |            |
-          +--------+ VR +------------+
-                  /|    |\
-        qr-64.. -/ 0----+ \- qg-16..
- 
- using Subnet-1 as LAN connection and Subnet-2 as external gateway
- connection, then Neutron swaps connected route to Subnet-1 with same
- route but through Subnet-2 interface (3rd entry in the following
- sequence):
+     |    |        +----+            |
+  VM-+    |        |    |            |
+          +--------+ VR +------------+
+                  /|    |\
+        qr-64.. -/ 0----+ \- qg-16..
+ </pre>
+ using Subnet-1 as LAN connection and Subnet-2 as external gateway connection, then Neutron swaps connected route to Subnet-1 with same route but through Subnet-2 interface (3rd entry in the following sequence):
  
  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']
  
  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.
- 
  
  Proposed solution:
  
  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.
  
  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).
  
  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04
  
- 
  Thank you.

** Description changed:

  Hi colleagues,
  
  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).
  
  If VR connected to subnets belonging to same network:
- <pre>
-                  E-Network
- +------------------------------------------+
-   Subnet-1                        Subnet-2
- +---+----+--+                  +----+------+
-     |    |        +----+            |
-  VM-+    |        |    |            |
-          +--------+ VR +------------+
-                  /|    |\
-        qr-64.. -/ 0----+ \- qg-16..
- </pre>
- using Subnet-1 as LAN connection and Subnet-2 as external gateway connection, then Neutron swaps connected route to Subnet-1 with same route but through Subnet-2 interface (3rd entry in the following sequence):
+ 
+                    E-Network
+   +------------------------------------------+
+     Subnet-1                        Subnet-2
+   +---+----+--+                  +----+------+
+       |    |        +----+            |
+    VM-+    |        |    |            |
+            +--------+ VR +------------+
+                    /|    |\
+          qr-64.. -/ 0----+ \- qg-16..
+ 
+ using Subnet-1 as LAN connection and Subnet-2 as external gateway
+ connection, then Neutron swaps connected route to Subnet-1 with same
+ route but through Subnet-2 interface (3rd entry in the following
+ sequence):
  
  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']
  
  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.
  
  Proposed solution:
  
  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.
  
  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).
  
  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04
  
  Thank you.

** Description changed:

  Hi colleagues,
  
  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).
  
  If VR connected to subnets belonging to same network:
- 
-                    E-Network
-   +------------------------------------------+
-     Subnet-1                        Subnet-2
-   +---+----+--+                  +----+------+
-       |    |        +----+            |
-    VM-+    |        |    |            |
-            +--------+ VR +------------+
-                    /|    |\
-          qr-64.. -/ 0----+ \- qg-16..
- 
- using Subnet-1 as LAN connection and Subnet-2 as external gateway
- connection, then Neutron swaps connected route to Subnet-1 with same
- route but through Subnet-2 interface (3rd entry in the following
- sequence):
+ {{{
+                    E-Network
+   +------------------------------------------+
+     Subnet-1                        Subnet-2
+   +---+----+--+                  +----+------+
+       |    |        +----+            |
+    VM-+    |        |    |            |
+            +--------+ VR +------------+
+                    /|    |\
+          qr-64.. -/ 0----+ \- qg-16..
+ }}}
+ using Subnet-1 as LAN connection and Subnet-2 as external gateway connection, then Neutron swaps connected route to Subnet-1 with same route but through Subnet-2 interface (3rd entry in the following sequence):
  
  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']
  
  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.
  
  Proposed solution:
  
  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.
  
  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).
  
  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04
  
  Thank you.

** Description changed:

  Hi colleagues,
  
  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).
  
- If VR connected to subnets belonging to same network:
- {{{
+ If VR connected to subnets belonging to same network (preformatted
+ scheme also is at https://pastebin.com/AesqkcXa) :
+ 
                     E-Network
    +------------------------------------------+
      Subnet-1                        Subnet-2
    +---+----+--+                  +----+------+
        |    |        +----+            |
     VM-+    |        |    |            |
             +--------+ VR +------------+
                     /|    |\
           qr-64.. -/ 0----+ \- qg-16..
- }}}
- using Subnet-1 as LAN connection and Subnet-2 as external gateway connection, then Neutron swaps connected route to Subnet-1 with same route but through Subnet-2 interface (3rd entry in the following sequence):
+ 
+ using Subnet-1 as LAN connection and Subnet-2 as external gateway
+ connection, then Neutron swaps connected route to Subnet-1 with same
+ route but through Subnet-2 interface (3rd entry in the following
+ sequence):
  
  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']
  
  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.
  
  Proposed solution:
  
  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.
  
  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).
  
  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04
  
  Thank you.

** Description changed:

  Hi colleagues,
  
  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).
  
  If VR connected to subnets belonging to same network (preformatted
  scheme also is at https://pastebin.com/AesqkcXa) :
  
-                    E-Network
+ {{{                   E-Network
    +------------------------------------------+
      Subnet-1                        Subnet-2
    +---+----+--+                  +----+------+
        |    |        +----+            |
     VM-+    |        |    |            |
             +--------+ VR +------------+
                     /|    |\
-          qr-64.. -/ 0----+ \- qg-16..
+          qr-64.. -/ 0----+ \- qg-16.. }}}
  
  using Subnet-1 as LAN connection and Subnet-2 as external gateway
  connection, then Neutron swaps connected route to Subnet-1 with same
  route but through Subnet-2 interface (3rd entry in the following
  sequence):
  
  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']
  
  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.
  
  Proposed solution:
  
  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.
  
  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).
  
  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04
  
  Thank you.

** Description changed:

  Hi colleagues,
  
  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).
  
  If VR connected to subnets belonging to same network (preformatted
  scheme also is at https://pastebin.com/AesqkcXa) :
  
- {{{                   E-Network
+ {{{
+                    E-Network
    +------------------------------------------+
      Subnet-1                        Subnet-2
    +---+----+--+                  +----+------+
        |    |        +----+            |
     VM-+    |        |    |            |
             +--------+ VR +------------+
                     /|    |\
-          qr-64.. -/ 0----+ \- qg-16.. }}}
+          qr-64.. -/ 0----+ \- qg-16..
+ }}}
  
  using Subnet-1 as LAN connection and Subnet-2 as external gateway
  connection, then Neutron swaps connected route to Subnet-1 with same
  route but through Subnet-2 interface (3rd entry in the following
  sequence):
  
  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']
  
  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.
  
  Proposed solution:
  
  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.
  
  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).
  
  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04
  
  Thank you.

** Description changed:

  Hi colleagues,
  
  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).
  
  If VR connected to subnets belonging to same network (preformatted
  scheme also is at https://pastebin.com/AesqkcXa) :
  
- {{{
+ { { {
                     E-Network
    +------------------------------------------+
      Subnet-1                        Subnet-2
    +---+----+--+                  +----+------+
        |    |        +----+            |
     VM-+    |        |    |            |
             +--------+ VR +------------+
                     /|    |\
           qr-64.. -/ 0----+ \- qg-16..
- }}}
+ } } }
  
  using Subnet-1 as LAN connection and Subnet-2 as external gateway
  connection, then Neutron swaps connected route to Subnet-1 with same
  route but through Subnet-2 interface (3rd entry in the following
  sequence):
  
  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']
  
  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.
  
  Proposed solution:
  
  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.
  
  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).
  
  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04
  
  Thank you.

** Description changed:

  Hi colleagues,
  
  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).
  
- If VR connected to subnets belonging to same network (preformatted
- scheme also is at https://pastebin.com/AesqkcXa) :
- 
- { { {
+ If VR connected to subnets belonging to same network (preformatted scheme also is at https://pastebin.com/AesqkcXa) :
+ {{{
                     E-Network
    +------------------------------------------+
      Subnet-1                        Subnet-2
    +---+----+--+                  +----+------+
        |    |        +----+            |
     VM-+    |        |    |            |
             +--------+ VR +------------+
                     /|    |\
           qr-64.. -/ 0----+ \- qg-16..
- } } }
- 
- using Subnet-1 as LAN connection and Subnet-2 as external gateway
- connection, then Neutron swaps connected route to Subnet-1 with same
- route but through Subnet-2 interface (3rd entry in the following
- sequence):
+ }}}
+ using Subnet-1 as LAN connection and Subnet-2 as external gateway connection, then Neutron swaps connected route to Subnet-1 with same route but through Subnet-2 interface (3rd entry in the following sequence):
  
  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']
  
  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.
  
  Proposed solution:
  
  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.
  
  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).
  
  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04
  
  Thank you.

** Description changed:

  Hi colleagues,
  
  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).
  
  If VR connected to subnets belonging to same network (preformatted scheme also is at https://pastebin.com/AesqkcXa) :
- {{{
+ <pre>
                     E-Network
    +------------------------------------------+
      Subnet-1                        Subnet-2
    +---+----+--+                  +----+------+
        |    |        +----+            |
     VM-+    |        |    |            |
             +--------+ VR +------------+
                     /|    |\
           qr-64.. -/ 0----+ \- qg-16..
- }}}
+ </pre>
  using Subnet-1 as LAN connection and Subnet-2 as external gateway connection, then Neutron swaps connected route to Subnet-1 with same route but through Subnet-2 interface (3rd entry in the following sequence):
  
  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']
  
  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.
  
  Proposed solution:
  
  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.
  
  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).
  
  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04
  
  Thank you.

** Description changed:

  Hi colleagues,
  
  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).
  
- If VR connected to subnets belonging to same network (preformatted scheme also is at https://pastebin.com/AesqkcXa) :
- <pre>
+ If VR connected to subnets belonging to same network (preformatted
+ scheme also is at https://pastebin.com/AesqkcXa) :
+ 
                     E-Network
    +------------------------------------------+
      Subnet-1                        Subnet-2
    +---+----+--+                  +----+------+
        |    |        +----+            |
     VM-+    |        |    |            |
             +--------+ VR +------------+
                     /|    |\
           qr-64.. -/ 0----+ \- qg-16..
- </pre>
- using Subnet-1 as LAN connection and Subnet-2 as external gateway connection, then Neutron swaps connected route to Subnet-1 with same route but through Subnet-2 interface (3rd entry in the following sequence):
+ 
+ using Subnet-1 as LAN connection and Subnet-2 as external gateway
+ connection, then Neutron swaps connected route to Subnet-1 with same
+ route but through Subnet-2 interface (3rd entry in the following
+ sequence):
  
  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']
  
  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.
  
  Proposed solution:
  
  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.
  
  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).
  
  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04
  
  Thank you.

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1755414

Title:
  VR replaces connected routes

Status in neutron:
  New

Bug description:
  Hi colleagues,

  The idea behind this design is to easily switch VM between different
  address scopes (e.g. "grey" addresses in Subnet-1 and "white" in
  Subnet-2), using same port/MAC (which always is in E-Network).

  If VR connected to subnets belonging to same network (preformatted
  scheme also is at https://pastebin.com/AesqkcXa) :

                     E-Network
    +------------------------------------------+
      Subnet-1                        Subnet-2
    +---+----+--+                  +----+------+
        |    |        +----+            |
     VM-+    |        |    |            |
             +--------+ VR +------------+
                     /|    |\
           qr-64.. -/ 0----+ \- qg-16..

  using Subnet-1 as LAN connection and Subnet-2 as external gateway
  connection, then Neutron swaps connected route to Subnet-1 with same
  route but through Subnet-2 interface (3rd entry in the following
  sequence):

  14:45:18.043 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '25.0.0.1/8', 'scope', 'global', 'dev', 'qr-64c53cf8-d9', 'brd', '25.255.255.255']
  14:45:19.815 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'addr', 'add', '51.x.x.x/24', 'scope', 'global', 'dev', 'qg-16bdddb1-d5', 'brd', '51.x.x.255']
  14:45:20.283 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', '25.0.0.0/8', 'dev', 'qg-16bdddb1-d5', 'scope', 'link']
  14:45:20.919 Running command: ['ip', 'netns', 'exec', 'qrouter-UUID', 'ip', '-4', 'route', 'replace', 'default', 'via', '51.x.x.254', 'dev', 'qg-16bdddb1-d5']

  which makes it impossible to communicate between VMs in Subnet-1 with
  the VR.

  Proposed solution:

  When creating VR, use "ip route add ... metric <LOWER>" for extra subnets of the interfaces. To achieve this:
  - function add_route() in ip_lib.py contain unconditional arg "replace" and add other args from function's parameters. If final "args" contains keywork "metric", then replace "replace" with "add".
  - when creating VR, add keyword "metric 20" (can be anything lower than connected metric) to all extra subnets.

  This will fix routing in case of conflict, will preserve routing model
  if there is no conflict and will preserve compatibility with other
  functions calling add_route (no keyword "metric" - no changes in
  behavior).

  Openstack: Pike
  Neutron: 11.0.2
  Ubuntu: 16.04

  Thank you.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1755414/+subscriptions


Follow ups