Quick Start Guide For Bridge
Quick Start Guide For Bridge
# The command will make the interface wlan0 a port of the bridge br0. This means
that all frames received on wlan0 will be processed as if destined for the bridge.
brctl addif br0 wlan0
# You may get the error message “can't add wlan0 to bridge br0: Operation not
supported” when the driver uses CFG80211, the Linux kernel version is greater than
2.5.35.1 and the wlan0 interface is not AP mode. You can modify kernel to remove
the limitation of cfg80211 module and below is a modification sample of
linux-3.10.63.
--- D: /linux-3.10.63/net/ wireless/util.c
+++ D: /linux-3.10.63/net/ wireless/util.c
@@ -815,11 +815,11 @@
return -EOPNOTSUPP;
--- D: /linux-3.10.63/net/wireless/core.c
+++ D: /linux-3.10.63/net/wireless/core.c
@@ -948,10 +948,10 @@
netdev_set_default_ethtool_ops(dev, &cfg80211_ethtool_ops);
- if ((wdev->iftype == NL80211_IFTYPE_STATION ||
+ /*if ((wdev->iftype == NL80211_IFTYPE_STATION ||
wdev->iftype == NL80211_IFTYPE_P2P_CLIENT ||
wdev->iftype == NL80211_IFTYPE_ADHOC)
&& !wdev->use_4addr)
- dev->priv_flags |= IFF_DONT_BRIDGE;
+ dev->priv_flags |= IFF_DONT_BRIDGE;*/
break;
case NETDEV_GOING_DOWN:
cfg80211_leave(rdev, wdev);
# The command will make the interface eth0 a port of the bridge br0.
brctl addif br0 eth0
# The command sets the bridge's “bridge forward delay” to zero seconds
brctl setfd br0 0
(2) The others are the same with normal Soft-AP mode. Please reference
“Quick_Start_Guide_for_SoftAP.pdf” to get complete information.
(2) The wpa_supplicant may receive EAPOL packet fail in Linux kernel 3.9.1 ~ 4.0.5.
You still can modify kernel to remove the limitation of bridge module and below
is a modification sample of linux-3.10.63.
--- D: /linux-3.10.63/net/bridge/br_if.c
+++ D: /linux-3.10.63/net/bridge/br_if.c
@@ -75,7 +75,7 @@
return;
spin_lock_bh(&br->lock);
- if (netif_running(dev) && netif_oper_up(dev)) {
+ if (netif_running(dev)) {
if (p->state == BR_STATE_DISABLED)
br_stp_enable_port(p);
} else {
@@ -387,7 +387,7 @@
spin_lock_bh(&br->lock);
changed_addr = br_stp_recalculate_bridge_id(br);
--- D: /linux-3.10.63/net/bridge/br_notify.c
+++ D: /linux-3.10.63/net/bridge/br_notify.c
@@ -82,7 +82,7 @@
break;
case NETDEV_UP:
- if (netif_running(br->dev) && netif_oper_up(dev)) {
+ if (netif_running(br->dev)) {
spin_lock_bh(&br->lock);
br_stp_enable_port(p);
spin_unlock_bh(&br->lock);
--- D: /linux-3.10.63/net/bridge/br_stp_if.c
+++ D: /linux-3.10.63/net/bridge/br_stp_if.c
@@ -54,7 +54,7 @@
br_config_bpdu_generation(br);
If the Linux kernel version is greater than 3.16 you may not find the following file
br_notify.c Please refer to (3)
(3)
--- D: /linux-3.16.51/net/bridge/br.c
+++ D: /linux-3.16.51/net/bridge/br.c
@@ -82,7 +82,7 @@
break;
case NETDEV_UP:
- if (netif_running(br->dev) && netif_oper_up(dev)) {
+ if (netif_running(br->dev)) {
spin_lock_bh(&br->lock);
br_stp_enable_port(p);
spin_unlock_bh(&br->lock);
(4) The others are the same with normal station mode. Please reference
“wpa_cli_with_wpa_supplicant.pdf” to get complete information.
(E) The bridge br0 may include multiple ports. Suggest set IP address at br0.
(1) Static ip address
ifconfig br0 192.168.0.1