How to config same ip for all VM

Domsday2017

New Member
May 11, 2017
6
0
1
32
Hello everyone
I have successfully installed proxmox and configured the network. I also install more 2 VM on the proxmox. First on vm 103.195.xxx.24, my configuration includes an interface eth0 and two sub interfaces eth0: 1, eth0: 2. Their ip address is as follows:
Code:
eth0      Link encap:Ethernet  HWaddr AE:DF:4A:83:12:8F
          inet addr:103.195.xxx.24  Bcast:103.195.xxx.127  Mask:255.255.255.128
eth0:1    Link encap:Ethernet  HWaddr AE:DF:4A:83:12:8F
          inet addr:103.195.xxx.25  Bcast:103.195.xxx.127  Mask:255.255.255.128
eth0:2    Link encap:Ethernet  HWaddr AE:DF:4A:83:12:8F
          inet addr:103.195.xxx.27  Bcast:103.195.xxx.127  Mask:255.255.255.128
When I restart my network, it runs normally. Then I continue to install network for VM 103.195.xxx.25 use the interface address as follows:
Code:
DEVICE=eth0
HWADDR=32:32:F9:CC:06:BA
TYPE=Ethernet
ONBOOT=yes
IPADDR=103.195.xxx.25
NETMASK=25
GATEWAY=103.195.xxx.1
DNS1=8.8.8.8
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
NM_CONTROLLED=yes
BOOTPROTO=none
And when I restart network for VM .25 then I get the following error message:
Code:
Error, some other host (AE:DF:4A:83:12:8F) already uses adress  103.195.xxx.25
Is there a way to overcome this problem? I want to interface 103.195.xxxx.25 can run on VMs. I provide the network information I have configured on proxmox:
Code:
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 8.8.8.8
iface vmbr0 inet manual
        bridge_ports none
        bridge_stp off
        bridge_fd 0

auto vmbr23
iface vmbr23 inet static
        address  103.xxx.xxx.23
        netmask  255.255.255.128
        gateway  103.xxx.xxx.1
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
auto eth1
iface eth1 inet static
        address 10.xxx.xxx.23
        netmask 255.255.255.0

post-up echo 1 > /proc/sys/net/ipv4/conf/vmbr23/proxy_arp
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
Please help me. Sorry my english is bad
 
You want to run the same IP on all VMs? That makes no sense at all.

Maybe you can explain what you want to achieve? Often, one configures a HA-IP with compatible software that allows the IP to "float".
 
Thank you for answering me. My main purpose is to block the VM use subnet. I want to VM103.195.xxx.24 to use only ip address .24 do not use any other ip. When VM .24 use another address, the address will be blocked and it is important that this address is still used for other VMs.


Can you talk more about HA-IP? Can that help me in this situation? Please help me. Thank you very much
 
Sorry, I still don't get it, but it has nothing do to with HA.

You know that you have a per-VM Firewall in PVE such that you can restrict the IP addresses on a firewall per VM basis. Maybe that solves your problem, but assigning addresses to block something seems strange to me
 
if you could use same address on multiple VMs, how would you differentiate them in remote access use?

think about it, IP address is a unique (with in the network/address scope) identification of your machine.
this is the way you find it on the network and connect to it.
with conjunction with MAC and port assignment it is like a fingerprint for your machine.
think a First Name + Last Name + Middle Name for your machine.
IP is First Name
Subnet is Last Name
MAC is Middle Name
underneath, on hardware/network level it might be treated differently, like IP+MAC is first Name Subnet Last and any special port as middle name.

now imagine that you have the same first and Last Name for 20 people? how will you find the one you want?


Now that said, if you want to be able to access all your VM from the same Interface on the Host that is different and needs some firewall rules.

I believe the setup would be like :

the HOST (Proxmox server) : 1 or more Nic and IPs assumed. let say you have 2 nics
Nic 1 - ip 1xx.1xx.xxx.10/24
Nic 1 - ip 1xx.1xx.xxx.11/24

you can dedicate nic1/ip10 for host management and internet access
and nic2 for your VM internet and network needs.

setup bridges as needed nic1 --> vbr0
nic2--> vb1.

also setup a internal bridge -- vbr2 for all your VM network.

all VM would have 2 nics,
one connected to vbr1 and one to vbr2.

each VM will have dhcp on vbr2
and static on vbr1

on the host you will setup firewall port forwarding rules to route a requests
from vbr1/<specific port you listen to on VM> to that specific VM.

but why do you need such a complexity?
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!