This question already has an answer here:
I have Internet access to my laptop, over Wi-Fi. I have connected a device with an Ethernet port (with an Ethernet cable from my laptop to the device), and set up a local area network between the two, so that they can ping each other. Now I want the device to access the Internet, i.e., to forward "Internet" from Wi-Fi on my laptop to the Ethernet port of the laptop.
How do I set this up if the laptop runs Ubuntu?