1

I'm attempting to share my wifi connection from my Ubuntu computer to my raspberry pi through the ethernet port. I've tried a lot of things and nothing seems to work.

Right now I've created a wired connection, set it to "share to other computers" and "allow all users to connect', and then on my wifi connection I switched it to "allow all users.." and "shared to other computers". I really have no idea why it doesn't work.

2

Try this

Enable IP forwarding. This is done either by using

echo "1" > /proc/sys/net/ipv4/ip_forward

After that add a rule telling to forward the traffic

sudo iptables -A FORWARD -i eth0 -o wifi0 -j ACCEPT
sudo iptables -A FORWARD -i wifi0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

Because you router do not known for your lan network we must do masquarade

sudo iptables -t nat -A POSTROUTING -o wifi0 -j MASQUERADE

NOTE: In example eth0 is name of nic card, wifi0 is name of your wifi card. You can see card's names with command ip a or ifconfig

0

I just had the same issue and solved it like this.

In the terminal type

nm-connection-editor

When it opens, select the wired connection item, clicking the edit button (the cog). In that menu, switch to the IPv4 tab, and select the method: 'shared to other computers'.

Then save the settings and it should work

from https://www.crookm.com/2018/05/sharing-wifi-connection-over-ethernet.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.