Connecting dev-board to internet via Ethernet cable connection to host pc
by AstroProgrammer from LinuxQuestions.org on (#6DDN5)
Hello i am trying to connect to the internet on my DE10 nano board (running debian) via a ethernet cable that connected to my host pc (Windows 10). Currently i am able to SSH into DE10 board via the ethernet cable by ensuring that the network prefix of the ethernet adapter from the host matches the network prefix of the de10 ip address. However i am unable to ping www.google.com which tells me am still not connected to the internet. I wanted to share my set up process so that you know what i did so far:
First i set up the ethernet adapters IP address to 192.168.2.107, on my host PC the ethernet adapter info is:
Code:Ethernet adapter Ethernet 3:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::ea97:cab3:5d6d:fd4a%24
IPv4 Address. . . . . . . . . . . : 192.168.2.107
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Next on the de10 board i set up the ip address for the de10:
Code:ifconfig eth0 192.168.2.123Next i set the default gate way to 192.168.2.1 because that's the gateway for my wifi router:
Code:ip route add default via 192.168.2.1The command route -ne now returns:
Code:Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0On my de10 board, ip a returns:
Code:1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 06:c0:3f:00:d8:5f brd ff:ff:ff:ff:ff:ff
inet 192.168.2.123/24 brd 192.168.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::4c0:3fff:fe00:d85f/64 scope link
valid_lft forever preferred_lft forever
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
link/sit 0.0.0.0 brd 0.0.0.0
The contents of /etc/resolv.conf:
Code:# Generated by NetworkManager
search localdomain linuxvmimages.local
nameserver 192.168.88.2
nameserver 8.8.8.8
nameserver 127.0.1.1
The contents of /etc/network/interfaces.d are default:
Code: # interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo eth0
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
The contents of /etc/dhcp/dhclient.conf are default:
# Configuration file for /sbin/dhclient.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
# man page for more information about the syntax of this file
# and a more comprehensive list of the parameters understood by
# dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
# not leave anything out (like the domain name, for example), then
# few changes must be made to this file, if any.
#
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers;
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/sbin/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;
#alias {
# interface "eth0";
# fixed-address 192.5.5.213;
# option subnet-mask 255.255.255.255;
#}
#lease {
# interface "eth0";
# fixed-address 192.33.137.200;
# medium "link0 link1";
# option host-name "andare.swiftmedia.com";
# option subnet-mask 255.255.255.0;
# option broadcast-address 192.33.137.255;
# option routers 192.33.137.250;
# option domain-name-servers 127.0.0.1;
# renew 2 2000/1/12 00:00:01;
# rebind 2 2000/1/12 00:00:01;
# expire 2 2000/1/12 00:00:01;
#}
My attempt to ping www.google.com:
Code:root@de0-nano:~# ping www.google.com
ping: www.google.com: Temporary failure in name resolutionMy attempt to ping 8.8.8.8:
Code:root@de0-nano:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.2.123 icmp_seq=1 Destination Host UnreachableCan anyone help me with this?
Please let me know if any other info is needed, Thank you
First i set up the ethernet adapters IP address to 192.168.2.107, on my host PC the ethernet adapter info is:
Code:Ethernet adapter Ethernet 3:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::ea97:cab3:5d6d:fd4a%24
IPv4 Address. . . . . . . . . . . : 192.168.2.107
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Next on the de10 board i set up the ip address for the de10:
Code:ifconfig eth0 192.168.2.123Next i set the default gate way to 192.168.2.1 because that's the gateway for my wifi router:
Code:ip route add default via 192.168.2.1The command route -ne now returns:
Code:Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0On my de10 board, ip a returns:
Code:1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 06:c0:3f:00:d8:5f brd ff:ff:ff:ff:ff:ff
inet 192.168.2.123/24 brd 192.168.2.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::4c0:3fff:fe00:d85f/64 scope link
valid_lft forever preferred_lft forever
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
link/sit 0.0.0.0 brd 0.0.0.0
The contents of /etc/resolv.conf:
Code:# Generated by NetworkManager
search localdomain linuxvmimages.local
nameserver 192.168.88.2
nameserver 8.8.8.8
nameserver 127.0.1.1
The contents of /etc/network/interfaces.d are default:
Code: # interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo eth0
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
The contents of /etc/dhcp/dhclient.conf are default:
# Configuration file for /sbin/dhclient.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
# man page for more information about the syntax of this file
# and a more comprehensive list of the parameters understood by
# dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
# not leave anything out (like the domain name, for example), then
# few changes must be made to this file, if any.
#
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers;
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/sbin/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;
#alias {
# interface "eth0";
# fixed-address 192.5.5.213;
# option subnet-mask 255.255.255.255;
#}
#lease {
# interface "eth0";
# fixed-address 192.33.137.200;
# medium "link0 link1";
# option host-name "andare.swiftmedia.com";
# option subnet-mask 255.255.255.0;
# option broadcast-address 192.33.137.255;
# option routers 192.33.137.250;
# option domain-name-servers 127.0.0.1;
# renew 2 2000/1/12 00:00:01;
# rebind 2 2000/1/12 00:00:01;
# expire 2 2000/1/12 00:00:01;
#}
My attempt to ping www.google.com:
Code:root@de0-nano:~# ping www.google.com
ping: www.google.com: Temporary failure in name resolutionMy attempt to ping 8.8.8.8:
Code:root@de0-nano:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.2.123 icmp_seq=1 Destination Host UnreachableCan anyone help me with this?
Please let me know if any other info is needed, Thank you