How to configure proxmox 4 network interface without physical access to KVM - networking

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).

Related

How to ping instance's internal network from Host on Devstack

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.

Get IP of VM running on an Ubuntu server configured on bridged networking

I want to set up an exported VM on an Ubuntu Server using VirtualBox on headless mode.
I have the VM up and running and bridged with the ethernet interface of the host (em1), so the dhcp of the host should now assign an IP to the VM if I'm not mistaken.
Is there a way to check if this is working and if yes to get the VM's IP?
Since this is on headless mode so without GUI, the only way to login to the VM is through ssh and for that I need the IP..
welthenwel,
you can do this with VBoxManage.
from a shell, just type:
VBoxManage guestproperty enumerate VM_NAME --pattern */IP
and you will get as response something like in the below image.
now, ignore the fact that I run this cmd from a Windows host, because its behaves exactly the same from inside a linux host
I'm not very familiar with VirtualBox. Bridged with VMWare Workstation meant the IP is given by your default DHCP server, which means you could look up the assigned IP address there (e.g. your router - if you have access to it).
Another option would be a ping sweep of your network segment as I believe Ubuntu doesn't drop ICMP requests.

On which MAC address Docker interface with the internet?

I'm trying to set up a container with docker.
The container can access the internet while I'm under my home network which doesn't have any filter, but fails to connect while under the university network (I can't even docker run ubuntu ping 8.8.8.8. I just get nothing). From my experience the university network drops everything that's not on port :80 and is not an http/https/ftp(and similar protocols) request.
I can ask for a specific MAC address to not be filtered.
With which MAC address does docker interface with internet?
Does it use my wireless board? I think it creates a new interface, but I have no idea if all the containers traffic goes through it.
Which MAC address should I ask to unlock in order for my containers not to be filtered?
Thanks!
I can ask for a specific MAC address to not be filtered. With which MAC address does docker interface with internet?
When communicating with the outside world, Docker is using the MAC address and source IP address of your host. If you are connected to the University network using your wireless NIC, then this is the NIC that Docker containers use for external connectivity.
Docker creates a bridge device on your system named docker0. All containers connect to this bridge, and use a private range of ip addresses. Communication external to your host happens via NAT rules configured using iptables (you can view them by running iptables -t nat -S). These rules make traffic originating in Docker containers appear to originate from your host instead.

How does Vagrant create a private network?

What is Vagrant doing behind the scenes to the host and guest machine when it sets up a private network with a fixed IP (http://docs.vagrantup.com/v2/networking/private_network.html)?
Vagrant.configure("2") do |config|
config.vm.network "private_network", ip: "192.168.50.4"
end
Back in Vagrant 1.0.x it is called Host-only Networking, it is a feature of VirtualBox, which allows multiple virtual machines to communicate with each other through a network via the host machine. The network created by host-only networking is private to the VMs involved and the host machine. The outside world cannot join this network.
Behind the scene, VirtualBox creates a new virtual interface ("loopback") on the host which appears next to the existing network interfaces.
VirtualBox even provide a built-in DHCP server for host-only networking (Private Networking) if no static IPs have been assigned. It can be configured in File - Preferences - Network.
See more at =>
Host-only networking
Networking in VirtualBox
On the host side, Vagrant does nothing. As far as I know Vagrant never touches host network configuration.
On the guest side, the current provider implements the network configuration logic. Here is what the VirtualBox provider does:
https://github.com/mitchellh/vagrant/blob/master/plugins/providers/virtualbox/action/network.rb
Basically the implementation is composed of two sequential steps:
Enable all the needed network adapters on the virtual machine, using hypervisor commands;
Configure the IP address on the guest OS, using guest capabilities, in this case the configure_networks capability.
As an example, here is the implementation for the configure_networks capability on Debian-based Linux OS.

Connect to VM running on the same computer without LAN

I have a windows 2003 VM running on my windows xp machine.
The machine name of the VM is itdom.domain.com
The windows xp host machine is disconnected from the LAN.
I want to be able to connect to the VM from the host and vice versa using there computer names. For example the URL http://itlab.domain:7080/domainsm must be accessible from the host computer.
Is there any configuration that I can do on any of the machine to do this.
Just because you have no physical network connection doesn't stop you setting up networking on the host and guest machines. One way of doing this is to add an IP address to the host machine's physical network port and create a bridged network on that port so that the guest can also see it.
You don't say which VM technology you are using, but in many of them you can setup an internal network between the host and guest. All you need to do then is edit each hosts file to add a hostname for the IP address of the other machine. You may also need to configure firewalls to allow access between the two.
No doubt there are also other ways to achieve this.

Resources