Go Down

Topic: Yun not connecting to Internet through Ethernet wired connection: Please observe (Read 17580 times) previous topic - next topic

BREL

Hi Federico & All,

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.

Regards,

BREL

OttoF

you have different ip ranges on wlan and ethernet
.240.
.1.
both must be in the same range

PCWorxLA


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...

Ralf

commsec

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.   

sonnyyu

When the problem exist run root@Arduino:~# route

Code: [Select]

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0
192.168.0.0     *               255.255.255.0   U     0      0        0 wlan0
192.168.0.0     *               255.255.255.0   U     10     0        0 eth1


eth1  is missing from default Destination.

fix method 1: root@Arduino:~#/etc/init.d/network  restart
run root@Arduino:~# route again
Code: [Select]

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0
default         192.168.0.1     0.0.0.0         UG    10     0        0 eth1
192.168.0.0     *               255.255.255.0   U     0      0        0 wlan0
192.168.0.0     *               255.255.255.0   U     10     0        0 eth1


fix method 2:  root@Arduino:~#route add default gw 192.168.0.1 metric 10 eth1

Code: [Select]

default         192.168.0.1     0.0.0.0         UG    10     0        0 eth1







commsec

    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 ?

Thanks for any further suggestions.
Valter[/list]

sonnyyu


commsec


How can I make sure that eth1 connects to the Internet through the router automatically after it has assigned a dynamic IP address?

Thanks for any further suggestions.
Valter

sonnyyu

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

Code: [Select]

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


The credit of https://forum.openwrt.org/viewtopic.php?id=44877

federicofissore

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
Code: [Select]

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
Code: [Select]

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)

commsec

Hi Federico,
what exactly you mean with "I've just reflashed my yun and booted it" ?

Thanks, Valter

federicofissore

My yun is the target of several experiments: I meant I've reset it to factory settings

sonnyyu


I'm sorry I could reproduce the issue.


produce the issue: only connect with Ethernet. I change Router's DHCP Address Lease Time from default 120 minutes to  few  minutes





Now after few minutes, issue shows up.

ChuckEM

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.

federicofissore

Guys, can you just tell me if the above patch is still rocking or if some of you have encountered the issue anyway?

Go Up