Assign an External IP to VM's

jlourenco

New Member
Joined
Jun 14, 2020
Messages
4
Reaction score
0
Credits
47
Hello,

I have a host using proxmox in which I have 1 main IP and a /27 IP Block.
What I want is that the host uses it's IP address and the IP Block is for the VM's that I will put on top.
I've managed to setup this, somewhat, to work but I have to manually go into the VM's and set them up with the right IP, this becomes very troublesome since I use multiple OS's and I would have to do that for them individually...

Is there a way to configure on the host one interface for each machine with all the configuration need so that I could then give that interface to the VM and work out of the box without having to setup anything on the guest?


Code:
auto lo
iface lo inet loopback

auto enp196s0
iface enp196s0 inet static
        address xxx.yyy.zzz.122/26
        gateway xxx.yyy.zzz.65
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up echo 1 > /proc/sys/net/ipv4/conf/enp196s0/proxy_arp

auto enp5s0f3u2u2c2
iface enp5s0f3u2u2c2 inet manual
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up echo 1 > /proc/sys/net/ipv4/conf/enp5s0f3u2u2c2/proxy_arp

auto vmbr0
iface vmbr0 inet static
        address aaa.bbb.ccc.32/27
        netmask 255.255.255.224
        bridge-ports none
        bridge-stp off
        bridge-fd 0

This is my current configuration on the host, I currently give vmbr0 to the guests and then on the guest I have to set this up:

Code:
Ip address: aaa.bbb.ccc.36
subnet: 255.255.255.224
gateway: aaa.bbb.ccc.32

How could I improve this?

Thanks
 


Not exactly sure what you are asking for here.
You want to VMs to automatically get IPs? Like from a DHCP server?
..or..
You are trying to put the VMs on the same subnet as your host network?

What VM manager are you using?
 
Login to MS Azure portal.
Click “Virtual Machines” from the left menu.
Click “Add”.
Add the basic information about the virtual machine to be set up.
In the Networking tab, for Public IP click “Create new”.
Under assign, select Static.
Click OK
 

Staff online

Members online


Top