在serverfault的第一个问题,这样的新手,所有的反馈是值得欢迎的。
我有一台运行Debian GNU / Linux 8.4(jessie)的专用服务器,其中包含一个公共IP和多个额外的公共IP地址。 服务器有两个网卡,eth0和eth1,服务器主要公共IP路由到eth1)。 所有额外的公共IP分配给别名接口(eth1:0,eth1:1,eth1:2等),除了1个IP,我想分配给KVM客人,但在路由networkingconfiguration(数据中心不允许多个MAC地址连接到交换机端口,所以我没有select,只能使用路由而不是桥接)。
我已经设置了接口别名,并且我可以在Apache 2.4下(通过使用ISPConfig 3虚拟主机控制面板)将相应的公共IP分配给不同的虚拟主机。 虚拟主机在这种configuration下工作正常。 但是,当我尝试添加路由网桥(vmbr0)并通过它路由KVM访客stream量时,我失去了连接,必须重新启动服务器。 重新启动后,服务器将工作一段时间(分钟),并再次失去连接。 我似乎无法弄清楚什么是错的。
注意:我已经在另一个主机系统上使用了Hetzner指南[ https://wiki.hetzner.de/index.php/Netzkonfiguration_Debian/en#Routed_.28brouter.29] ,并且KVM客人工作正常。 唯一不同的是在这种情况下,我也需要有别名接口。
我已经创build了桥接接口:
brctl addbr vmbr0
在重新启动networking之前
/etc/init.d/networking restart
主机系统的networkingconfiguration:
auto lo iface lo inet loopback auto eth0 iface eth0 inet manual auto eth1 iface eth1 inet static address AAA.AAA.AAA.AAA netmask 255.255.255.0 gateway AAA.AAA.AAA.1 pointopoint AAA.AAA.AAA.1 auto eth1:1 iface eth1:1 inet static address BBB.BBB.BBB.BBB netmask 255.255.255.255 auto eth1:2 iface eth1:2 inet static address CCC.CCC.CCC.CCC netmask 255.255.255.255 auto eth1:3 iface eth1:3 inet static address DDD.DDD.DDD.DDD netmask 255.255.255.255 auto eth1:4 iface eth1:4 inet static address EEE.EEE.EEE.EEE netmask 255.255.255.255 auto eth1:5 iface eth1:5 inet static address FFF.FFF.FFF.FFF netmask 255.255.255.255 auto eth1:6 iface eth1:6 inet static address GGG.GGG.GGG.GGG netmask 255.255.255.255 auto eth1:7 iface eth1:7 inet static address HHH.HHH.HHH.HHH netmask 255.255.255.255 auto eth1:8 iface eth1:8 inet static address III.III.III.III netmask 255.255.255.255 auto eth1:9 iface eth1:9 inet static address JJJ.JJJ.JJJ.JJJ netmask 255.255.255.255 auto eth1:10 iface eth1:10 inet static address KKK.KKK.KKK.KKK netmask 255.255.255.255 # KVM VM routed (bridge) interface for single IPs auto vmbr0 iface vmbr0 inet static address AAA.AAA.AAA.AAA netmask 255.255.255.0 bridge_ports none bridge_stp off bridge_fd 0 # up ip route add ip1_goes_here/32 dev vmbr0 # up ip route add ip2_goes_here/32 dev vmbr0 # up ip route add ip3_goes_here/32 dev vmbr0
我还没有创buildKVM来宾机器。 也许我应该有一个正在运行的虚拟机和stream量路由到它之前,由于某种原因vmbr0桥接? 如果我能做到这一点,我将添加额外的公共IP分配给额外的KVM客人。
最后要补充的是,这是一个已经运行了一些网站的服务器,所以如果我需要的话可以做,而且停机时间最短,那就太棒了!
谢谢!
如果您使用桥接器,则必须在其中使用一个物理接口。 所以你的/etc/network/interfaces应该看起来像这样:
auto lo vmbr0 iface vmbr0 inet static address AAA.AAA.AAA.AAA netmask 255.255.255.0 bridge_ports none bridge_stp off bridge_fd 0 bridge_ports eth1 bridge_maxwait 5 iface vmbr0:1 inet static address BB.BB.BB.BB netmask 255.255.255.255
等等其他接口。