我在主机中有 IP 地址(Centos 6.8)
em1 Link encap:Ethernet HWaddr 34:17:EB:AE:89:6C
inet addr:172.16.32.53 Bcast:172.16.32.255 Mask:255.255.255.0
inet6 addr: fe80::3617:ebff:feae:896c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:171364 errors:0 dropped:0 overruns:0 frame:0
TX packets:139801 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:201751985 (192.4 MiB) TX bytes:15156935 (14.4 MiB)
Interrupt:20 Memory:f7f00000-f7f20000
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:65536 Metric:1
RX packets:69 errors:0 dropped:0 overruns:0 frame:0
TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6672 (6.5 KiB) TX bytes:6672 (6.5 KiB)
virbr0 Link encap:Ethernet HWaddr 52:54:00:3A:25:C8
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 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)
以及我在KVM(Centos 6.8)中的客人:
eth0 Link encap:Ethernet HWaddr 52:54:00:28:27:12
inet addr:172.16.32.27 Bcast:172.16.32.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe28:2712/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:558 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:37491 (36.6 KiB) TX bytes:1021 (1021.0 b)
Interrupt:11 Base address:0x4000
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:65536 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)
我的主机和我的客户端都可以连接到互联网,但我的主机无法在 KVM 中 ping 到我的客户端,也无法从我的客户端进行设置我的桥梁设置是 :
我应该怎么做才能让主机能够 ping 通我的客户机?因为当我 ping 通客户机时,我的主机只显示无法到达目的地?
答案1
我猜你想为你的客人使用 Bridge。
设备Linux Bridge
是一个虚拟交换机,它将你的主机和客人连接到同一个网络
首先在您的主机上新建一个 Linux Bridge,更多信息手动创建 CentOS 6 网桥
# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.f8bc1212c3c0 no bond0
然后,你可以设置客户机网卡来使用桥接器br0
,完成后别忘了重新启动客户机