Trying to connect to host in Google Cloud Plataform - vpn

I need to connect to multiples IP's via GCP.
The range os IP's that I need to connect is 10.[0-255].68.[0-255] and 10.[0-255].71.[0-255]
But they are from an local network.
The problem is that my host in GCP is 10.128.0.25, so i think it's trying to connect to the range of IP's that I want, but from GCP locally.
How can I setup this?
It is like this:
vpn-1-tunnel-1-route-3
Description
Rotas de filiais
Network
default
Destination IP address range
10.0.0.0/8
Priority
100
Instance tags
etl-filiais
Next hop
vpn-1-tunnel-1
When I try to use traceroute -n 10.111.68.18 i get this:
1 * * *
2 * * *
.
.
.
29 * * *
30 * * *

If IP address ranges for on-premise subnets overlap with IP addresses used by subnets in your VPC network, refer to Order of routes to determine how routing conflicts are resolved.
On GCP config, Destination IP address range 10.0.0.0/8 is correct.
On Peer router, advertising next hop should be your Peer VPN gateway.
Please refer to Interop guides by vendor for configuration and Cloud VPN.

Related

Unable to SSH into VM instance on Google Cloud Platform

I have created a firewall rule in VPC network for port 22 by assigning an IP with the port e.g (192.168.xx.yy) instead of 0.0.0.0/0 in the rules. Now, when I create a compute engine VM instance in Google Cloud Platform and SSH into it, it states that "cannot connect to port 22".
I don't want the port tcp:22 to have ip range 0.0.0.0/0 but only have a single ip as stated above? How can I solve this issue?
The 192.168.x.x is an internal IP address, and in your situation would apply to a VM instance within the same network as the instance you want to connect to.
If you want to connect from outside that network, you'll need to set the source of the firewall rule to the external IP of the instance/machine you want to connect from. You can get your external IP by going to https://whatismyipaddress.com for example.
The firewall rule setting would be something like this:
Direction of traffic: Ingress
Action on match: Allow
Targets: Specified target tags (for example)
Source filter: IP ranges
Source IP ranges: x.x.x.x/32 (your external IP)
If you would not like to have your GCE instance's port 22 open to internet, but you would like to connect to it, I propose you 2 different solutions:
Create a bastion host. This VM is a proxy to access to your GCE instances. You log into the bastion and then you can perform a ssh hop to your GCE instance. Only the bastion host is opened to internet on port 22. And you can start this Bastion VM only when you need to connect to your others GCE instances, that increase the security and decrease the risk of attack on this "backdoor" instance.
For both the bastion and for directly reaching your VM on port 22, you can limit the source IP of your firewall rule to your current IP.
But remember, the IP is not a source of truth.

local area IP Routing

I am using fiber internet service that company give me a device which assign me local ip like 192.168.0.1 ,2,3 and so on to my computer/ Laptop . but I want to change my local area ip like 172.15.15.1 etc. how to route my Ip
Thanks
Well since the ip is assigned by the service provider they are probably using DHCP server to assign you ip. So you are getting those segment ip's, these are basically private class c ip address. In order to get different range of IP's you can put your intermediate router and configure it to provide private class B IP address.You might need a cross cable to connect both the routers.

OpenStack Floating ip assoicated to virtual ip

I am trying to perform a POC,
I have configured a virtual ip ( implemented by keepalived) that will be moving from vm1 to vm2 in case vm1 in not avilbale.
Details:
vm1 - 10.0.0.1(internal), 192.168.10.10(floating ip)
vm1 - 10.0.0.2(internal), 192.168.10.11(floating ip)
vip - 10.0.0.110(virtual ip -internal)
vipEXT - 192.168.10.13(virtual ip -floating)
The internal part is working fine, I followed the instruction and was able to make the vip-10.0.0.110 address to migrate from vm1 to vm2 in case vm1 fails,
I have created a floating ip with 192.168.10.13 address and assoicated with the vip port but still cant access to vip(10.0.0.110) from vipEXT(192.168.10.13).
The status of the of this floating ip is Down,
Do you have any sugestions?
I was able to solve it by following this blog:
[https://blog.codecentric.de/en/2016/11/highly-available-vips-openstack-vmsrrp
This setup was working only after I created a new Router using the '--centralized' flag instead the '--distributed' that come as default in my case.

OpenStack neutron subnet - create port with ip address after network address

I have this neutron private subnet 10.200.206.0/23
when I created a port using this subnet, it should give me 10.200.206.1 as I expected since nobody uses this .1 ip yet.
Instead it gave me 10.200.206.20
Note this subnet had been used previously and deleted all ports/ip that used by other instances. I am 100% that this ip 10.200.206.1 is not in-used.
DHCP is disabled.
Can we actually reset the old info from this subnet in OpenStack DB backend?
Once you start using a subnet, Neutron DB will keep track of used IP addresses and doesn't reassign until all the addresses are used once.
Easiest way to reset is to remove the subnet and recreate it again.

How do I configure vpc to allow outbound traffic over customer gateway

I have configured a vpc to communicate with an on-prem private network as outlined here I am able to ping servers in my on-prem network through the virtual gateway. I have two private subnets and my route table associated with each of those subnets is configured as below:
10.255.254.0/23 local
0.0.0.0/0 vgw-xxxxxxx
My expectation is that all of my traffic, internet or otherwise is being communicated over the vgw to the cgw and then be subject to our on-premise firewall policies. In fact the article linked above specifically says that is the case:
The instances in the VPN-only subnet can't reach the Internet directly; any Internet-bound traffic must first traverse the virtual private gateway to your network, where the traffic is then subject to your firewall and corporate security policies.
When running a server on one of the private subnets the output from traceroute looks like this:
My traceroute to www.google.com looks like this:
as you can see from above traffic to www.google.com is just dying on the first hop.
I know that this can be achieved by adding a NAT to the public subnet, but I would prefer that all traffic flow through the on prem network instead.
What piece am I missing to make this work?

Resources