使用 KVM 在 Debian 中为我的两个客户机添加桥接

使用 KVM 在 Debian 中为我的两个客户机添加桥接

我正在尝试为我的访客添加两个 tap0 和一个 tap1。我正在运行带有 KVM 的 Debian。

每次我将其放入 /etc/network/interfaces/ 后重新启动服务器,服务器就无法访问。

这是为什么?我是不是忽略了什么?

# Loopback device:
auto lo
iface lo inet loopback

# device: eth0
auto eth0
iface eth0 inet manual

# device: tap0
# device: tap1
auto tap0 tap1
iface tap0 inet manual
iface tap1 inet manual

# device: br0
auto br0
iface br0 inet static
  address   88.198.xxx.xxx
  broadcast 88.198.xxx.xxx
  netmask   255.255.255.224
  gateway   88.198.xxx.xxx
  bridge_ports eth0 tap0 tap1

# default route to access subnet
up route add -net 88.198.xxx.xxx netmask 255.255.255.224 gw 88.198.xxx.xxx br0

谢谢!

编辑

将其添加到/etc/network/interfaces

# Loopback device:
auto lo
iface lo inet loopback

# device: eth0
auto eth0
iface eth0 inet manual

# device: br0
auto br0
iface br0 inet static
  address   88.198.xxx.xxx
  broadcast 88.198.xxx.xxx
  netmask   255.255.255.224
  gateway   88.198.xxx.xxx
  bridge_ports eth0

# default route to access subnet
up route add -net 88.198.xxx.xxx netmask 255.255.255.224 gw 88.198.xxx.xxx br0

它返回这个

Reconfiguring network interfaces...if-up.d/mountnfs[eth0]: waiting for interface br0 before doing NFS mounts (warning).

Waiting for br0 to get ready (MAXWAIT is 32 seconds).
done.

打印ifconfig如下:

br0       Link encap:Ethernet  HWaddr 40:61:86:2b:83:d2
          inet addr:88.198.xxx.xxx Bcast:88.198.xxx.xxx Mask:255.255.255.224
          inet6 addr: fe80::4261:86ff:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:224 errors:0 dropped:0 overruns:0 frame:0
          TX packets:215 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:17982 (17.5 KiB)  TX bytes:19858 (19.3 KiB)

eth0      Link encap:Ethernet  HWaddr 40:61:86:2b:83:d2
          inet6 addr: fe80::4261:86ff:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1245 errors:0 dropped:421488495 overruns:0 frame:0
          TX packets:1126 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:159089 (155.3 KiB)  TX bytes:123602 (120.7 KiB)
          Interrupt:249 Base address:0xc000

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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

答案1

这条路线是怎么回事?应该没有必要。除此之外,它看起来是一个合理的配置。您是否尝试过从配置中删除tap0tap1接口并保留桥接?

相关内容