Step 4: Configure your network
When Yocto starts, a Linux shell appears on the serial console. The default login user is root.
Digi Embedded Yocto 2.0-r5 ccimx6ulsbc /dev/ttymxc4 ccimx6ulsbc login: root BusyBox v1.23.2 (2017-01-25 11:35:08 CET) built-in shell (ash) Enter 'help' for a list of built-in commands. root@ccimx6ulsbc:~#
Network interfaces
Ethernet
There are two Ethernet controllers:
- eth0 is configured with a default static IP address of 192.168.42.30.
- eth1 is configured with a default static IP address of 192.168.44.30.
Note In the following table, the first column shows the U-Boot environment variables that hold the MAC address of each network interface:
- 'ethaddr' holds the MAC address for ENET1, Linux probes this second and sees this as eth1
- 'eth1addr' holds the MAC address for ENET2, Linux probes this first and sees this as eth0
U-Boot environment variable | Ethernet controller | Linux interface |
---|---|---|
ethaddr | ENET1 | eth1 |
eth1addr | ENET2 | eth0 |
Bring the interfaces down:
ifdown eth0
ifdown eth1
Edit the /etc/network/interfaces file to configure different settings or a dynamic IP, like in this example:
auto eth0 iface eth0 inet dhcp
auto eth1 iface eth1 inet dhcp
Restart the interfaces to use the new settings:
ifup eth0
ifup eth1
Wireless
Wireless is configured with a default static IP address 192.168.43.30. Edit the /etc/network/interfaces file to configure different settings or a dynamic IP, like in this example:
auto wlan0 iface wlan0 inet dhcp wpa-driver nl80211 wpa-conf /etc/wpa_supplicant.conf
The default wireless configuration file /etc/wpa_supplicant.conf lets the device connect to any open access point. To connect to a secure access point, edit /etc/wpa_supplicant.conf and configure the settings of your wireless network, like the SSID of the access point, encryption, authentication, etc. See Configuration modes for detailed instructions.
Restart the interface to use the new settings:
ifdown wlan0 && ifup wlan0