VM with two network addresses

cpastream

New Member
Nov 5, 2011
10
0
1
I have a virtual machine and I need it to have two network address.

a local 192.168.100.10 with netmask 255.255.255.0 and a public ip address xxx.xxx.xxx.10 with netmask 255.255.255.248

I've created the extra bridge and I was expecting an extra network address to be available for my virtual machines but it still only shows one address. How do I assign another IP address with different netmask to my virtual machine?
 
If you are talking about an "venet" kind of network implementation, then you should add another address in settings by comma, such this: "192.168.100.10, 1.2.3.4". But consider, that in such a case your VM becomes to be "multihomed". So, it needs a couple of rules to make a choice of correct source IP selection to send packets to LAN or WAN. Please refer to iproute2 documentation to achieve desirable behavior of your VE network. As a tip, I can mention a command like this: "ip route add aaa.bbb.ccc.ddd/zz via ppp.qqq.rrr.sss src 192.168.100.10".
 
You won't set netmask inside VM, because it will always be "255.255.255.255". Actually, "venet" is just a ppp (point-to-point) link. The termin "netmask" is not appliable for it. You do assign a netmask to your vmbr+ interface on hardware node (host machine) instead.
 
Okay, so I cannot get this to work.

I wanted the proxmox server to have a local ipaddress but the virtual machines to have public facing IPs. Is this possible?
 
The short answer is "yes". The full answer depends on you exactly wish. So, I ask you again: do you mean venet or veth virtual network implementation? If you are not sure, please refer to OpenVZ wiki.
 
The short answer is "yes". The full answer depends on you exactly wish. So, I ask you again: do you mean venet or veth virtual network implementation? If you are not sure, please refer to OpenVZ wiki.

I dont know if I need venet or veth. The setup I need is a proxmox server that has an IP of 192.168.100.84. The server has two virtual machines that I have designated with IPs 192.168.100.85 and 192.168.100.86. I need one of the virtual machines to have a public facing IP address of xxx.xxx.xxx.xxx. Is this possible? I dont know how to do this. I dont know if I need venet or veth all I know is that I need to achieve this setup. Is there any directions for this? I'm sure I'm not the first person to ever need this kind of setup.
 
OK.
On host machine you organize two ethernet bridges: vmbr0 with ip="192.168.100.84" and vmbr1 with any public IP from your pool. Also, on host machine you define all necessary static routes into your LAN (if any) and default gateway to Internet.
The next step is to open VM's Network setting in ProxMox web interface and to add another public IP from your pool for virtual environment after comma as I already mentioned above. That'll do.
 
I tried all suggestions and I couldn't get this to work so I've given up and just assigned public ips to my VMs
 
You can do this if you use a bridged interface.

The vm will get an eth0 device that you then configure to work in a normal 'real machine' fashion.

So... ifconfig eth0 192.168.0.1. Etc...

Rob


Sent from my iPhone using Tapatalk
 

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!