用这个命令 brctl 建立桥接口
#创建桥接口
brctl addbr br-vm
#将网口加入桥
brctl addif br-vm eth0
我试过,你这样不行的,现在肯定不是我的网卡eth0直接连接的网络,我觉得是ppp0这个可能是网桥的东西连接的网络,同时不能使用brctl addif br-vm ppp0(我猜是因为ppp0不是网卡)。
现在我的网络信息大概是这样:
enp5s0 Link encap:Ethernet HWaddr 28:d2:44:82:0e:ff
inet6 addr: 2001:da8:7013:7503:2ad2:44ff:fe82:eff/64 Scope:Global
inet6 addr: fe80::2ad2:44ff:fe82:eff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:58572 errors:0 dropped:0 overruns:0 frame:0
TX packets:56469 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:43172311 (43.1 MB) TX bytes:8972480 (8.9 MB)
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:275 errors:0 dropped:0 overruns:0 frame:0
TX packets:275 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:18045 (18.0 KB) TX bytes:18045 (18.0 KB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.132.166.25 P-t-P:192.168.100.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:29787 errors:0 dropped:0 overruns:0 frame:0
TX packets:33490 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:22790988 (22.7 MB) TX bytes:4683151 (4.6 MB)
wlp4s0 Link encap:Ethernet HWaddr b8:ee:65:d2:ff:14
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:894
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17