one eth with two subnets

chalan

Member
Mar 16, 2015
119
3
16
hello i have a "server" with only one lan port. i need to have pve on subnet 172.17.200.0/24 and vms on another subnet 192.168.1.0/24 (local lan) with gw 192.168.1.1. my config

Code:
auto lo
iface lo inet loopback

auto vmbr0
iface vmbr0 inet static
        address 192.168.1.251
        netmask 255.255.255.0
        gateway 192.168.1.1
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0

how to make this work?
 
but i need to have the vm's direct on the local subnet 192.168.1.0/24, there is file server samba running as vm... don't need the traffic from 192.168.1.32 to 192.168.1.251 to go through the router... the subnet
172.17.200.0/24 should be just for cluster with another pve...
 
Last edited:
You can add a second IP to the interface but I do not see the sense of two subnet in one physical network?
The cluster need a dedicated network in case of reliability.
 
first please how will look like the config if i have two subnets on the same network and default gw 192.168.1.1? like this?

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
       address  172.17.200.254
       netmask  255.255.255.0
       gateway  172.17.200.1

auto vmbr0
iface vmbr0 inet static
       address 192.168.1.251
       netmask 255.255.255.0
       gateway 192.168.1.1
       bridge_ports eth0
       bridge_stp off
       bridge_fd 0

second if i add vlan to the port on the switch with tagged 200 for pve 172.17.200.0/24 how will then the config look like?
 
You can't have two gateways. If you like that the networks use different uplinks you have to setup the routing manually.

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manuel

auto eth0.200
iface eth0.200 inet static
      address  172.17.200.254
      netmask  255.255.255.0

auto vmbr0
iface vmbr0 inet static
      address 192.168.1.251
      netmask 255.255.255.0
      gateway 192.168.1.1
      bridge_ports eth0
      bridge_stp off
      bridge_fd 0
 

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!