四年,明成祖都打完靖难之役即位登基了阿!特么第一次世界大战也打完了阿!苏联卫国战争都胜利了阿!抗日战争都扛过一半到相持阶段了阿!
四年,偶这废柴才算解决笔记本联网的基本问题阿!俺这点智商还非要折腾开源BSD就是自虐阿!
[/吐槽]
----------------------------------------------默哀的分割线-----------------------------------------
笔记本用户通常希望有线网络和无线网络接口间的自动切换,链路聚合能将多个网络接口聚合为一个虚拟接口 trunk0, 这里使用其Failover (故障转移)模式:只通过主网口收发数据。 若主网口不可用, 则使用下一个激活的网口。
俺的笔记本的使用场景中,有线网口 bge0 视为主网口; 无线网口 rum0 则视为用作转移的备用网口,只用一个 IP 。 当bge0未连接,则rum0启用(发生故障转移),
代码: 全选
~ $ifconfig
bge0: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:18:8b:da:b8:b9
priority: 0
trunk: trunkdev trunk0
media: Ethernet autoselect (none)
status: no carrier
rum0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:18:8b:da:b8:b9
priority: 4
trunk: trunkdev trunk0
groups: wlan
media: IEEE802.11 autoselect (OFDM48 mode 11g)
status: active
ieee80211: nwid my_wifi-ssid chan 7 bssid b0:48:7a:28:97:28 108dB wpakey <not displayed> wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip 100dBm
trunk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:18:8b:da:b8:b9
priority: 0
trunk: trunkproto failover
trunkport rum0 active
trunkport bge0 master
groups: trunk egress
media: Ethernet autoselect
status: active
inet 192.168.9.7 netmask 0xffffff00 broadcast 192.168.9.255
代码: 全选
~ $ifconfig
bge0: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:18:8b:da:b8:b9
priority: 0
trunk: trunkdev trunk0
media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
status: active
rum0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:18:8b:da:b8:b9
priority: 4
trunk: trunkdev trunk0
groups: wlan
media: IEEE802.11 autoselect (OFDM24 mode 11g)
status: active
ieee80211: nwid my_wifi-ssid chan 7 bssid b0:48:7a:28:97:28 49dB wpakey <not displayed> wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip 100dBm
trunk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:18:8b:da:b8:b9
priority: 0
trunk: trunkproto failover
trunkport rum0
trunkport bge0 master,active
groups: trunk egress
media: Ethernet autoselect
status: active
inet 192.168.9.7 netmask 0xffffff00 broadcast 192.168.9.255
有线网卡
代码: 全选
~ $cat /etc/hostname.bge0
up
代码: 全选
~ $cat /etc/hostname.rum0
nwid my_wifi-ssid wpakey my_password chan 7
up
代码: 全选
~ $cat /etc/hostname.trunk0
trunkproto failover trunkport bge0 trunkport rum0 192.168.9.7 netmask 255.255.255.0