S
S
Sergey Savostin2019-08-31 23:22:43
linux
Sergey Savostin, 2019-08-31 23:22:43

Real IP from different subnet for VM inside Proxmox?

Tell me where is the bug?
There is Proxmox on Dedicated.
Config standard ( /etc/network/interfaces )

auto lo
iface lo inet loopback
iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
   address  x.x.x.17
   netmask  255.255.255.0
   gateway  x.x.x.1
   bridge-ports eno1
   bridge-stp off
   bridge-fd 0

post-up echo 1 > /proc/sys/net/ipv4/ip_forward

Inside the virtual machine with Ubuntu. Naturally connected to vmbr0. There's netplan (but I don't think that's the reason, right?):
network:
  version: 2
  renderer: networkd
  ethernets:
    ens18:
      addresses: [ y.y.y.107/24 ]
            routes:
              - to: 0.0.0.0/0
                via: y.y.y.1
                    on-link: true
      nameservers:
          addresses: [ 1.1.1.1, 8.8.8.8 ]

Tried both via routes and via gateway.
The problem is that xxx1 and yyy1 are on completely different subnets. The provider claims that they are in the same VLAN and there should be no problems. But from inside the virtual machine, nothing, including yyy1, is pinged. If you set ip and gateway from the same subnet (i.e. xxx18 and xxx1 respectively), everything works.
What's wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sanes, 2019-08-31
@Sanes

on eno1 add a second subnet, more precisely on Bridge vmbr0
/etc/network/interfaces

............
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0

up route add -net x.x.x.184 netmask 255.255.255.248 gw x.x.x.185 dev vmbr0

P
Puma Thailand, 2019-09-01
@opium

there is a hatzner provider, then just get a dedicated poppy and register it on the interface and get ip via dhcpd

T
Talyan, 2019-09-01
@flapflapjack

If the provider says that the networks are in the same VLAN and it goes to the interface in the VMBR0 bridge, as you said above, then nothing needs to be touched in the bridge itself. And Proxmox does not need to be restarted either. It must be restarted, the mother of his children, if only a new bridge was created and all sorts of rules were added.
If you have one white IP, then you just made a mistake in the mask 24 (you need 32)
On the virtual machine itself (Ubuntu)

network:
  version: 2
  renderer: networkd
  ethernets:
    ens18:
      addresses: [ y.y.y.107/32]
            routes:
              - to: 0.0.0.0/0
                via: y.y.y.1
                    on-link: true
      nameservers:
          addresses: [ 1.1.1.1, 8.8.8.8 ]

In general, does it give you VLAN Access'om or a tag?
Although .. if it says that in one VLAN and you have one network pinged from proxmox, then the second one should work without VCONFIG.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question