You are here

PI to Ubiquiti and internet access

11 posts / 0 new
Last post
WB6IWT
PI to Ubiquiti and internet access
Hi,

    How do I setup my Raspian interfaces file to be able to see my NODE (eth0) and to connect to the internet thru my wi-fi card (wlan0) on the pi at the sme time?. When I need to update the AREDN firmware, I'm going to need the internet access.Currently I can connect to one or the other but not both at the same time. 

Thanks,
Paul
WB6IWT
KG6JEI
Try the "disable defaulte
Try the "disable defaulte gateway" checkbox on the Meshnode and then connect to both as you normally would.

Note: this will tell your Pi not to use the mesh node for Internet access even if a mesh gateway exists on the mesh.
Note 2: Windows handles this better then Linux, you may end up needing to manually configure your DNS servers to point to the mesh node first to resolve local.mesh names.

Alternaicely if you use a smart switch to pull out the "WAN" port of the mesh node the Pi on the Lan port will be able to get out to the Internet (even though the rest of the mesh can't )

This is known as setting up a multihomed host and generally does require some network skill.
WB6IWT
Thanks for the response but
Thanks for the response but the problem is with the Pi. Looking at my browser, when I have wi-fi internet access and I plug in my network cable to my node, I lose internet access but gain the node access. I think its a DHCP problem.
 
K5DLQ
K5DLQ's picture
Did you try the disable
Did you try the disable default gateway option on the node that are connecting the pi to?
(as Conrad mentioned).  That is what that feature is designed to do.
WB6IWT
I did disable the default
I did disable the default gateway on the node but it didn't make an difference. My browser loses the internet from my wi-fi card, as soon as I plug the node lan cable into the pi. If the browser can't see the connection, the node won't either. I also tried disabling the default gateway and powering the pi up with the lan cable already plugged in but that didn't work either.
K5DLQ
K5DLQ's picture
Curious?  What version of
Curious?  What version of Raspian?  Wheezy, by chance?
Many have had issues with it and DNS type issues.  Jessie seems to work better for me.
KG6JEI
Yep this sounds about right,
Yep this sounds about right,

As I noted above the DNS needs to still be listed in /etc/resolv.conf to point to the mesh node (and I've seen the DHCP daemon in the past just overwrite /etc/resolve.conf with the 'latest' dhcp release it has gotten instead of appending them)   (this is the one part Windows does real nicely)

I would suspect if you were to try and access nodes by IP address (with the "disable default gateway" box checked and saved and Ethernet reset so you get a new DHCP lease(unplug ethernet from pi and plug back in)) you would likely get to it by IP and find it is just a DNS resolution issue.
WB6IWT
Yes wheezy, version 7. 
Yes wheezy, version 7. 
K5DLQ
K5DLQ's picture
You might try Raspbian Jessie
You might try Raspbian Jessie.  I think they fixed some DHCP/DNS issues in it that you are experiencing. (It fixed it for me).
kj6dzb
kj6dzb's picture
Disney sound like a problem
Disney sound like a problem with the district. It's a routing problem, that will require you to set default routes. To get access To the mesh subnet on eth0 and to set a default route for 0.0.0.0 on wlan. This can be tricky so look it up with Google. 73 mathison kj6dzb
N7TZK
clarifying your intent

Paul,
I'm not sure I understand what your intent is.  When you say "my browser", are you referring to the browser on your RPI?  In my case, all I really wanted was my Raspberry Pi to be accessible from the mesh and advertise the services it had on it... which included an NTP server which in turn was synced to the Internet via the WiFi interface on the RPI.  That much was a simple case of doing as others have suggested here and disabling the default default gateway on the node.  You might need to reboot the node after changing that for it to take affect... I don't recall for sure. 

What making this change does is keeps the node's DHCP server from providing the RPI a default gateway IP at the same time it is providing an IP and DNS info.  Once you have made the change on the node and rebooted it, you may need to reboot your RPI in order for it to forget the old info it got from the node's DHCP server and get the new (which excludes the default gateway IP).

Why is this step important?  Because your WiFi interface likely is ALSO configured to use DHCP to get its IP... and it will get a default gateway as well.  So... if you don't change the mesh node's default behavior, your poor RPI is going to have TWO default gateways.  How is to know which to use?  Essentially, in that case if a destination address is on the net associated with the node it will send traffic to the node... and if is on the net associated with your WiFi network, it will send the traffic there.  But if the destination IP is on NEITHER of those nets... as is the case with public internet destinations... that is what "default" gateways are for.  But you have two.  Hmmm.  What is the RPI to do?

This is where "metrics" come in.  Each "route" (including default routes) that your RPI knows about will have a metric assigned to it by the operating system.  And it is different for an Ethernet interface (eth0) than a wireless interface (wlan0).  If memory serves, eth0 has the lowest metric number assigned by default and thus if you have two default routes, eth0 wins...IF... it is active (connected).  Thus... soon as you connect it to your node, your RPI tries to connect to the public internet through the node instead of through your wireless connection.  Not likely what you want.

The added complication comes if you want your mesh node to communicate to the public internet... VIA the RPI.  At this point, you must enable "routing" on your RPI so it will automatically pass traffic from one interface (eth0) to another (wlan0).  But... you also must tell it which traffic you want going where.  And that gets significantly more complicated.

If your only concern is the relatively rare situation where you want to update the node's firmware, I'd probably just follow the KISS principal and use your RPI's browser to download the relevant file and to manually upload it to the node.  If you also want to use Internet time... then just point your node at the RPI and let the RPI's NTP server provide the time.  It will essentially be Internet time since the RPI likely is already syncing its system clock to an Internet time source. 

And if you want your mesh to have access to the public internet via your node... then you'll have to have the relevant external switch so you can access your node's WAN VLAN as noted by an earlier poster.  In theory, I think you could do that via your RPI, but the routing and vlan configuration issues involved get you a longgg way past the KISS principal!

Hope my ramblings makes some kind of sense...

Dave

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer