Use more than one external IP

deadbird

New Member
Jan 9, 2016
10
0
1
41
Hi everyone.

I have a very nice server with many VM (mainly CTs), all of it running with proxmox 4.

Currently, my setup is the following:

# The loopback network interface
auto lo
iface lo inet loopback

# for Routing
auto vmbr1
iface vmbr1 inet manual
post-up /etc/pve/kvm-networking.sh
bridge_ports dummy0
bridge_stp off
bridge_fd 0


# vmbr0: Bridging. Make sure to use only MAC adresses that were assigned to you.
auto vmbr0
iface vmbr0 inet static
address 188.165.XXX.YYY
netmask 255.255.255.0
network 188.165.XXX.0
broadcast 188.165.XXX.255
gateway 188.165.XXX.254
bridge_ports eth0
bridge_stp off
bridge_fd 0

iface vmbr0 inet6 static
address 2001:41d0:2:8e29::
netmask 64
post-up /sbin/ip -f inet6 route add 2001:41d0:2:8eff:ff:ff:ff:ff dev vmbr0
post-up /sbin/ip -f inet6 route add default via 2001:41d0:2:8eff:ff:ff:ff:ff
pre-down /sbin/ip -f inet6 route del default via 2001:41d0:2:8eff:ff:ff:ff:ff
pre-down /sbin/ip -f inet6 route del 2001:41d0:2:8eff:ff:ff:ff:ff dev vmbr0
auto vmbr2
iface vmbr2 inet static
address 192.168.0.254
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0



Now, I have access to more than one public IP. I'd like to dedicate one of these to a specific CT/KVM. I tried using proxmox's WebUI, unsuccessfully.

Can someone help?

Thanks a lot ;)
 
Hi everyone.

I have a very nice server with many VM (mainly CTs), all of it running with proxmox 4.

Currently, my setup is the following:

# The loopback network interface
auto lo
iface lo inet loopback

# for Routing
auto vmbr1
iface vmbr1 inet manual
post-up /etc/pve/kvm-networking.sh
bridge_ports dummy0
bridge_stp off
bridge_fd 0


# vmbr0: Bridging. Make sure to use only MAC adresses that were assigned to you.
auto vmbr0
iface vmbr0 inet static
address 188.165.XXX.YYY
netmask 255.255.255.0
network 188.165.XXX.0
broadcast 188.165.XXX.255
gateway 188.165.XXX.254
bridge_ports eth0
bridge_stp off
bridge_fd 0

iface vmbr0 inet6 static
address 2001:41d0:2:8e29::
netmask 64
post-up /sbin/ip -f inet6 route add 2001:41d0:2:8eff:ff:ff:ff:ff dev vmbr0
post-up /sbin/ip -f inet6 route add default via 2001:41d0:2:8eff:ff:ff:ff:ff
pre-down /sbin/ip -f inet6 route del default via 2001:41d0:2:8eff:ff:ff:ff:ff
pre-down /sbin/ip -f inet6 route del 2001:41d0:2:8eff:ff:ff:ff:ff dev vmbr0
auto vmbr2
iface vmbr2 inet static
address 192.168.0.254
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0



Now, I have access to more than one public IP. I'd like to dedicate one of these to a specific CT/KVM. I tried using proxmox's WebUI, unsuccessfully.

Can someone help?

Thanks a lot ;)


Hi! I will tell you how I do it.

I usually use a virtual firewall/router in front of VM's groups. All public ip are assigned to 1 interface or interfaces of the firewall, then nat the connection to each of the virtual machines.

Regards!
 
Under the assumption that your provider routes all your IPs through your main IP address (for my provider this is the case) you can just assign the additional IP addresses inside the VMs that are connected to the bridge of your host.

Example:
Main IP: 1.0.0.1
Additional IP: 1.0.0.2

Host:
vmbr0 bridges the physical device eth0
vmbr0 has the main IP assigned to it

VM1:
eth0 (virtual networking device connected to vmbr0)
has the second IP assigned to it (e.g., 10.0.0.2)
For KVM this assignment is done inside the VM/CT (e.g. Debian: /etc/network/interfaces) and not in Proxmox
For CTs this might be done in the Network section of the CT settings.

In my case the netmask for the additional IPs had to be set to 255.255.255.255 and the gateway had to be the one from the main IP address.
 

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!