0

我与 hetzner 有一个专门的托管。另外我买了一个 6IP 子网。

我的主 IP 是:88.198.60.125 我的主子网是:255.255.255.224

我的附加 IP 是 46.4.214.81 到 46.4.214.86

互联网访问工作在 Windows 服务器上。但是centos给了我无效的主机我不能使用桥接模式,因为hetzner不允许同一个外部IP上有多个MAC,所以我必须使用路由模式。这是主机的 /etc/network/interfaces 文件:

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

这是我的 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  
4

1 回答 1

1

好的,这就是我如何解决您需要具体解决的问题您要使用“up route add -host”将它们与 WINDOWS SERVER 一起使用的IP,其他 IP 可以使用创建容器直接与 Linux 一起使用....安装 Linux 手册不起作用这是我的 /etc/network/interfaces 文件

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
于 2016-06-28T01:28:31.533 回答