New on LowEndTalk? Please Register and read our Community Rules.
[Help] 2 subnet with 1 nic on ProxMox

Hi all,
I'm trying configure network with proxmox host but I am finding some problems.
my idea is configure 2 subnets on the same NIC. below this is my network configuration
auto lo
iface lo inet loopback
#public for node & VM
auto vmbr0
iface vmbr0 inet static
address 103.xx.xx.xx
netmask 255.255.255.248
gateway 103.xx.xx.xx
bridge_ports eth0
bridge_stp off
bridge_fd 0
#private for VM
auto vmbr1
iface vmbr1 inet static
address 192.168.2.111
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
but now my vm cannot connect to private ip (Destination Host Unreachable)
please advice for this
Comments
You just need vmbr0, then on the guests you can set ip's from both subnets by specifying the gateway for each one. Assuming that you have gw's up on the router/switch.
What's NEIGHBOUR_DEVS= set as in /etc/vz/vz.conf, may need to be all, I had to set it for our Proxmox nodes last time they were re-configured.Nevermind.hello @Andreix
thanks for reply. do you mean proxmox host node with private ip?
but how about the vm? it'is must be accessed with public ip without nat
hi @wych
I'm using kvm for guest
.
Let's just say that you have 10.0.0.0/24 and 11.0.0.0/24.
On the proxmox bridge, simply allocate 1 IP from one of the subnets (don't matter which).
Then on VMs, you simply define in the interfaces:
VM1
IPADDR=10.0.0.3
MASK=255.255.255.0
GWAY=10.0.0.1
BCAST=10.0.0.255
VM2
IPADDR=11.0.0.2
MASK=255.255.255.0
GWAY=11.0.0.1
BCAST=11.0.0.255
As simple as that.
I will try this one and will be reported if it is successful. thx @Andreix
At least with LXC (venet), you just add the ip via ip add on the vmbr0 and add it manually. I haven't tested it on VM, yet.
sorry to hijack the thread, but I have one main server ip and a /29 subnet. How would I go about adding the second subnet? I currently have the default vmbr0 bridge setup on the machine.
Adding it to the VMs?
If the VMs are attached to the bridge, just adjust the network config on the VMs.
Subnet mask will be 255.255.255.248, specify the gateway/etc.
Note that this depends on the IP setup, for some reason, some providers route the entire subnet to the main IP of the server.
Leave the main IP as IP for ethX and set the first IP from the /29 as vmbr0 IP.
Then you can configure VMs by setting vmbr0's IP as gateway.
case closed. please mark my thread has been solved
No such function here :-(.