proxmox KVM routed network with multiple public IPs

杀马特。学长 韩版系。学妹 提交于 2019-12-12 04:17:07

问题


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  

回答1:


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


来源:https://stackoverflow.com/questions/35222304/proxmox-kvm-routed-network-with-multiple-public-ips

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!