GW102 Development Manual

Ethernet Interface

Interface Description

The GW102 gateway provides two Ethernet interfaces, and both Ethernet ports support 10/100Mbps rates. The physical form of the connector is a dual-port RJ45 socket. Each Ethernet port has two LED indicators to indicate the Ethernet working status. The indicators are off when no Ethernet cable is connected. After an Ethernet cable is connected, the yellow LED is on, indicating normal connection; when data is being transmitted, the green LED blinks. The actual interface diagram is as follows:

Linux System Interface Definitions

Enclosure silkscreen PCB silkscreen Device name in Linux system Default IP
NET2 ETH1 eth1 192.168.2.188
NET1 ETH2 eth0 192.168.1.188

The enclosure silkscreen is on the enclosure The PCB silkscreen is beside the RJ45 connector on the PCB circuit board

Common Network Commands

View network devices in the system

# ifconfig -a
eth0      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)

eth1      Link encap:Ethernet  HWaddr 2e:ec:c8:cc:a2:fb
          BROADCAST MULTICAST  MTU:1500  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:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

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)

sit0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          NOARP  MTU:1480  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

  1. Temporary configuration The IP address configured by this method is for temporary use only. It is not stored in the system and the configuration will be restored after a reboot.
# ifconfig eth0 192.168.1.100
  1. Permanent configuration

To make the configuration take effect after a reboot, you need to write the configuration information to the configuration file.

  • eth0 configuration file /etc/systemd/network/eth0.network
  • eth1 configuration file /etc/systemd/network/eth1.network

The default static IP configuration parameters are as follows

[Match]
Name = eth0

[Network]
Address = 192.168.1.188/24
Gateway = 192.168.1.1

The dynamic DHCP configuration parameters are as follows

[Match]
Name = eth0

[Network]
DHCP = yes

Configure the Gateway

# route add default gw 192.168.1.1

Configure DNS Domain Name Resolution 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 between the development board and the Internet.

# ping bing.com
PING bing.com (204.79.197.200): 56 data bytes
64 bytes from 204.79.197.200: icmp_seq=0 ttl=118 time=12.205 ms
64 bytes from 204.79.197.200: icmp_seq=1 ttl=118 time=12.017 ms
64 bytes from 204.79.197.200: icmp_seq=2 ttl=118 time=11.565 ms
64 bytes from 204.79.197.200: icmp_seq=3 ttl=118 time=12.116 ms

SSH Function

GW102 supports SSH remote connection. You can use client software that supports the SSH protocol to connect to the gateway via IP address.

The connection parameters are as follows

  • Protocol: SSH
  • Username: root
  • Password: empty