Proxmox VE网络配置

时间:2017年02月26日 | 作者:系统管理员 | 分类:程序/控制面板 | 浏览:7631 °C

本文针对是Proxmox VE底层系统/etc/network/interface 配置

Default Configuration (bridged) 默认配置(桥接)The installation program creates a single bridge (vmbr0), which is connected to the first ethernet card (eth0).安装程序创建一个单一桥(vmbr0),它是连接到第一个以太网卡(eth0的)。

auto lo

iface lo inet loopback

auto vmbr0

iface vmbr0 inet static

address 192.168.10.2

netmask 255.255.255.0

gateway 192.168.10.1

bridge_ports eth0

bridge_stp off

bridge_fd 0

Virtual machine behaves like directly connected to the physical network.虚拟机行为就像直接连接到物理网络。

Routed Configuration

路由配置Most

hosting providers does not support above setup. For security reason

they stop networking as soon as they detect multiple MAC addresses.大多数托管服务提供商不支持以上设置。 出于安全原因,他们停止联网,尽快为他们检测多个MAC地址。

A

common setup is that you get a public IP (assume 192.168.10.2 for this

example), and additional IP blocks for your VMs

(10.10.10.1/255.255.255.0). For such situation we recommend the

following setup.一个常见的设置是,您会获得一个公网IP(假设这个例子192.168.10.2),和其它的IP为虚拟机(10.10.10.1/255.255.255.0)。对于这样的情况下,我们推荐以下设置。

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static

address  192.168.10.2

netmask  255.255.255.0

gateway  192.168.10.1

post-up echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp

auto vmbr0

iface vmbr0 inet static

address  10.10.10.1

netmask  255.255.255.0

bridge_ports none

bridge_stp off

bridge_fd 0

Masquerading

Sometimes you want to use private IPs and masquerade the traffic:有时你想使用私人IP和非真实地址:

auto vmbr1

iface vmbr1 inet static

address  192.168.0.234

netmask  255.255.255.0

bridge_ports none

bridge_stp off

bridge_fd 0

post-up echo 1 > /proc/sys/net/ipv4/ip_forward

post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o eth1 -j MASQUERADE

post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o eth1 -j MASQUERADE

Unsupported Routing不支持路由

Physical

NIC (eg., eth1) cannot currently be made available exclusively for a

particular KVM / Container , ie., without bridge and/or bond.物理网卡(例如,eth1使用),目前不能提供专门针对特定的KVM /封装,即,无桥和/或直连。

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐