I am running Devstack on my machine and i would like to know if it is possible to ping an instance from Host. The default external network of Devstack is 172.24.4.0/24 and br-ex on Host has the IP 172.24.4.1. I launch an instance using the internal network of Devstack (192.168.233.0/24) and the instance gets the IP 192.168.233.100. My Host's IP is 192.168.1.10. Is there a way to ping 192.168.233.100 from my Host? Another thing i thought is to boot up a VM directly to the external network (172.24.4.0/24) but the VM does not boot up correctly. I can only use that network for associating floating IP's.
I have edited the security group and i have allowed ICMP and SSH, so this is not a problem.
Related
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.
I in a remote Server (I call it host machine) setup the OpenStack Ocata.
And in the OpenStack Ocata I created a VM, the VM use the Security Group (named allow ping & ssh), which is created by myself:
Now, I can use my Mac ping the VM. but can not ssh connect to the VM.
And in the VM(it's IP is 192.168.1.4 and floating IP is 103.35.202.3), I can ping 192.168.1.1 and 103.35.202.1(the host machine's public IP), but can not ping google.com or other public IP.
Why in my Mac I can ping the VM but can not ssh to it?
Why in the VM I can ping the host machine, but can not ping other public IP?
where is the issue?
Currently the only Egress traffic allowed out is for ICMP. Egress is missing for TCP/UDP. Add in Egress rules for both UDP (should help resolve the DNS issue) and TCP (should resolve the SSH issue.)
After adding in the Egress rules for TCP - test ssh again.
After adding in the Egress rules for UDP - test DNS resolution, if you are still running into issues then you may want to verify the DNS servers used when configuring the network.
I am running proxmox 4 with around 10 KVM and 14LXC.
I can configure ips and network from web GUI for LXC container.
I want to configure the Network interface For KVM without accessing the VM.
Is is possible to configure Network interface without accessing the VM.
As far as I know you can't configure the IP address in proxmox for a KVM vm (only for the lxc container you can define the ip address). For a KVM vm you can configure if the network connection is in Bridged mode or NAT.
For LXC containers you can use the pct command to set network for the container. More info about that on the Proxmox WIKI (scroll down to the Network section) - https://pve.proxmox.com/wiki/Linux_Container
What you could do for KVM would be to use a local DHCP server (you can install one on your proxmox if you want (apt-get install isc-dhcp-server). You have to define an ip address pool that will be assigned to your vms by the dhcp server.
Then configure the kvm machine using: qm command
qm set vmid options
From a man qm you discover this:
-net[n] [model=]<enum> [,bridge=<bridge>] [,firewall=<1|0>] [,link_down=<1|0>] [,macaddr=<XX:XX:XX:XX:XX:XX>] [,queues=<integer>]
[,rate=<number>] [,tag=<integer>] [,trunks=<vlanid[;vlanid...]>] [,<model>=<macaddr>]
So basically you can define the network for your kvm vm, say if it's bridged, set a specific mac address for that card.
If you want to add a specific ip to that vm you can do it based on its mac address (you have to configure in the dhcp server that a specific ip address is assigned to the desired mac address).
I have a host laptop running Debian, and a client VM running Debian. On the client, I run NGINX, and it serves up a complex web application with several hostnames (e.g. www.host, api.host, blog.host). The laptop moves between several different networks, with a seemingly ever-changing IP address.
I'm trying to meet the following conditions with this VM:
The IP address of the client shouldn't change (e.g. always 192.168.10.10)
With a static IP, I could edit the host /etc/hosts file and keep complex hostnames
The client should have access to the Internet
No other machines need to access the client
What is the best way to set up the Attached to settings for this client?
To do this, simply add two network interfaces to the box.
The first interface will use Host-Only, and that is how your host can connect to the client. This will create an additional network adapter on the host.
The second interface will use NAT, and that is the gateway to the internet. This will create an additional network adapter on the client.
If you've already got a client running, you'll need to get the next network adapter up and running by executing sudo ifconfig eth1 up and to get an IP address, run sudo dhclient eth1.
How can a Linux VM work out the IPaddress of the host node?
I need to connect to the IP address of the host node. I also need to know when it changes as it could be a dynamic IP. I need it to connect to a service there.
Is there some way to check this, irregardless of the type of VM, VMWare, Xen, Virtual Box?
It needs to be a Linux script, and should work regardless of the host operating system, whether Linux or Windows
My solution is to bridge a network adapter in the VM with one on the host, making it a dymanic IP address. As such it will always be on the subnet as the host adapter.
Next thing is to run an HTTP service on the host IP, that the VM will scan its network range on. The IP the service responds on will be the IP of the host. Having an IP service on the host is not ideal, but it is the best I can come up with.