So I have installes Microstack in an Ubuntu 18.04 LTS PC. Well i can ssh to my VM from the host(where miccostack is installed), but my VM cannot access the Internet.
I have created an instance named osm and i have associated a floating ip to it.
(openstack) server list
+--------------------------------------+------+--------+-----------------------------------+------------+-----------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+------+--------+-----------------------------------+------------+-----------+
| e12dc245-da35-424a-a9b2-06067e2f5555 | osm | ACTIVE | test=192.168.222.246, 10.20.20.30 | ubuntu1804 | m1.medium |
+--------------------------------------+------+--------+-----------------------------------+------------+-----------+
This is my network list
(openstack) network list
+--------------------------------------+----------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+----------+--------------------------------------+
| c4968a12-662f-4ca6-8392-a6dc3f81e3ba | external | bcd86099-e801-477b-bf0c-978ec84bb708 |
| f83255dd-42d1-4fed-ad21-e9d1ec887fa8 | test | a7064161-4d11-4ca7-be55-47e5a6d92724 |
+--------------------------------------+----------+--------------------------------------+
Each network has its own subnet with these details: external-subnet
(openstack) subnet show external-subnet
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| allocation_pools | 10.20.20.1-10.20.20.82 |
| cidr | 10.20.20.0/24 |
| created_at | 2020-07-06T08:06:26Z |
| description | |
| dns_nameservers | 8.8.4.4, 8.8.8.8 |
| enable_dhcp | False |
| gateway_ip | 10.20.20.83 |
| host_routes | |
| id | bcd86099-e801-477b-bf0c-978ec84bb708 |
| ip_version | 4 |
| ipv6_address_mode | None |
| ipv6_ra_mode | None |
| location | Munch({'cloud': '', 'region_name': '', 'zone': None, 'project': Munch({'id': '54ba9ffa36ca424fac395b6c774fd2a3', 'name': 'admin', 'domain_id': None, 'domain_name': 'default'})}) |
| name | external-subnet |
| network_id | c4968a12-662f-4ca6-8392-a6dc3f81e3ba |
| prefix_length | None |
| project_id | 54ba9ffa36ca424fac395b6c774fd2a3 |
| revision_number | 22 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2020-10-12T10:49:35Z |
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
test-subnet
(openstack) subnet show test-subnet
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| allocation_pools | 192.168.222.2-192.168.222.254 |
| cidr | 192.168.222.0/24 |
| created_at | 2020-07-06T08:06:20Z |
| description | |
| dns_nameservers | 8.8.4.4, 8.8.8.8 |
| enable_dhcp | True |
| gateway_ip | 192.168.222.1 |
| host_routes | |
| id | a7064161-4d11-4ca7-be55-47e5a6d92724 |
| ip_version | 4 |
| ipv6_address_mode | None |
| ipv6_ra_mode | None |
| location | Munch({'cloud': '', 'region_name': '', 'zone': None, 'project': Munch({'id': '54ba9ffa36ca424fac395b6c774fd2a3', 'name': 'admin', 'domain_id': None, 'domain_name': 'default'})}) |
| name | test-subnet |
| network_id | f83255dd-42d1-4fed-ad21-e9d1ec887fa8 |
| prefix_length | None |
| project_id | 54ba9ffa36ca424fac395b6c774fd2a3 |
| revision_number | 7 |
| segment_id | None |
| service_types | |
| subnetpool_id | None |
| tags | |
| updated_at | 2020-10-12T10:49:52Z |
+-------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
These are the information about the router which is connected to the external and test network
(openstack) router list
+--------------------------------------+-------------+--------+-------+----------------------------------+-------------+-------+
| ID | Name | Status | State | Project | Distributed | HA |
+--------------------------------------+-------------+--------+-------+----------------------------------+-------------+-------+
| b935bc17-d379-4aa8-b040-5a770741de23 | test-router | ACTIVE | UP | 54ba9ffa36ca424fac395b6c774fd2a3 | False | False |
+--------------------------------------+-------------+--------+-------+----------------------------------+-------------+-------+
(openstack) router show test-router
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | nova |
| created_at | 2020-07-06T08:06:28Z |
| description | |
| distributed | False |
| external_gateway_info | {"network_id": "c4968a12-662f-4ca6-8392-a6dc3f81e3ba", "external_fixed_ips": [{"subnet_id": "bcd86099-e801-477b-bf0c-978ec84bb708", "ip_address": "10.20.20.83"}], "enable_snat": true} |
| flavor_id | None |
| ha | False |
| id | b935bc17-d379-4aa8-b040-5a770741de23 |
| interfaces_info | [{"port_id": "6f935a4f-e1b0-41bf-aefb-dd6f9b929f69", "ip_address": "192.168.222.1", "subnet_id": "a7064161-4d11-4ca7-be55-47e5a6d92724"}] |
| location | Munch({'cloud': '', 'region_name': '', 'zone': None, 'project': Munch({'id': '54ba9ffa36ca424fac395b6c774fd2a3', 'name': 'admin', 'domain_id': None, 'domain_name': 'default'})}) |
| name | test-router |
| project_id | 54ba9ffa36ca424fac395b6c774fd2a3 |
| revision_number | 23 |
| routes | |
| status | ACTIVE |
| tags | |
| updated_at | 2020-10-11T14:52:29Z |
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
My VM can ping 192.168.222.1(gateway),10.20.20.83(gateway),10.20.20.1(host-microstack) but cannot access the internet. For example i cannot ping 8.8.8.8
ubuntu@osm:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 10.20.20.30 icmp_seq=1 Destination Host Unreachable
From 10.20.20.30 icmp_seq=2 Destination Host Unreachable
From 10.20.20.30 icmp_seq=3 Destination Host Unreachable
From 10.20.20.30 icmp_seq=4 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 0 received, +4 errors, 100% packet loss, time 4055ms
pipe 3
I assume that maybe the problem is related to the fact that the status of the port at 10.20.20.30 is N/A, but I am not sure
(openstack) port list
+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------+--------+
| 029f8880-9e7c-4b9e-a8e8-b27496ec542e | | fa:16:3e:2e:ac:b5 | ip_address='10.20.20.30', subnet_id='bcd86099-e801-477b-bf0c-978ec84bb708' | N/A |
| 6f935a4f-e1b0-41bf-aefb-dd6f9b929f69 | | fa:16:3e:0d:65:36 | ip_address='192.168.222.1', subnet_id='a7064161-4d11-4ca7-be55-47e5a6d92724' | ACTIVE |
| 9c46a483-ee64-4d0a-8eb4-aa2b5cc083b7 | | fa:16:3e:66:da:8a | ip_address='10.20.20.83', subnet_id='bcd86099-e801-477b-bf0c-978ec84bb708' | ACTIVE |
| c2444040-b8d5-4009-8019-10779ecb7d92 | | fa:16:3e:4e:93:c8 | ip_address='192.168.222.246', subnet_id='a7064161-4d11-4ca7-be55-47e5a6d92724' | ACTIVE |
| cc79a6f2-a4c1-47de-b27b-9a2018dab595 | | fa:16:3e:e4:17:32 | ip_address='192.168.222.2', subnet_id='a7064161-4d11-4ca7-be55-47e5a6d92724' | ACTIVE |
+--------------------------------------+------+-------------------+--------------------------------------------------------------------------------+--------+
While I was searching for this issue I found that executing these commands to the host machine(where Microstack is installed) may fix the problem
sudo iptables -t nat -A POSTROUTING -s 10.20.20.1/24 ! -d 10.20.20.1/24 -j MASQUERADE
sudo sysctl net.ipv4.ip_forward=1
But unfortunatelly nothing happened and I still have this issue. Any piece of advice would be really helpful.