![Xen dom0 不通过桥接转发到 domU](https://linux22.com/image/803733/Xen%20dom0%20%E4%B8%8D%E9%80%9A%E8%BF%87%E6%A1%A5%E6%8E%A5%E8%BD%AC%E5%8F%91%E5%88%B0%20domU.png)
我的设置尽可能简单。我在 dom0(Debian Squeeze)上有 2 个接口,eth0 和 eth1。我为 eth1 创建了一个桥接器,用于将数据包转发到具有公共 IP 地址的 domU。我可以通过外部连接 (ssh) 到 dom0,但无法从外部访问 domU。我正在尝试自己配置大部分网络堆栈,因此唯一启用的是xend-config.sxp
。(vif-script vif-bridge)
我遗漏了什么?
假设 xyz 是我的前缀民众IP。
dom0> /etc/xen/domU.cfg
vif = [ 'ip=x.y.z.243,mac=00:16:3E:AB:AE:DB,bridge=xenbr0' ]
dom0> /etc/network/interfaces
auto eth0
iface eth0 inet static
address x.y.z.244
netmask 255.255.255.248
network x.y.z.240
broadcast x.y.z.247
gateway x.y.z.246
dns-nameservers 8.8.8.8 8.8.4.4
allow-hotplug eth1
auto eth1
iface eth1 inet manual
pre-up /sbin/ifconfig eth1 up
post-down /sbin/ifconfig eth1 down
auto xenbr0
iface xenbr0 inet manual
bridge_ports eth1
bridge_stp off
bridge_maxwait 0
bridge_fd 0
/etc/network/interfaces 目录
auto eth0
iface eth0 inet static
address x.y.z.243
netmask 255.255.255.248
network x.y.z.240
broadcast x.y.z.247
gateway x.y.z.244
dom0> brctl 显示
bridge name bridge id STP enabled interfaces
xenbr0 8000.002590a39820 no eth1
vif4.0
dom0> ifconfig
eth0 Link encap:Ethernet HWaddr 00:24:90:b3:78:21
inet addr:x.y.z.244 Bcast:x.y.z.247 Mask:255.255.255.248
inet6 addr: fe80::225:90ff:fea3:9821/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:40109 errors:0 dropped:0 overruns:0 frame:0
TX packets:41103 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4139025 (3.9 MiB) TX bytes:6987850 (6.6 MiB)
Interrupt:20 Memory:dfa00000-dfa20000
eth1 Link encap:Ethernet HWaddr 00:25:90:a3:98:20
inet6 addr: fe80::225:90ff:fea3:9820/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:220096 errors:0 dropped:0 overruns:0 frame:0
TX packets:231831 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:23492354 (22.4 MiB) TX bytes:41985393 (40.0 MiB)
Interrupt:16 Memory:df900000-df920000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:888 (888.0 B) TX bytes:888 (888.0 B)
vif4.0 Link encap:Ethernet HWaddr fe:ff:ff:ff:ff:ff
inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:2 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX bytes:384 (384.0 B) TX bytes:300 (300.0 B)
xenbr0 Link encap:Ethernet HWaddr 00:25:90:a3:98:20
inet6 addr: fe80::225:90ff:fea3:9820/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:602 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:42751 (41.7 KiB) TX bytes:552 (552.0 B)
答案1
有两件事。我通常将 IP 地址放在桥上。另外,在这种情况下我不使用 xend 配置文件。
参见此处的示例:(您可以修改它以使用 eth1)