===== Scenario: Two VMs connected to public network via private network. =====
Links:
* https://blogs.oracle.com/ronen/entry/diving_into_openstack_network_architecture3
* http://docs.openstack.org/user-guide/dashboard_create_networks.html
==== Prerequisite ====
* [[https://wiki.opnfv.org/copper/copper_work_items/academy/foreman|Bare-metal Multi-node single-NIC install using Foreman]]
* On controller, setup CLI environment for access to OpenStack APIs
* http://docs.openstack.org/user-guide/common/cli_set_environment_variables_using_openstack_rc.html
* Horizon: select Project / Access & Security / Download OpenStack RC File
[root@oscontroller1 ~]# vi admin-openrc.sh
# (paste admin-openrc.sh contents downloaded)
[root@oscontroller1 ~]# source admin-openrc.sh
==== Verification Procedure =====
1) Create image cirros-0.3.3-x86_64
* Horizon: From Project / Compute / Images, select "Create Image". Set options Name "cirros-0.3.3-x86_64", Image Location "http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img", Format "QCOW2", Architecture "x86_64", (leave other options as-is or blank), and select "Create Image".
* CLI:
2) Verify that an external network and subnet exists (subnet "192.168.1.0/24", no DHCP) in Project / Network / Networks. For base-metal single-NIC non-HA install, you may need to create the external network via the CLI, if not already created as in [[https://wiki.opnfv.org/copper/copper_work_items/academy/foreman|Bare-metal Multi-node single-NIC install using Foreman]].
* Horizon: apparently no current (Juno) option to designate a new network as "external". Have to do this via the CLI
* CLI:
[root@oscontroller1 ~]# neutron net-create external1 -- --router:external=true --provider:network_type=flat --provider:physical_network=physnet1
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| id | d7868a94-47ec-4ec7-93cc-645d3bc45898 |
| name | external1 |
| provider:network_type | flat |
| provider:physical_network | physnet1 |
| provider:segmentation_id | |
| router:external | True |
| shared | False |
| status | ACTIVE |
| subnets | |
| tenant_id | c3b15e900f0f4c7ab01576bb28d34f10 |
+---------------------------+--------------------------------------+
[root@oscontroller1 ~]# neutron subnet-create --disable-dhcp external1 192.168.1.0/24
Created a new subnet:
+-------------------+--------------------------------------------------+
| Field | Value |
+-------------------+--------------------------------------------------+
| allocation_pools | {"start": "192.168.1.2", "end": "192.168.1.254"} |
| cidr | 192.168.1.0/24 |
| dns_nameservers | |
| enable_dhcp | False |
| gateway_ip | 192.168.1.1 |
| host_routes | |
| id | 2a6a6be2-2ea2-4a38-84cd-3a2e9e3197e8 |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | |
| network_id | d7868a94-47ec-4ec7-93cc-645d3bc45898 |
| tenant_id | c3b15e900f0f4c7ab01576bb28d34f10 |
+-------------------+--------------------------------------------------+
3) Create internal network.
* Horizon: From Project / Network / Networks, select "Create Network". Set options Name "internal1", select "Next", Subnet Name "internal1", Network Address "10.0.0.1/24", select "Next" (leave other options as-is or blank), Allocation Pools "10.0.0.2,10.0.0.254", DNS Name Servers "8.8.8.8", select "Create" (leave other options as-is or blank).
* CLI:
4) Create router
* Horizon: From Project / Network / Routers, select "Create Router". Set options Name "external", Connected External Network: external1, Select "Set Gateway", select External Network "external1", and select "Set Gateway". Select elect "Add Interface" (leave other options as-is or blank).
* CLI:
5) Add internal network interface to the router.
* Horizon: From Project / Network / Routers, select router "external", and select "Add Interface". Select Subnet "internal", and select "Add Interface" (leave other options as-is or blank). Note: you may get disconnected fromt the Controller node for a short time
* CLI:
6) Launch images
* Horizon: From Project / Compute / Images, select "Launch" for image "cirros-0.3.3-x86_64". Select Name "cirros-1", network "internal", and "Launch". Leave other options as-is or blank. Repeat for instance "cirros-2".
* CLI:
7) Verify connectivity from VMs.
* Horizon: From Project / Compute / Instances, select "cirros-1" and "Console", and login with account "cirros" / "cubswin:)". Ping address of cirros-2 as shown in Horizon, 192.168.1.1 (external router), and opnfv.org (to validate DNS operation).