Search code examples
virtual-machinekvmsubnetproxmoxrouted

proxmox KVM routed network with multiple public IPs


I have a dedicated hosting with hetzner. Additionally i have bought a 6IP subnet.

My main IP is: 88.198.60.125 My main subnet is: 255.255.255.224

My additional IPs are 46.4.214.81 to 46.4.214.86

the internet access work on windows servers . but centos give me invalid host I cannot use bridged mode, since hetzner does not allow multiple MACs on same external ip, so I have to use routing mode. Here is my /etc/network/interfaces file for the host:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address  88.198.60.125
        netmask  255.255.255.255
        pointopoint 88.198.60.97
        gateway  88.198.60.97
        post-up echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp

auto vmbr0
iface vmbr0 inet static
    address  88.198.60.125
    netmask  255.255.255.255
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0

    #subnet
    up ip route add 46.4.214.80/29 dev vmbr0
    up ip route add 46.4.214.81/29 dev vmbr0
    up ip route add 46.4.214.82/29 dev vmbr0
    up ip route add 46.4.214.83/29 dev vmbr0
    up ip route add 46.4.214.84/29 dev vmbr0
    up ip route add 46.4.214.85/29 dev vmbr0
    up ip route add 46.4.214.86/29 dev vmbr0
    up ip route add 46.4.214.87/29 dev vmbr0

and this my interfaces for vm

auto eth0                                                                                   
 iface eth0 inet static                                                                        
 address 46.4.214.81                                                                        
 netmask 255.255.255.255                                                                     
 pointopoint 88.198.60.125                                                                  
 gateway 88.198.60.125  

Solution

  • ok this how I solved the problem you need to specific The IPs you want to use them with WINDOWS SERVER using "up route add -host" and other IPs can be used directly with Linux using create container....installing Linux manual not worked with me this is my /etc/network/interfaces file

    auto lo
    iface lo inet loopback
    
    auto eth0
    iface eth0 inet static
            address  88.198.60.125
            netmask  255.255.255.255
            pointopoint 88.198.60.97
            gateway  88.198.60.97
            post-up echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
    
    auto vmbr0
    iface vmbr0 inet static
        address  88.198.60.125
        netmask  255.255.255.255
        bridge_ports none
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0
    
        #subnet ips  used with windows server only
         up route add -host 46.4.214.80 dev vmbr0
         up route add -host 46.4.214.81 dev vmbr0
         up route add -host 46.4.214.82 dev vmbr0
         up route add -host 46.4.214.87 dev vmbr0