When I tried to connect Yun using Ethernet wire to Yun, Status says, Connected, but I am unable to Ping to any websites in the internet. How do I ensure Linino is connected to Internet?
I am using Putty ( windows) to telnet into to Yun. Please find the attached status of Arduino and ifconfig output.
My intention is to run
opkg update
opkg install openssh-sftp-server
Yun is not able to access the http://download.linino.org ( Attchecd screen shot for fYI)
Any help is highly appreciated and thanking you in advance.
OttoF:
you have different ip ranges on wlan and ethernet
.240.
.1. both must be in the same range
Well, strictly speaking, no. But the problem is that you can have an active gateway out of either LAN on only one of them. And it seems that the gateway on the WiFi LAN has a lower metric than then one one the wired LAN...
I have the same behaviour reported by BREL when Ethernet is connected to router using DHCP and try to access the Internet fron this LAN Ethernet port regardless of use of the WiFi access point on the YUN.
I'm insted able to connect the Internet from the LAN Ethernet connected to router using DHCP if the WiFi of YUN is connected to the same router as a device.
I tried to solve this issue using "route" configuration but without success.
Can someone suggest a correct configuration to be set ?
Thanks in advance.
Valter.
Hi sonnyyu, thanks for yours suggestions but I tried with the following results :
fix method 1:
root@Arduino:~# /etc/init.d/network restart
root@Arduino:~# route again ... do not work for me as is..
fix method 2:
root@Arduino:~# route add default gw 192.168.0.1 metric 10 eth1 ... work fine but use manual/fixed IP for the gateway.
I think anyone that connect eth1 to a router via DHCP hope to have eth1 access to the Internet using the gateway . It is possible to automatically set route default gateway also on eth1 (not only wlan0) using the IP value of the router received via DHCP at any reboot ?
After hours testing, I think I found the problem. My router has DHCP lease time set as 120 mins, if I changes it to 2 mins, My Ethernet lost internet in few mins. It is the problem of Openwrt DHCP Client problem.
The fix is:
nano /lib/netifd/dhcp.script
setup_interface () {
proto_init_update "*" 1
proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}"
# TODO: apply $broadcast
for i in $router; do
proto_add_ipv4_route 0.0.0.0 0 "$i"
route add -net 0.0.0.0/0 gw "$i"
done
I'm sorry I could reproduce the issue.
I've just reflashed my yun and booted it with ethernet cable plugged in. Once ready, issued a opkg update and worked fine.
route said
root@Arduino:/# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 10 0 0 eth1
192.168.0.0 * 255.255.255.0 U 10 0 0 eth1
192.168.240.0 * 255.255.255.0 U 0 0 0 wlan0
Then I rebooted with ethernet cable UNplugged, issued opkg update and again worked fine. Route said
root@Arduino:/# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.240.0 * 255.255.255.0 U 0 0 0 wlan0
I confirm that eth1 metric is deliberately set to 10 because otherwise you would lose access to the yun just by plugging in the ethernet cable (yun disappearing from the IDE, stuck ssh connection)
Thanks for the fix for /lib/netifd/dhcp.script sonnyyu. I was trying to log data to xively.com, but the arduino Yun was dropping the internet connection after a couple of hours. I connected a better power supply and edited /lib/netifd/dhcp.script like you showed and the problems are gone. I admit, I don't know if the better power supply helped too, but now that the problem's gone, I'm not going back to investigate.
Can you please explain this part? What is the "metric" parameter, how do I set it, and why does it affect IDE connection?
I have no wifi on the old desktop PC I'm using; connecting over ethernet allows me to see SD card contents (so I know connection is working), but Yun IP address does not appear in IDE menu, so I can't upload sketches and web pages.
I don't think it should affect the Yun appearing in the IDE. This thread is talking about problems accessing the Internet through a default gateway. You have a different issue, which is strictly limited to the local network, and does not involve the default gateway or the Internet. This thread is not applicable to your issue.