Jump to content

Cant connect without ethernet


colic

Recommended Posts

Im not sure if this is the right forum. Ive also Googled and found similar problems, but no solution that works for me. So Im happy to be LMGTFY with some hints, or shown the right forum :-)

 

Im running an OrangePi Zero on Armbian (lsb_release reports Ubuntu 16.04.3 LTS). 

 

I have networking set up with both ethernet and wifi. Both work.

But I want to have ethernet as static IP, and wireless as dhcp.

My config looks like this:

 

allow-hotplug eth0
iface eth0 inet static
address 192.168.4.122
netmask 255.255.255.0
gateway 192.168.4.1
broadcast 192.168.4.255
dns-nameservers 8.8.8.8 8.8.8.4

allow-hotplug wlan0
auto wlan0
iface default inet dhcp
iface wlan0 inet dhcp
broadcast 192.168.4.255
gateway 192.168.4.1
#   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# Disable power saving on compatible chipsets (prevents SSH/connection dropouts over WiFi)
wireless-mode Managed
wireless-power off

auto lo
iface lo inet loopback

This works except if I boot without the ethernet cable connected, wireless does not come up, or at least is not accessible externally. IN other words the device is inaccessible.

 

I understand that this could be because all traffic goes through the ethernet connection regardless. While this may explain it, I dont understand why that would be the case nor how to fix it. My Ubuntu laptp, for example, has ethernet and wireless and happily uses whichever is available. My laptop however, has no interfaces config, it just defaults to dhcp I assume.

 

How can I have wireless as dhcp, ethernet as static but connect to whichever is available on Armbian?

 

Link to comment
Share on other sites

Thanks manuti. You're right, that was missing but it wasnt the issue (ie I added it but to no avail).

 

I think the issue is more fundamental. As I mentioned, bith ehternet and wifi already  work, and nmtui was used to do the wifi. All good there.

 

Is there anyone out there knows the correct way to do this so that wifi and ehternet come up as available, and you can boot with both or just one?

 

Assume Ive added the dns in my examples since that's now in there with no change.

Link to comment
Share on other sites

Oops, sorry, my browser was open on an old page, didnt see your reply!

 

Well maybe I should change my question then!! The Orange Pi will be located in a physically remote network, accessible by port forward through a router that does not allow reservation of dhcp addresses. So I need a way to know what IP address the Pi will boot up with. How do I do that if not through a static IP in interfaces?

 

I do see plenty of posts with a static ip setup. So I think it works, its just on boot there's a problem if eth0 isnt there.

 

Edited by colic
didnt see earlier reply !
Link to comment
Share on other sites

This way of configuration works, but is not the better one. You can set static IP using nmtui.

You can try installing Dataplicity (from dataplicity.com) to access remotely and after this read the IP. 

Or search some script or Python script to send you by email the IP after the boot and connect. 

Link to comment
Share on other sites

The problem is I cant change the port forward in the router. So having a script with the IP will work, until it changes. Then it's completely useless.

 

I also need to connect to the ethernet, not wifi (which is there only as a backup for access). So its the ethernet, not the wifi, that needs the static IP. So as far as I know nmtui would not help there either. 

 

Which is sort og how I ended up where i am !!

 

 

Link to comment
Share on other sites

I have an old script in my GitHub (please search with my nick). You can add as a cron job and use, because the script email the IP every time the IP is different than the previous one. I start the loop with an IP never used on my network, in this way I always have the fist ip assignment and in every change the new one. 

With nmtui you can config completely eth and wlan connections. With nmtui-connetc only wlan. 

Link to comment
Share on other sites

These solutions haven´t been working for me and I am getting increasingly more frustrated. Running an Orange Pi Zero with a MT7601U USB wireless adapter with device code 148f:760b and a Kingston 32GB sd card.

 

In my attempts I have tried the following:

- All four available distros available of Armbian; Xenial, Jessie, Bionic, and Stretch. With the older distros the MT7601U driver needs to be installed manually which creates all sorts of issues of its own. Wifi works out of the box with the latest distros, but also no internet.

- All sorts of variations of /etc/resolv.conf, /etc/network/interfaces, setting nmtui manually, /etc/wpa_supplicant/wpa_supplicant.conf, proxy, and setting daily kernel updates were unsuccessful. 

 

Using the device now for Shairport-sync which works without the internet, but it seems a bit of a waste. Beating myself up for spending so much tome on a cheap device and network card although I really want to get it to work the way I intended to. I really do think that the issue is the network card as internet works using the xr819. Am I missing something? 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines