Cloudcomputing Kochbuch Netzwerk

IMT:HilfeWiki - das Wiki
Wechseln zu: Navigation, Suche
Anleitung
Allgemeine Informationen
Informationen
Betriebssystem Alle
Service Cloudcomputing
Interessant für Angestellte, Studierende und Gäste
HilfeWiki des IMT der Uni Paderborn

Wichtiger Hinweis: Um diese Anleitung nutzen zu können wird ein Kommandozeilen-Client benötigt. Die Bespiele in diesem Kochbuch sind mit den OpenStack Command-line Clients 2.3.0 aus Ubuntu 16.04.1 LTS erzeugt. Neuere Clients können eine etwas andere Aufruf-Syntax haben.

Informationen zum Erzeugen der Kommandozeilen-Clients

Bis auf Ausnahmen lassen sich alle Einstellungen auch im Dashboard vornehmen. Beachten Sie bitte den Artikel Cloudcomputing Aktuelle Informationen.

Rezepte

Netzwerke

Auflisten der verfügbaren privaten Netzwerke / Subnetze

ubuntu@api-kochbuch-demo:~$ openstack network list
+--------------------------------------+-----------------------------+--------------------------------------+
| ID                                   | Name                        | Subnets                              |
+--------------------------------------+-----------------------------+--------------------------------------+
| 389c0736-788b-4b00-ba95-9b93031b4099 | physext_uni_services        | 95f1b75e-3f5b-4477-9e3d-6be47bea3b2b |
| 0a2cafd5-3a3f-4312-95fe-584240ab1a3b | Privates-Kochbuch-Test-Netz | 71851d4c-9578-4e13-935c-d2ea6eddf5fd |
+--------------------------------------+-----------------------------+--------------------------------------+


ubuntu@api-kochbuch-demo:~$ openstack subnet list
+--------------------------------------+--------------------------------+--------------------------------------+------------------+
| ID                                   | Name                           | Network                              | Subnet           |
+--------------------------------------+--------------------------------+--------------------------------------+------------------+
| 95f1b75e-3f5b-4477-9e3d-6be47bea3b2b | public-uni-services            | 389c0736-788b-4b00-ba95-9b93031b4099 | 192.26.178.0/23  |
| 71851d4c-9578-4e13-935c-d2ea6eddf5fd | Privates-Kochbuch-Test-Subnetz | 0a2cafd5-3a3f-4312-95fe-584240ab1a3b | 192.168.0.0/24   |
+--------------------------------------+--------------------------------+--------------------------------------+------------------+


Erzeugen eines neuen privaten Netzwerkes und Subnetzes

ubuntu@api-kochbuch-demo:~$ openstack network create Privates-Kochbuch-Test-Netz
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        |                                      |
| created_at                | 2016-09-21T08:52:34                  |
| description               |                                      |
| headers                   |                                      |
| id                        | 0a2cafd5-3a3f-4312-95fe-584240ab1a3b |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| mtu                       | 1450                                 |
| name                      | Privates-Kochbuch-Test-Netz          |
| project_id                | 3ceb7c480ede4680bb42be90b365375d     |
| provider:network_type     | vxlan                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 108                                  |
| router_external           | Internal                             |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tags                      | []                                   |
| updated_at                | 2016-09-21T08:52:34                  |
+---------------------------+--------------------------------------+


ubuntu@api-kochbuch-demo:~$ neutron subnet-create \
    --name Privates-Kochbuch-Test-Subnetz \
    --gateway 192.168.0.1 \
    --allocation-pool start=192.168.0.100,end=192.168.0.200 \
    --dns-nameserver 131.234.137.23 \
    --enable-dhcp \
    Privates-Kochbuch-Test-Netz 192.168.0.0/24
 
Created a new subnet:
+-------------------+----------------------------------------------------+
| Field             | Value                                              |
+-------------------+----------------------------------------------------+
| allocation_pools  | {"start": "192.168.0.100", "end": "192.168.0.200"} |
| cidr              | 192.168.0.0/24                                     |
| created_at        | 2016-09-21T08:58:14                                |
| description       |                                                    |
| dns_nameservers   | 131.234.137.23                                     |
| enable_dhcp       | True                                               |
| gateway_ip        | 192.168.0.1                                        |
| host_routes       |                                                    |
| id                | 71851d4c-9578-4e13-935c-d2ea6eddf5fd               |
| ip_version        | 4                                                  |
| ipv6_address_mode |                                                    |
| ipv6_ra_mode      |                                                    |
| name              | Privates-Kochbuch-Test-Subnetz                     |
| network_id        | 0a2cafd5-3a3f-4312-95fe-584240ab1a3b               |
| subnetpool_id     |                                                    |
| tenant_id         | 3ceb7c480ede4680bb42be90b365375d                   |
| updated_at        | 2016-09-21T08:58:14                                |
+-------------------+----------------------------------------------------+
ubuntu@api-kochbuch-demo:~$


Löschen eines privaten Netzwerkes und Subnetzes

Router

Auflisten der verfügbaren Router

ubuntu@api-kochbuch-demo:~$ openstack router list
+--------------------------------------+--------------------------+--------+-------+-------------+-------+----------------------------------+
| ID                                   | Name                     | Status | State | Distributed | HA    | Project                          |
+--------------------------------------+--------------------------+--------+-------+-------------+-------+----------------------------------+
| cf727321-314b-4b8e-a2e4-c9cb698ed5aa | Privates-Kochbuch-Router | ACTIVE | UP    | False       | False | 3ceb7c480ede4680bb42be90b365375d |
+--------------------------------------+--------------------------+--------+-------+-------------+-------+----------------------------------+

Erzeugen eines neuen Routers und Anschluss an ein öffentliches und privates Netzwerk

Einen neuen Router erzeugen.

ubuntu@api-kochbuch-demo:~$ openstack router create Kochbuch-Router
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | UP                                   |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| description             |                                      |
| distributed             | False                                |
| external_gateway_info   | null                                 |
| ha                      | False                                |
| headers                 |                                      |
| id                      | cf727321-314b-4b8e-a2e4-c9cb698ed5aa |
| name                    | Privates-Kochbuch-Router             |
| routes                  | []                                   |
| status                  | ACTIVE                               |
| project_id              | 3ceb7c480ede4680bb42be90b365375d     |
+-------------------------+--------------------------------------+

Ein externes Netz suchen und darauf das Default Gateway für den Router setzen.

ubuntu@api-kochbuch-demo:~$ openstack network list --external
+--------------------------------------+----------------------+--------------------------------------+
| ID                                   | Name                 | Subnets                              |
+--------------------------------------+----------------------+--------------------------------------+
| 389c0736-788b-4b00-ba95-9b93031b4099 | physext_uni_services | 95f1b75e-3f5b-4477-9e3d-6be47bea3b2b |
| 01d1efee-5e1a-4862-aa8f-ec5892c812ac | physext_f5_net       | eaa56c84-2c74-4c1e-ba96-b6ebe49775c6 |
| 75beb77f-5c0b-40c9-8d2b-8776a6d1d803 | physext_dmz_uni      | ab9b6746-76c1-4b9c-8655-337af7d949bd |
| 069f5b91-36e8-4dff-994d-03992ea5cc1a | physext_private_uni  | 575e18e6-9a7f-4f8a-a687-446cfc002b00 |
| 7c0dc669-1de9-4011-9c00-01232859ba64 | physext_public_uni   | 5e1d3b8b-9830-4a3f-baf3-80c93fec76ed |
+--------------------------------------+----------------------+--------------------------------------+


ubuntu@api-kochbuch-demo:~$ neutron router-gateway-set Privates-Kochbuch-Router physext_public_uni
Set gateway for router Privates-Kochbuch-Router


Das passende private Subnetz suchen und hier auch ein Interface erzeugen. Dieses Interface ist gleichzeitig das Default-Gateway für die Maschinen im private Subnetz.

ubuntu@api-kochbuch-demo:~$ neutron subnet-list 
+--------------------------------------+--------------------------------+------------------+------------------------------------------------------+
| id                                   | name                           | cidr             | allocation_pools                                     |
+--------------------------------------+--------------------------------+------------------+------------------------------------------------------+
| 95f1b75e-3f5b-4477-9e3d-6be47bea3b2b | public-uni-services            | 192.26.178.0/23  | {"start": "192.26.178.2", "end": "192.26.179.254"}   |
| 71851d4c-9578-4e13-935c-d2ea6eddf5fd | Privates-Kochbuch-Test-Subnetz | 192.168.0.0/24   | {"start": "192.168.0.100", "end": "192.168.0.200"}   |
+--------------------------------------+--------------------------------+------------------+------------------------------------------------------+


ubuntu@api-kochbuch-demo:~$ neutron router-interface-add Privates-Kochbuch-Router Privates-Kochbuch-Test-Subnetz
Added interface 66fa4e0d-b9f3-493c-8363-cd3872cb98c5 to router Privates-Kochbuch-Router.


Eine kurz Kontrolle ob alle Interfaces korrekt sind.

ubuntu@api-kochbuch-demo:~$ neutron router-show Privates-Kochbuch-Router
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field                   | Value                                                                                                                                                                                     |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up          | True                                                                                                                                                                                      |
| availability_zone_hints |                                                                                                                                                                                           |
| availability_zones      | nova                                                                                                                                                                                      |
| description             |                                                                                                                                                                                           |
| distributed             | False                                                                                                                                                                                     |
| external_gateway_info   | {"network_id": "7c0dc669-1de9-4011-9c00-01232859ba64", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "5e1d3b8b-9830-4a3f-baf3-80c93fec76ed", "ip_address": "192.26.184.41"}]} |
| ha                      | False                                                                                                                                                                                     |
| id                      | cf727321-314b-4b8e-a2e4-c9cb698ed5aa                                                                                                                                                      |
| name                    | Privates-Kochbuch-Router                                                                                                                                                                  |
| routes                  |                                                                                                                                                                                           |
| status                  | ACTIVE                                                                                                                                                                                    |
| tenant_id               | 3ceb7c480ede4680bb42be90b365375d                                                                                                                                                          |
+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 
ubuntu@api-kochbuch-demo:~$ neutron router-port-list Privates-Kochbuch-Router
+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                                                            |
+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------------+
| 5c4eeefa-0461-444c-a73b-7ddf6f73834f |      | fa:16:3e:0e:b7:53 | {"subnet_id": "5e1d3b8b-9830-4a3f-baf3-80c93fec76ed", "ip_address": "192.26.184.41"} |
| 66fa4e0d-b9f3-493c-8363-cd3872cb98c5 |      | fa:16:3e:4b:10:0d | {"subnet_id": "71851d4c-9578-4e13-935c-d2ea6eddf5fd", "ip_address": "192.168.0.1"}   |
+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------------+

In der Netzwerktopologie Ansicht des Dashboards sollte folgendes dargestellt werden.

Cloudcomputing-Kochbuch-Netzwerktopologie.png

Löschen eines Routers


Bei Fragen oder Problemen wenden Sie sich bitte an die IMT:Benutzerberatung

Notebook-Café BI1.111 IMT:ServicePoint N5.345 Tel.: +49 (5251) 60-5544 E-Mail: imt@uni-paderborn.de