[SOLVED] [Help] 2 subnet with 1 nic ?

burgerkill

New Member
Dec 6, 2015
7
0
1
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
Code:
auto lo
iface lo inet loopback

#public
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
 
When you say you are trying to setup "2 subnets" on the Proxmox-Host using same nic, do you mean you are setting 2 vmbrN
in etc/network/interfaces using the same ethN ? And this is happening on Hosting Service X ?


first thing that comes to mind is the following:

check :
https://pve.proxmox.com/wiki/Network_Model

nano /etc/network/interfaces
Bridged config Host said:
auto lo
iface lo inet loopback
iface eth0 inet manual

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

then when you add you your Vm - you select Hardware -> add network device -> select Bridge mode -> select vmbr0 (thats the hosts vmbr0)
Then you configure inside your vm the
nano /etc/network/interfaces as follows:
Bridged config VM said:
auto lo
iface lo inet loopback
iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static
address 192.168.2.111
netmask 255.255.255.0
bridge_ports eth0
bridge_stp off
bridge_fd 0


If however your hosting provider disables networking as soon as there are multiple macs on the same interface, you need to use a routed config:

Routed Config said:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 103.xx.xx.xx
netmask 255.255.255.248
gateway 103.xx.xx.xx
post-up echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp


auto vmbr0
iface vmbr0 inet static
address 192.168.2.111
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
 
or ?

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
up ip addr add 192.168.2.111/24 dev vmbr0 || true
down ip addr del 192.168.2.111/24 dev vmbr0 || true
 
Last edited: