assign ip adress to vm

mekano

New Member
Nov 14, 2023
7
0
1
hi
i have a proxmox server i created a vm and i bought an additional ip adress from hetzner i want to assign the additional ip to vm
Please help me
this is my internet interface config

Code:
source /etc/network/interfaces.d/*


auto lo
iface lo inet loopback

auto enp35s0

iface enp35s0 inet static
        address proxmoxIP
        netmask 255.255.255.192
        gateway ProxmoxGetway.193
        up route add -net AdditionalIP.102 netmask 255.255.255.192 gw ProxmoxGetway.193 dev enp35s0

auto vmbr99
iface vmbr99 inet static
        address 10.10.10.1
        netmask 255.255.255.0
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up   iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o enp35s0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o enp35s0 -j MASQUERADE
      
        post-up   iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
        post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
 
Last edited:
Hi,

If you have a public subnet from Hetzner you can modify your netwok config and add:
Code:
auto vmbr2
iface vmbr2 inet static
        address XX.XX.XX.XX/XX
        bridge-ports none
        bridge-stp off
        bridge-fd 0
And then run ifreload -a command. You have to set a static IP in the VM itself.
 
  • Like
Reactions: mekano
Hi,

If you have a public subnet from Hetzner you can modify your netwok config and add:
Code:
auto vmbr2
iface vmbr2 inet static
        address XX.XX.XX.XX/XX
        bridge-ports none
        bridge-stp off
        bridge-fd 0
And then run ifreload -a command. You have to set a static IP in the VM itself.
thanks so much
 
Last edited:

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!