The PanGu board provides a 10/100/1000 Mbps adaptive Ethernet interface (J2). The device name in Linux is eth0.
# ifconfig -aeth0 Link encap:Ethernet HWaddr c2:83:23:40:bf:7b inet6 addr: fde3:c0c9:1c0a:0:c083:23ff:fe40:bf7b/64 Scope:Global inet6 addr: fe80::c083:23ff:fe40:bf7b/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:20 errors:0 dropped:12 overruns:0 frame:0 TX packets:47 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2132 (2.0 KiB) TX bytes:8406 (8.2 KiB)lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
Configure IP address
# ifconfig eth0 192.168.1.100 |
Configure network mask
# route add default gw 192.168.1.1 |
Configure DNS service
# echo "nameserver 8.8.8.8" > /etc/resolv.conf# echo "nameserver 114.114.114.114" >> /etc/resolv.conf |
After the configuration is complete, you can use the ping command to test the connectivity of the development board to the Internet.
# ping bing.comPING bing.com (204.79.197.200): 56 data bytes64 bytes from 204.79.197.200: icmp_seq=0 ttl=118 time=12.205 ms64 bytes from 204.79.197.200: icmp_seq=1 ttl=118 time=12.017 ms64 bytes from 204.79.197.200: icmp_seq=2 ttl=118 time=11.565 ms64 bytes from 204.79.197.200: icmp_seq=3 ttl=118 time=12.116 ms |