Internet sharing from wireless to eth0

2 5286
Post Last Edited by TooMeeK at 2014-8-8 17:33

I needed small Internet sharing device (temporary, since my USB is failing), so to let You know how to fast configure small routing device:
1. start Lubuntu 3.0
2. pick up iptables script from:
and save it as: /etc/scripts/
3. replace WAN and LAN values with desired config
(wlan0 - WAN, br0 - LAN in my case)
4. make it executable:
sudo chmod +x /etc/scripts/
5. check if wlan0 driver is loaded
sudo ifconfig -a
if it returns different name, example wlan3 then rename it under:
6. now edit /etc/network/interfaces, this is just example for WPA2 network and bridged interface:
auto lo
iface lo inet loopback

#Manual mode for Gigabit NIC
auto eth0
iface eth0 inet manual

# Bridge for VM traffic
auto br0
iface br0 inet static
#    gateway
#    dns-nameservers
    bridge-ports  eth0
    bridge-fd     9
    bridge-hello  2
    bridge-maxage 12
    bridge-stp    off

auto wlan0
iface wlan0 inet dhcp
    wpa-ssid Network-Name-Here
    wpa-psk Network-Pass-Here

7. test config, if it works (espieccialy wireless) then update /etc/rc.local:

#Reboot on kernel panic
echo "1" > /proc/sys/kernel/panic


#Enable offload for onboard Gigabit NIC
ethtool -K eth0 rx on tx on sg on gso on gro on

swapon /swapfile.swp

#Internet sharing

8. Of course there is no DNS service on Banana, You'll have to use external address like Google's cached servers on Your client.

Hope this helps somebody else..
Thanks for sharing...could come in handy.

Post Last Edited by TooMeeK at 2014-8-9 17:58

There is an error.
I think /etc/rc.local script is starting before wlan0 is up, so there is no internet access until it's started second time after full OS boot.
I'm investigating this issue.
WORKAROUND - start via init scripts.
Move Your firewall script to file:
mark it executable
chmod +x /etc/init.d/internet-sharing
update header to:

# Provides:        internet-sharing
# Required-Start:  $network $remote_fs $syslog
# Required-Stop:   $network $remote_fs $syslog
# Default-Start:   2 3 4 5
# Default-Stop:    0 1 6
# Short-Description: Start Internet sharing on Banana Pi from wlan0 to br0

update init scripts:
update-rc.d internet-sharing defaults 99
check if these values exists with 99:
ls -l /etc/rc3.d/
if something goes wrong then remove it from init:
update-rc.d -f internet-sharing remove

You have to log in before you can reply Login | Sign Up

Points Rules