深度的网桥怎么配置啊,我的本本只有无线接口
Tofloor
poster avatar
呆了个呆
deepin
2016-01-24 21:24
Author
用网上 debian 的添加网桥的方法都试了遍,都不能成功桥接。能添加网桥,但是不能添加网络接口:
  1. # brctl addif br0 wlp1s0
  2. can't add wlp1s0 to bridge br0: Operation not supported
  3. # brctl show
  4. bridge name        bridge id                STP enabled        interfaces
  5. br0                8000.000000000000        no               
  6. # virsh iface-bridge wlp1s0 br0
  7. error: failed to get interface 'wlp1s0'
  8. error: internal error: couldn't find interface named 'wlp1s0': unspecified error - errors in loading some config files
Copy the Code
  1. $ ifconfig
  2. lo: flags=73  mtu 65536
  3.         inet 127.0.0.1  netmask 255.0.0.0
  4.         inet6 ::1  prefixlen 128  scopeid 0x10
  5.         loop  txqueuelen 0  (Local Loopback)
  6.         RX packets 160  bytes 12960 (12.6 KiB)
  7.         RX errors 0  dropped 0  overruns 0  frame 0
  8.         TX packets 160  bytes 12960 (12.6 KiB)
  9.         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

  10. wlp1s0: flags=4163  mtu 1500
  11.         inet 10.1.1.5  netmask 255.255.255.0  broadcast 10.1.1.255
  12.         inet6 fe80::5e51:4fff:fe8d:1689  prefixlen 64  scopeid 0x20
  13.         ether 5c:51:4f:8d:16:89  txqueuelen 1000  (Ethernet)
  14.         RX packets 13831  bytes 18703251 (17.8 MiB)
  15.         RX errors 0  dropped 0  overruns 0  frame 0
  16.         TX packets 5289  bytes 763354 (745.4 KiB)
  17.         TX errors 0  dropped 0 overruns 0  carrier 0  collisions
Copy the Code


Reply Favorite View the author
All Replies
avatar
ghostry
deepin
2016-01-24 21:53
#1


自己配网桥从来没有成功过。。。
Reply View the author
avatar
deepin4king
deepin
2016-01-25 12:23
#2
楼主在玩虚拟机?我看virsh都装好了嘛。。。。
debian系的发行版可以这样配置桥接网卡:(细节请根据实际情况自行修改,另外,其实根本不需要brctl addif br0 这样的命令。。。)
  1.     vim /etc/network/interfaces
  2.         # 编辑配置文件

  3.         auto br0
  4.         iface br0 inet (static|dhcp)

  5.         address 192.168.11.2
  6.         netmask 255.255.255.0
  7.         gateway 192.168.11.1
  8.         bridge_ports eth0    # 桥接到eth0网卡
  9.         bridge_stp off       # 关闭STP协议
  10.         bridge_fd 0          # 转发延迟设置为0

  11.     service networking restart
  12.         # 重启网络服务
  13.     ifconfig -a
  14.         # 查看接口信息
Copy the Code
Reply View the author
avatar
呆了个呆
deepin
2016-01-26 00:45
#3
https://bbs.deepin.org/post/36520
楼主在玩虚拟机?我看virsh都装好了嘛。。。。
debian系的发行版可以这样配置桥接网卡:(细节请根据实际情 ...

请注意,我说的是无线网卡,这个只能添加有线的接口
Reply View the author
avatar
deepin4king
deepin
2016-01-26 06:56
#4
本帖最后由 deepin4king 于 2016-1-25 22:58 编辑
https://bbs.deepin.org/post/36520
请注意,我说的是无线网卡,这个只能添加有线的接口

醉了,就不能动点脑子吗。。。。还
请注意,我说的是无线网卡,这个只能

。。。

在interfaces文件里一并接管wlan0的配置,wlan0接口用dhcp、static都行,然后br0可以不设ip
  1. auto wlan0
  2. iface wlan0 inet static
  3. address 192.168.11.2
  4. netmask 255.255.255.0
  5. gateway 192.168.11.1
  6.     wpa-ssid   [你的wifi ssid]
  7.     wpa-psk    [你的wifi密码]

  8. auto br0
  9. iface br0 inet static
  10. address 192.168.11.3
  11. netmask 255.255.255.0
  12. gateway 192.168.11.1
  13. bridge_ports wlan0   
  14. bridge_stp off      
  15. bridge_fd 0         
Copy the Code


(为了方便测试,所以全部设置的静态ip
然后就是重启networking,注意关闭network-manager,如果需要,可以把network-manager的开机启动项删掉
  1. service network-manager stop
  2. service networking restart
Copy the Code


我最后测试的代码如下,用两个源ip都能ping通,一切ok ( Ps: 我的是debian8 jessie....)
  1. ping -I 192.168.11.2 114.114.114.114
  2. ping -I 192.168.11.3 114.114.114.114
Copy the Code

Reply View the author
avatar
呆了个呆
deepin
2016-01-28 04:04
#5
https://bbs.deepin.org/post/36520
醉了,就不能动点脑子吗。。。。还
。。。

你确定你的是 deepin 吗,新的内核已经不是 wlan0 的命名了,都说了加不进去。我没脑子,但是我觉得你比我还没脑子
我发帖子的时候就帖了代码说了加不进去,还跟我讲这个,说我没脑子。。。
  1. # brctl addif br0 wlp1s0
  2. can't add wlp1s0 to bridge br0: Operation not supported
Copy the Code


Reply View the author
Comments
asdfghjkl
2016-01-28 08:16
哈哈,楼主有脑子。有没有驱动设置的,可以自己编驱动吗(很复杂就算了)
avatar
呆了个呆
deepin
2016-01-28 04:47
#6
终于找到解决办法了,不过用这个方法后连路由会使路由死机,再找原因!

To bridge wifi interface you may use iw tool to enable 4addr likewise:

  1. # iw dev set 4addr on
Copy the Code

ie:

  1. # brctl addif
  2. can't add to bridge : Operation not supported
Copy the Code

  1. # iw dev set 4addr on
  2. # brctl addif
Copy the Code

Now it should work. You can show bridges using:

  1. # brctl show
Copy the Code
Reply View the author
avatar
呆了个呆
deepin
2016-01-28 04:57
#7
我艹,这个好像是设置成无线桥接 (WDS) 模式。。。
Reply View the author
avatar
kingskill
deepin
2016-01-28 05:06
#8
进来占位学习。。。
Reply View the author
avatar
deepin4king
deepin
2016-01-28 11:46
#9
本帖最后由 deepin4king 于 2016-1-28 04:06 编辑
https://bbs.deepin.org/post/36520
你确定你的是 deepin 吗,新的内核已经不是 wlan0 的命名了,都说了加不进去。我没脑子,但是我觉得你比我 ...

恩,还是楼主最有脑子啦,都知道网络接口改名了呢!{:4_136:}
我说了我的是debian8。。。醉了


为什么改名?
想必有脑子的楼主肯定知道 那是systemd干的对吧,而且还是为了防止网络接口号与硬件对应关系发生混乱 {:4_135:}



加不进去?
确实加不进去,这是事实。但是我的那个方法是可以用的,只是有脑子的楼主看到的systemd换了接口名称然后就。。。不会了。。。不会了。。。
Reply View the author