networking-l2gw


Namenetworking-l2gw JSON
Version 20.0.0 PyPI version JSON
download
home_pagehttps://opendev.org/x/networking-l2gw
SummaryAPIs and implementations to support L2 Gateways in Neutron.
upload_time2023-10-02 15:39:02
maintainer
docs_urlNone
authorOpenStack
requires_python>=3.8
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===============
networking-l2gw
===============

API's and implementations to support L2 Gateways in Neutron.

* Free software: Apache license
* Source: https://opendev.org/x/networking-l2gw

L2 Gateways
-----------

This project proposes a Neutron API extension that can be used to express
and manage L2 Gateway components. In the simplest terms L2 Gateways are meant
to bridge two or more networks together to make them look at a single L2
broadcast domain.

Initial implementation
----------------------

There are a number of use cases that can be addressed by an L2 Gateway API.
Most notably in cloud computing environments, a typical use case is bridging
the virtual with the physical. Translate this to Neutron and the OpenStack
world, and this means relying on L2 Gateway capabilities to extend Neutron
logical (overlay) networks into physical (provider) networks that are outside
the OpenStack realm. These networks can be, for instance, VLAN's that may or
may not be managed by OpenStack.

More information
----------------

For help using or hacking on L2GW, you can send an email to the
`OpenStack Discuss Mailing List <mailto:openstack-discuss@lists.openstack.org>`;
please use the [L2-Gateway] Tag in the subject. Most folks involved hang out on
the IRC channel #openstack-neutron.

Getting started
---------------

To get started you have to install the l2gw plugin software on the Controller
node where you are already running the Neutron server. Then you need a new
node, that we call the l2gw node, where you do the actual bridging between a
vxlan tenant network and a physical network. The l2gw node could be a bare
metal switch that supports the OVSDB schema, or a server with OVS installed. In
this example we are going to use a server.

In this example the l2gw node has a `ens5` interface attached to a physical
segment, and a management interface with IP 10.225.0.27.

::

  ip link set up dev ens5
  apt-get update
  apt-get install openvswitch-vtep
  ovsdb-tool create /etc/openvswitch/vtep.db /usr/share/openvswitch/vtep.ovsschema
  ovsdb-tool create /etc/openvswitch/vswitch.db /usr/share/openvswitch/vswitch.ovsschema
  # Stop OVS services started by the installer.
  systemctl is-active --quiet ovs-vswitchd && systemctl stop ovs-vswitchd
  systemctl is-active --quiet ovsdb-server && systemctl stop ovsdb-server
  mkdir -p /var/run/openvswitch/
  ovsdb-server --pidfile --detach --log-file --remote ptcp:6632:10.225.0.27 \
               --remote punix:/var/run/openvswitch/db.sock --remote=db:hardware_vtep,Global,managers \
               /etc/openvswitch/vswitch.db /etc/openvswitch/vtep.db
  ovs-vswitchd --log-file --detach --pidfile unix:/var/run/openvswitch/db.sock
  ovs-vsctl add-br myphyswitch
  vtep-ctl add-ps myphyswitch
  vtep-ctl set Physical_Switch myphyswitch tunnel_ips=10.225.0.27
  ovs-vsctl add-port myphyswitch ens5
  vtep-ctl add-port myphyswitch ens5
  /usr/share/openvswitch/scripts/ovs-vtep \
               --log-file=/var/log/openvswitch/ovs-vtep.log \
               --pidfile=/var/run/openvswitch/ovs-vtep.pid \
               --detach myphyswitch

At this point your l2gw node is running.

For the configuration of the Openstack control plane you have to check three files:
``neutron.conf``, `l2gw_plugin.ini <https://opendev.org/x/networking-l2gw/src/commit/b20b90d7694f8c47e2275bc17995f4854eedf6ae/etc/l2gw_plugin.ini>`__, 
and `l2gateway_agent.ini <https://opendev.org/x/networking-l2gw/src/commit/b20b90d7694f8c47e2275bc17995f4854eedf6ae/etc/l2gateway_agent.ini>`__
Edit your ``neutron.conf`` on the controller node and make sure that in the ``service_plugins`` you have the string
``networking_l2gw.services.l2gateway.plugin.L2GatewayPlugin``.

You can add it with:
::

  sudo sed -ri 's/^(service_plugins.*)/\1,networking_l2gw.services.l2gateway.plugin.L2GatewayPlugin/' \
     /etc/neutron/neutron.conf

Make sure the neutron-server runs with ``--config-file=/etc/neutron/l2gw_plugin.ini``.
The default for the l2gw_plugin.ini file should be okay.

Now you are ready to create the database tables for the neutron l2gw plugin using the command:
``neutron-db-manage upgrade heads``

The file `l2gateway_agent.ini <https://opendev.org/x/networking-l2gw/src/commit/b20b90d7694f8c47e2275bc17995f4854eedf6ae/etc/l2gateway_agent.ini>`__ is used to configure the neutron-l2gateway agent.
The agent is the piece of software that will configure the l2gw node when you interact with the Openstack API.
Here it is important to give the pointer to the switch.
``ovsdb_hosts = 'ovsdb1:10.225.0.27:6632'``

The name ``ovsdb1`` is just a name that will be used in the Openstack database to identify this switch.

Now that both the l2gw node and the Openstack control plane are configured, we can use the API service to bridge a VXLAN tenant network to a physical interface of the l2gw node.

First let's create in Openstack a l2-gateway object. We need to give the interface names and the name of the bridge that we used before in the OVS commands.

``l2-gateway-create --device name="myphyswitch",interface_names="ens5" openstackname``

Use the <GATEWAY-NAME/UUID> just created to feed the second command where you do the actual bridging between the VXLAN tenant network and the Physical L2 network.

``l2-gateway-connection-create <GATEWAY-NAME/UUID> <NETWORK-NAME/UUID>``

Now let's see what happened. On the l2gw node you can do the commands:
::

  ovs-vsctl show
  vtep-ctl show

You should see some VXLAN tunnels are created. You will see a vxlan tunnel to each compute node that is hosting an
instance attached to the tenant network that you bridge. If there is also a router in this tenant network,
you will find a VXLAN tunnel also to the network node.

References:
 * http://networkop.co.uk/blog/2016/05/21/neutron-l2gw/
 * http://kimizhang.com/neutron-l2-gateway-hp-5930-switch-ovsdb-integration/
 * http://openvswitch.org/support/dist-docs-2.5/vtep/README.ovs-vtep.md.html




            

Raw data

            {
    "_id": null,
    "home_page": "https://opendev.org/x/networking-l2gw",
    "name": "networking-l2gw",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "OpenStack",
    "author_email": "openstack-discuss@lists.openstack.org",
    "download_url": "https://files.pythonhosted.org/packages/e3/31/7836b6a7163fe7f8fccb1e62544edaafc3981270152b6774608a16c60f2e/networking-l2gw-20.0.0.tar.gz",
    "platform": null,
    "description": "===============\nnetworking-l2gw\n===============\n\nAPI's and implementations to support L2 Gateways in Neutron.\n\n* Free software: Apache license\n* Source: https://opendev.org/x/networking-l2gw\n\nL2 Gateways\n-----------\n\nThis project proposes a Neutron API extension that can be used to express\nand manage L2 Gateway components. In the simplest terms L2 Gateways are meant\nto bridge two or more networks together to make them look at a single L2\nbroadcast domain.\n\nInitial implementation\n----------------------\n\nThere are a number of use cases that can be addressed by an L2 Gateway API.\nMost notably in cloud computing environments, a typical use case is bridging\nthe virtual with the physical. Translate this to Neutron and the OpenStack\nworld, and this means relying on L2 Gateway capabilities to extend Neutron\nlogical (overlay) networks into physical (provider) networks that are outside\nthe OpenStack realm. These networks can be, for instance, VLAN's that may or\nmay not be managed by OpenStack.\n\nMore information\n----------------\n\nFor help using or hacking on L2GW, you can send an email to the\n`OpenStack Discuss Mailing List <mailto:openstack-discuss@lists.openstack.org>`;\nplease use the [L2-Gateway] Tag in the subject. Most folks involved hang out on\nthe IRC channel #openstack-neutron.\n\nGetting started\n---------------\n\nTo get started you have to install the l2gw plugin software on the Controller\nnode where you are already running the Neutron server. Then you need a new\nnode, that we call the l2gw node, where you do the actual bridging between a\nvxlan tenant network and a physical network. The l2gw node could be a bare\nmetal switch that supports the OVSDB schema, or a server with OVS installed. In\nthis example we are going to use a server.\n\nIn this example the l2gw node has a `ens5` interface attached to a physical\nsegment, and a management interface with IP 10.225.0.27.\n\n::\n\n  ip link set up dev ens5\n  apt-get update\n  apt-get install openvswitch-vtep\n  ovsdb-tool create /etc/openvswitch/vtep.db /usr/share/openvswitch/vtep.ovsschema\n  ovsdb-tool create /etc/openvswitch/vswitch.db /usr/share/openvswitch/vswitch.ovsschema\n  # Stop OVS services started by the installer.\n  systemctl is-active --quiet ovs-vswitchd && systemctl stop ovs-vswitchd\n  systemctl is-active --quiet ovsdb-server && systemctl stop ovsdb-server\n  mkdir -p /var/run/openvswitch/\n  ovsdb-server --pidfile --detach --log-file --remote ptcp:6632:10.225.0.27 \\\n               --remote punix:/var/run/openvswitch/db.sock --remote=db:hardware_vtep,Global,managers \\\n               /etc/openvswitch/vswitch.db /etc/openvswitch/vtep.db\n  ovs-vswitchd --log-file --detach --pidfile unix:/var/run/openvswitch/db.sock\n  ovs-vsctl add-br myphyswitch\n  vtep-ctl add-ps myphyswitch\n  vtep-ctl set Physical_Switch myphyswitch tunnel_ips=10.225.0.27\n  ovs-vsctl add-port myphyswitch ens5\n  vtep-ctl add-port myphyswitch ens5\n  /usr/share/openvswitch/scripts/ovs-vtep \\\n               --log-file=/var/log/openvswitch/ovs-vtep.log \\\n               --pidfile=/var/run/openvswitch/ovs-vtep.pid \\\n               --detach myphyswitch\n\nAt this point your l2gw node is running.\n\nFor the configuration of the Openstack control plane you have to check three files:\n``neutron.conf``, `l2gw_plugin.ini <https://opendev.org/x/networking-l2gw/src/commit/b20b90d7694f8c47e2275bc17995f4854eedf6ae/etc/l2gw_plugin.ini>`__, \nand `l2gateway_agent.ini <https://opendev.org/x/networking-l2gw/src/commit/b20b90d7694f8c47e2275bc17995f4854eedf6ae/etc/l2gateway_agent.ini>`__\nEdit your ``neutron.conf`` on the controller node and make sure that in the ``service_plugins`` you have the string\n``networking_l2gw.services.l2gateway.plugin.L2GatewayPlugin``.\n\nYou can add it with:\n::\n\n  sudo sed -ri 's/^(service_plugins.*)/\\1,networking_l2gw.services.l2gateway.plugin.L2GatewayPlugin/' \\\n     /etc/neutron/neutron.conf\n\nMake sure the neutron-server runs with ``--config-file=/etc/neutron/l2gw_plugin.ini``.\nThe default for the l2gw_plugin.ini file should be okay.\n\nNow you are ready to create the database tables for the neutron l2gw plugin using the command:\n``neutron-db-manage upgrade heads``\n\nThe file `l2gateway_agent.ini <https://opendev.org/x/networking-l2gw/src/commit/b20b90d7694f8c47e2275bc17995f4854eedf6ae/etc/l2gateway_agent.ini>`__ is used to configure the neutron-l2gateway agent.\nThe agent is the piece of software that will configure the l2gw node when you interact with the Openstack API.\nHere it is important to give the pointer to the switch.\n``ovsdb_hosts = 'ovsdb1:10.225.0.27:6632'``\n\nThe name ``ovsdb1`` is just a name that will be used in the Openstack database to identify this switch.\n\nNow that both the l2gw node and the Openstack control plane are configured, we can use the API service to bridge a VXLAN tenant network to a physical interface of the l2gw node.\n\nFirst let's create in Openstack a l2-gateway object. We need to give the interface names and the name of the bridge that we used before in the OVS commands.\n\n``l2-gateway-create --device name=\"myphyswitch\",interface_names=\"ens5\" openstackname``\n\nUse the <GATEWAY-NAME/UUID> just created to feed the second command where you do the actual bridging between the VXLAN tenant network and the Physical L2 network.\n\n``l2-gateway-connection-create <GATEWAY-NAME/UUID> <NETWORK-NAME/UUID>``\n\nNow let's see what happened. On the l2gw node you can do the commands:\n::\n\n  ovs-vsctl show\n  vtep-ctl show\n\nYou should see some VXLAN tunnels are created. You will see a vxlan tunnel to each compute node that is hosting an\ninstance attached to the tenant network that you bridge. If there is also a router in this tenant network,\nyou will find a VXLAN tunnel also to the network node.\n\nReferences:\n * http://networkop.co.uk/blog/2016/05/21/neutron-l2gw/\n * http://kimizhang.com/neutron-l2-gateway-hp-5930-switch-ovsdb-integration/\n * http://openvswitch.org/support/dist-docs-2.5/vtep/README.ovs-vtep.md.html\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "APIs and implementations to support L2 Gateways in Neutron.",
    "version": "20.0.0",
    "project_urls": {
        "Homepage": "https://opendev.org/x/networking-l2gw"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2541136d6d416c6db57d805e74808af4cde835a226f39c69ab65d1edf7992336",
                "md5": "ed524a7a78304326499a9f97dd82b4d8",
                "sha256": "fa58458847c5b26821f41febdeaa85ea035058c944163128e682d22ca2cda737"
            },
            "downloads": -1,
            "filename": "networking_l2gw-20.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ed524a7a78304326499a9f97dd82b4d8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 169274,
            "upload_time": "2023-10-02T15:39:00",
            "upload_time_iso_8601": "2023-10-02T15:39:00.798385Z",
            "url": "https://files.pythonhosted.org/packages/25/41/136d6d416c6db57d805e74808af4cde835a226f39c69ab65d1edf7992336/networking_l2gw-20.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e3317836b6a7163fe7f8fccb1e62544edaafc3981270152b6774608a16c60f2e",
                "md5": "7b85b245ad0228957a97119bcb6d16b9",
                "sha256": "6ea3dd5b8413a7f8fa213badee87c961391a557a445f4d91a07ab812f9d8f5df"
            },
            "downloads": -1,
            "filename": "networking-l2gw-20.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7b85b245ad0228957a97119bcb6d16b9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 169571,
            "upload_time": "2023-10-02T15:39:02",
            "upload_time_iso_8601": "2023-10-02T15:39:02.768868Z",
            "url": "https://files.pythonhosted.org/packages/e3/31/7836b6a7163fe7f8fccb1e62544edaafc3981270152b6774608a16c60f2e/networking-l2gw-20.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-02 15:39:02",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "networking-l2gw"
}
        
Elapsed time: 0.13133s