P
P
Printip2017-12-03 02:27:46
System administration
Printip, 2017-12-03 02:27:46

How to forward local IPs in Proxmox (e) to virtual machines?

In general, we have the following:
Debian and Proxmox on top of it.
5 static public IP addresses are registered in the network config: 188.0.0.100
188.0.0.101
188.0.0.102
188.0.0.103
188.0.0.104
(
everyone is pinged) IP
task 188.0.0.101
188.0.0.102
188.0.0.103 Tell me how to forward these IPs to virtual machines?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
stonemct, 2017-12-09
@stonemct

I did like this, but it was despite the fact that all IP addresses had to be with one poppy address, since the provider put forward such conditions!
in the file /etc/network/interfaces add at the start of the interface
*** CUT ***
auto vmbr0
iface vmbr0 inet static
address 10.10.0.1
netmask 255.255.255.0
bridge_ports eth1
bridge_stp off
bridge_fd 0
bridge_vlan_aware yes
make the /etc/network/fw.sh file executable.

/etc/network.fw.sh
#!/bin/sh                                                                                                
                                                    
IPT=`which iptables`                                
echo " which iptables : " $IPT                                                                           
                                                                                                                                                                                                                   
$IPT -F                                                                                                                                                                                                            
$IPT -t nat -F                                      
$IPT -t mangle -F                                                                                        
#                              
$IPT -t nat -A PREROUTING -d 188.0.0.100/32 -j DNAT --to-destination 10.10.0.100
$IPT -t nat -A POSTROUTING -s 10.10.0.100 -j SNAT --to-source 188.0.0.100 -m comment --comment "for inet vm100 blabla.com"
#                              
$IPT -t nat -A PREROUTING -d 188.0.0.101/32 -j DNAT --to-destination 10.10.0.101
$IPT -t nat -A POSTROUTING -s 10.10.0.101 -j SNAT --to-source 188.0.0.101 -m comment --comment "for inet vm100 blabla.com"

In the usual case with a normal service provider, you need to do as suggested by @take to combine
the physical interface through which it is connected to the provider with vmbrXX into a bridge and register the rest of the extIP already inside the virtual machines (similar to the external interface of the proxmox host machine).

V
vreitech, 2017-12-03
@fzfx

assign for each virtual machine the network adapter on which the ip-address for the virtual machine is registered in the host system. on the host system, remove the ip-address from the network config. in guestbook - add.

I
Ingvar, 2017-12-06
@take

Not this way. One white address goes to the network card of the proxy itself and the mask and gateway are written on it. Further, through the bridge, this network card is thrown into the VM inside which or which the necessary specified addresses are already registered on the network card that appears in the machine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question