Sharing wlan0 internet to eth0

0

I would like to share my wireless Internet connection through a Raspberry Pi as follows:

               Raspberry Pi
Internet --- (wlan0 --- eth0) --- Computer

I have managed to setup the wireless connection through the wlan0 and to configure the DHCP which gives my computer an IP address.

However when it comes to bridge wlan0 to eth0, it doesn't work...

I have tried the following commands but with no success:

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

When I try to access the Internet or even ping the default gateway, it doesn't work.

What am I missing here? Thanks!

Bob

Posted 2016-03-26T17:55:09.950

Reputation: 141

I think you should do it with brctl – yanpas – 2016-03-26T20:09:07.820

No answers