2

I'm having trouble connecting to the internet with my Wachendorff Display. I can connect to it via SSH, but I cannot get it to also connect to the internet.

I am able to ping other devices plugged into my router, but I cannot ping websites. (Other devices on the same network have no trouble connecting to the internet)

ping -c 4 192.168.xxx.x works.

ping -c 4 8.8.8.8 doesn't work. "Network is unreachable"

Details:

I have a Wachendorff display that runs Linux (i.MX6 platform) (Linux operating system release 1.1.2(X11/Qt5) (Kernel: 3.0.35) (GNU bash version 4.3.30 arm-poky-linux-gnueabi) that I am trying to connect to the internet. Currently its no problem for me to SSH into it with my laptop, but I cannot get an internet connection.

I am able to use ifconfig eth0 10.0.0.xx netmask 255.255.255.0 up for example, to change the ip address from 192.168.xxx.x to something I think my internet router is expecting (I then loose my SSH and have to re-establish from laptop with new IP address). But, when I try to ping -c 6 8.8.8.8 I get "Network unreachable."

I tried auto eth0, but I get 'auto :command not found' It also says 'command not found' for sudo, dhclient, iface, service, pip, so its been difficult to find hep.

Also, I'm worried that if I successfully set it to dhcp, I'll never be able to SSH into it again. Thoughts?

1 Answer 1

1

I am able to use ifconfig eth0 10.0.0.xx netmask 255.255.255.0 up for example, to change the ip address from 192.168.xxx.x to something I think my internet router is expecting

To setup a network, you need to know the following things:

  • Is the router acting as DHCP server or do the clients need to have fixed IP addresses, or maybe both is allowed. What is the address range of the clients if the addresses were to be fixed?
  • What is the gateway address of the router? This is the crucial point to make Internet connectivity work. Routing is set up with the command route or ip route, dependending on the Linux distro.

The routing table can be shown by route -n or ip route show respectively.

My routing table has an entry like this:

default via 192.168.137.1 dev wlp2s0 proto dhcp metric 600

... which means that it uses the gateway 192.168.137.1 for any addresses that cannot be routed otherwise ("default") via the device "wlp2s0", which is my WLAN device. In this way, Internet addresses like 151.101.129.69 will be routed by using this entry.

If these two points from above are set up appropriately, it is possible to reach hosts in the Internet zone via IP addresses. ping 8.8.8.8 should respond. Now, if you want the Internet hosts to be reachable by hostnames, you need the DNS service:

  • Set a DNS server. Either there is one set up via the DHCP configuration, or you set one manually. The DNS information is held in the file /etc/resolv.conf. You may edit the file directly or take care if it is handled by a tool. It may have only one line:

    nameserver 9.9.9.9
    

Now, also ping stackexchange.com should respond.

2
  • My router is DHCP, and it assigns IP addresses for my home devices at 10.0.0.xx. My device has a fixed IP of 192.168.135.6 (I can change this). Results of route -n: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.135.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0. How can I set a DNS server manually?
    – fk5
    Commented Nov 26, 2019 at 22:28
  • Since the DHCP server of your router assigns addresses in the range 10.0.0.x, the router itself may not be reachable from 192.168.135.6, since this is another address range. Make sure that the router is reachable (ping the router from the client). You may need to change the address of the client to a 10.0.0.x address, but make sure it does not collide with the range the DHCP server assigns. Commented Dec 2, 2019 at 12:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .