# Bridge with Lagg and Wireless. dhclient is uncooperative.



## Phishfry (May 8, 2022)

I have finally achieved lagg+wifi on bridge
2 ports wired gigabit ethernet for lagg0 to SG300-10
1 Atheros Module in hostapd mode for Wireless AP and DHCP passthru.
Bridged wlan0 and lagg0.

I fought this all day. I can not get DHCP to fire on the bridge0. SYNCDHCP either. See commented line.

```
### Networking ###
cloned_interfaces="lagg0 bridge0"
ifconfig_igb0="up"
ifconfig_igb1="up"
ifconfig_lagg0="laggproto roundrobin laggport igb0 laggport igb1 up"
ifconfig_bridge0="addm lagg0 addm wlan0 up"
#ifconfig_bridge0_alias0="SYNCDHCP"
#
#### Wireless AP ####
wlans_ath0="wlan0"
ifconfig_wlan0="up mtu 1500"
create_args_wlan0="wlanmode hostap country US ssid apu2fs channel 149"
hostapd_enable="YES"
defaultrouter="192.168.1.1"
gateway_enable="YES"
#
```

Neither worked:
ifconfig_bridge0_alias0="SYNCDHCP"

Or this:
ifconfig_bridge0="addm lagg0 addm wlan0 SYNCDHCP"
Or this:
ifconfig_bridge0="addm lagg0 addm wlan0 DHCP"

The solution /etc/rc.conf as shown and added `dhclient bridge0` to /etc/rc.local

I might have been able to use netwait. I think that the bridge was not coming up on time.
This was my first try at bridging LAGG. Usually I would just bridge LAN0 and WLAN0.

I almost gave up and went with pf NAT. I just wanted to see if I could get a bridge to work.


----------



## Phishfry (May 8, 2022)

```
wlan0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 4c:5e:0c:11:65:38
    groups: wlan
    ssid apu2fs channel 149 (5745 MHz 11a ht/40+) bssid 4c:5e:0c:11:65:38
    regdomain FCC country US ecm authmode WPA2/802.11i privacy MIXED
    deftxkey 2 AES-CCM 2:128-bit txpower 23 mcastrate 6 mgmtrate 6
    scanvalid 60 ampdulimit 64k ampdudensity 8 shortgi -uapsd wme burst
    dtimperiod 1 -dfs
    parent interface: ath0
    media: IEEE 802.11 Wireless Ethernet autoselect mode 11na <hostap>
    status: running
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lagg0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=4a500b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,NOMAP>
    ether 00:10:f3:72:ff:bd
    laggproto roundrobin lagghash l2,l3,l4
    laggport: igb0 flags=4<ACTIVE>
    laggport: igb1 flags=4<ACTIVE>
    groups: lagg
    media: Ethernet autoselect
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 58:9c:fc:10:ff:fc
    inet 192.168.1.102 netmask 0xffffff00 broadcast 192.168.1.255
    id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
    maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
    root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
    member: wlan0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
            ifmaxaddr 0 port 4 priority 128 path cost 33333
    member: lagg0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
            ifmaxaddr 0 port 5 priority 128 path cost 55
    groups: bridge
    nd6 options=9<PERFORMNUD,IFDISABLED>
```


----------

