1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to config same ip for all VM

Discussion in 'Proxmox VE: Networking and Firewall' started by Domsday2017, May 18, 2017 at 17:37.

Tags:
  1. Domsday2017

    Domsday2017 New Member

    Joined:
    May 11, 2017
    Messages:
    6
    Likes Received:
    0
    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
     
  2. LnxBil

    LnxBil Well-Known Member

    Joined:
    Feb 21, 2015
    Messages:
    1,746
    Likes Received:
    93
    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".
     
  3. Domsday2017

    Domsday2017 New Member

    Joined:
    May 11, 2017
    Messages:
    6
    Likes Received:
    0
    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
     
  4. LnxBil

    LnxBil Well-Known Member

    Joined:
    Feb 21, 2015
    Messages:
    1,746
    Likes Received:
    93
    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
     
  5. jim.bond.9862

    jim.bond.9862 Member

    Joined:
    Apr 17, 2015
    Messages:
    69
    Likes Received:
    1
    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?
     
    #5 jim.bond.9862, May 19, 2017 at 13:11
    Last edited: May 19, 2017 at 13:19

Share This Page