Ethernet and Wifi not working at the same time

I have an wna1100 wifi dongle working on my beaglebone black , it’s working fine but when it’s pluged in the ethernet port goes down.

How do i get both interface to work at the same time. My end goal is to have the wifi connect to a wireless modem and share internet through the ethernet connection to the rest of the network.

thanks for your time

P.S. i’m really new to this , know close to nothing about linux.