• Before reporting problems with your board running Armbian, check the following:

    • 1. Check power supply, check SD card and check other people experiences   06/23/17

      Power supply issues are one of the three biggest issues you'll face when starting with Single Board Computers (SBCs). SD card issues, whether fake or faulty, are another and issues resulting from poor board design is the other common issues you can encounter.   Power supply issues can be tricky. You might have a noisy power supply that works with one board because it has extra filtering, but won't work with another. Or you're using that cheap phone charger because your board has a microUSB connector, and it is either erratic, or doesn't start up, or even becomes the cause of some SD card issues.    Some tips to avoid the most common causes of problems reported:   Don't power via micro USB  - unless you have optimised your setup for low power requirements. Micro USB is great for mobile phones because they are simply charging a battery. It's bad for SBCs. Yes, it does work for a lot of people, but it also causes more problems and headaches over time than it is worth, unless you know exactly what you are doing. If you have a barrel jack power connector on your SBC, use it instead! If there is an option for powering via header connections, use that option!
        Don't use mobile phone chargers. They might be convenient and cheap, but this is because they are meant for charging phones, not powering your SBC which has particular power requirements.
        When you are evaluating a power supply, make sure you run some stress tests on your system to ensure that it will not cause issues down the path.   (Micro) SD card issues can be sneaky. They might appear right at the start causing strange boot and login errors, or they might cause problems over time. It is best to run a test on any new SD card you use, to ensure that it really is what it is, and to ensure that isn't faulty. Armbian provides you a simple way to do this   --   armbianmonitor -c /path/to/device/to/test  
    • 2. Make sure to collect and provide all necessary information   06/24/17

      We can only help if you provide quality information for us to work with. All stable images from the download section are tested, most stable upgrades are tested and we have tens of thousands of users. Even with regular and extensive testings, bugs sometimes do slip through. This is a voluntary support service and is unrelated to board makers, and is not obligated to provide you any answers. Repeated asking the same questions because you're not happy with the answers will result in you being ignored.

      Before you post a question, use the forum search as someone else might have already had the same problem and resolved it. And make sure you've read the Armbian documentation. If you still haven't found an answer, make sure you include the following in your post:   1. Logs when you can boot the board: armbianmonitor -u (paste URL to your forum post)   2. If your board does not boot, provide a log from serial console or at least make a picture, where it stops.   3. Describe the problem the best you can and provide all necessary info that we can reproduce the problem. We are not clairvoyant or mind readers. Please describe your setup as best as possible so we know what your operating environment is like.     We will not help in cases you are not using stable official Armbian builds, you have a problem with 3rd party hardware or reported problem would not be able to reproduced.

[Solved] OPIZero share internet over eth0 from wlan0
0

8 posts in this topic

Recommended Posts

Hello everyone

 

I just bought an orange pi zero (512mb) and installed ubuntu xenial ...

 

 

I was able to connect to my wifi AP using nmtui, and now I am trying to "share" the internet with any device that is connected in eth0 ...

 

 

I followed many tutorials and read several threads, but without success.

 

 

 

 

 

My settings are defaults, I installed ubuntu xenial, just gave apt-get update and upgrade

 

 

 

 

 

I would be grateful if anyone could help me ... thank you.

 

Share this post


Link to post
Share on other sites

You can try to address this at layer 3 (TCP/IP) and let OPi Zero work as a NAT router but just the opposite direction than usual (Wi-Fi is connected to Internet Access Router and clients are behind the Ethernet connection -- so you have to adopt this for most if not all tutorials you find).

 

Another approach is to solve this at layer 2: bridging. This works fine in Ethernet segments (every network switch is just a multi-port bridge) but in your scenario with Wi-Fi being connected to another AP you'll most probably run into a problem: the AP dropping packets with 'wrong' MAC addresses. The usual way to solve this here: https://wiki.debian.org/BridgeNetworkConnections#Bridging_with_a_wireless_NIC

 

Though I would assume following the above tutorial would also require to use the old/anachronistic way to set up interfaces in Debian/Ubuntu. So no more easy going with nmtui/network-manager but dealing with wpa_supplicant or even worse adding WPA passphrase to interfaces file.

 

Since network-manager can also deal with bridges another attempt would be to simply remove eth0 from /etc/network/interfaces and try to setup the bridge with nmcli: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/ch-Configure_Network_Bridging.html(don't know whether that works for you -- please see 2nd paragraph there)

Share this post


Link to post
Share on other sites

You can try to address this at layer 3 (TCP/IP) and let OPi Zero work as a NAT router but just the opposite direction than usual (Wi-Fi is connected to Internet Access Router and clients are behind the Ethernet connection -- so you have to adopt this for most if not all tutorials you find).

 

Another approach is to solve this at layer 2: bridging. This works fine in Ethernet segments (every network switch is just a multi-port bridge) but in your scenario with Wi-Fi being connected to another AP you'll most probably run into a problem: the AP dropping packets with 'wrong' MAC addresses. The usual way to solve this here: https://wiki.debian.org/BridgeNetworkConnections#Bridging_with_a_wireless_NIC

 

Though I would assume following the above tutorial would also require to use the old/anachronistic way to set up interfaces in Debian/Ubuntu. So no more easy going with nmtui/network-manager but dealing with wpa_supplicant or even worse adding WPA passphrase to interfaces file.

 

Since network-manager can also deal with bridges another attempt would be to simply remove eth0 from /etc/network/interfaces and try to setup the bridge with nmcli: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/ch-Configure_Network_Bridging.html(don't know whether that works for you -- please see 2nd paragraph there)

 

Almost all of the tutorials I followed used wpa_supplicant, I tried each one of them, but I could not get it to work.
At first, I thought it did not work because the network manager was conflicting with wpa_supplicant, but then I read that when you edit some interface in the / etc / network / interfaces file, the network manager ignores that interface. I tried many ways, with passphrase in all places where it was possible, but it simply did not work.
 
The brige was one of my first attempts, but it did not work either.
 
It's my second day trying this, I'm so tired, I'm still looking, but I will not try anything that nobody is sure is working ...
 
Thank you tkaiser

Share this post


Link to post
Share on other sites

Well, I usually do this stuff with capable Wi-Fi hardware (capable == not that what's used on el cheapo SBC and especially not the Zero which can be considered as 'as low as possible' Wi-Fi... you get what you pay for as usual) and then using either OpenWRT/LEDE or when it's Apple equipment then the appropriate utility.

 

Such a mode works but as already said you have to take care that MAC addresses get 'spoofed'. And sorry, won't try it out myself since for exactly such a use case there's an Airport Express lying around but it should be noted that some people on the forum had success getting OpenWRT to run on the Zero (relying on Armbian's build system for kernel and driver but sometimes information was conflicting since someone said he had OpenWRT with kernel 3.18 on the Zero). Just search the forum (see my sig) for 'zero openwrt' and be careful using 3rd party images of unknown origin (I would never use those, only stuff that has been built from scratch but no idea whether someone created an OpenWRT tutorial for the Zero already)

Share this post


Link to post
Share on other sites

Why are you messing with wpa_supplicant when you were already "able to connect to [your] wifi AP using nmtui, and now [you're] trying to share the internet with any device that is connected in eth0 ...".

 

In the simplest realization this would just need a static private IP address for eth0, ip forwarding, a NAT iptables rule, static addresses, routes, and dns settings on the connected devices.

 

You say you are tired from trying out so many things but you do not describe what went wrong in even a single try.

Share this post


Link to post
Share on other sites

a static private IP address for eth0, ip forwarding, a NAT iptables rule, static addresses, routes, and dns settings on the connected devices.

 

Static configurations? At least I hate this so much that I would immediately throw the Zero in the bin and replace it with any OpenWRT/LEDE supported router/AP (way better Wi-Fi performance, the usual 'you get what you pay for' rule) or would better try out 2nd link from my 1st link above (another layer 3 attempt): https://wiki.debian.org/BridgeNetworkConnectionsProxyArp

Share this post


Link to post
Share on other sites

Well, I usually do this stuff with capable Wi-Fi hardware (capable == not that what's used on el cheapo SBC and especially not the Zero which can be considered as 'as low as possible' Wi-Fi... you get what you pay for as usual) and then using either OpenWRT/LEDE or when it's Apple equipment then the appropriate utility.

 

Such a mode works but as already said you have to take care that MAC addresses get 'spoofed'. And sorry, won't try it out myself since for exactly such a use case there's an Airport Express lying around but it should be noted that some people on the forum had success getting OpenWRT to run on the Zero (relying on Armbian's build system for kernel and driver but sometimes information was conflicting since someone said he had OpenWRT with kernel 3.18 on the Zero). Just search the forum (see my sig) for 'zero openwrt' and be careful using 3rd party images of unknown origin (I would never use those, only stuff that has been built from scratch but no idea whether someone created an OpenWRT tutorial for the Zero already)

 

I'm not too worried about quality or speed, I just need this to work ...
I read some topics about OpenWRT in Pi Zero, it should work, but the other things I plan to do will not work well with openwrt ...

Share this post


Link to post
Share on other sites

Why are you messing with wpa_supplicant when you were already "able to connect to [your] wifi AP using nmtui, and now [you're] trying to share the internet with any device that is connected in eth0 ..."

 

 

In most of the tutorials I tried, wlan0 and eth0 were edited in the /etc/network/ interfaces file, and the network manager does not mess with the interfaces that are configured in the file.
 
 

In the simplest realization this would just need a static private IP address for eth0, ip forwarding, a NAT iptables rule, static addresses, routes, and dns settings on the connected devices.

 
Almost all the tutorials I tried did this, all the commands worked, but in the end something was wrong ...
 
 

You say you are tired from trying out so many things but you do not describe what went wrong in even a single try.

 
Most of the time the wifi did not connect, but when I connected, my other computer connected to the eth0 of OPIZero could not find an IP, and even if I put it manually, there was no internet. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

0

  • Support the project

    We need your help to stay focused on the project.

    Choose the amount and currency you would like to donate in below.