After the successful initial set up of my Rock Pi S, I started going on with my project self made smart home assistant. Therefor, it is necessary to configure the network interface.
SSH Does Not Mean Network Is Fine
Though we already are able to connect to the Rock Pi S via SSH, we probably cannot yet ping servers outside our local network. A ping to google.com, for example, will result in no answer:
Destination Host Unreachable
The reason is, that there is no standard gateway set in the network configuration, which causes, that only local network hosts inside the same subnet can be reached. The gateway is like the door of your flat. If You don't know, where it is, You cannot even leave your flat and see the rest of the street.
To find out your standard gateway, there are different approaches between Windows and Linux. Maybe You need to investigate this for your client operating system. On Windows, You open a command line and type:
ipconfig
The output looks like:
Something DNS-Suffix : router.something
Local IPv6-Address . : text::text:text:text:more:text%20
IPv4-Address . . . . : 192.168.3.3
Subnet mask . . . . . : 255.255.255.0
Standard gateway . . : 192.168.3.1
On Linux, you open a terminal and type:
sudo route -n
This will show you something like this:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.3.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 0.0.0.0 0.0.0.0 U 202 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 202 0 0 eth0
192.168.3.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
In the examples above the required information, the standard gateway, is to find in the red line. (On Windows it is the line with "Standard gateway", in Linux it is the line containing "UG" in the column "Flags".) You need the IP-address, in this case it is 192.168.3.1.
Tell the Rock Pi S its standard gateway with:
sudo ip route add default via 192.168.3.1
Done. Now, a ping to google.com should look like this:
rock@rockpis:~$ ping google.com
PING google.com (216.58.213.206) 56(84) bytes of data.
64 bytes from ham02s15-in-f206.1e100.net (216.58.213.206): icmp_seq=1 ttl=56 time=29.4 ms
64 bytes from ham02s15-in-f206.1e100.net (216.58.213.206): icmp_seq=2 ttl=56 time=29.9 ms
64 bytes from ham02s15-in-f206.1e100.net (216.58.213.206): icmp_seq=3 ttl=56 time=29.7 ms
Kommentare
Kommentar veröffentlichen