Sharing a WiFi connection over Ethernet
This article describes how to connect to a device to your computer via Ethernet and share your computer's existing Internet connection with that device. In other words, your computer will be acting as a gateway and the connected device will be able to send packets via your computer to the Internet.
This is useful when you need a device to be able to access the internet while networked with your computer, but you do not have access to your router. We use it as an option in our config instructions for the Unifi Mesh AP.
Choose your computer's OS:
This is the preferred environment. PCW computers will be using Ubuntu 20.04.
Wiredsection, click the plus sign to create a new settings profile. Name the profile "Shared" or whatever you want.
In the IPv4 tab, choose "Shared to other computers". Click Apply. Your computer should now be networked with the AP. 10.42.0.0/24 is the default subnet used by Ubuntu for this setup, but there's not necessarily a guarantee that your computer will use that subnet. If the next step returns no results, run
ifconfigand look for the IP of your Ethernet interface (usually
Open a terminal. Type the following to scan the devices in that IP range:
nmap -sn 10.42.0.0/24 | grep report
You should see two lines beginning with "
nmap scan report". Find the line with an IP address that does not end with "
.1", and copy that IP address.
If the nmap command hangs, you can also try the Mac OS directions on Ubuntu Linux and it should work fine.
Begin these steps with the AP not connected to your computer via an ethernet port or adapter.
System Preferencesmenu -> select
Internet Sharingin the list on the left -> select the interfaces you want to enable sharing for -> click the box next to
Internet Sharingto turn it on -> a warning dialog box will come up, so click
arp -a | grep -v incompleteto show a mapping of ip address to mac address for the devices on your network.
Connect the ap to your machine or adapter and run
arp -a | grep -v incompleteagain. The difference between this and the previous grep output should be the AP. Note the IP address and MAC address.
To confirm that the AP has a route to the internet, you can run the same commands as specified in step 5 of the Ubuntu instructions above (ssh, ping, etc.).
Note: These instructions were developed on a MacBook running Catalina, version 10.15.7.