.. include:: ../substitutions.rst .. include:: stdout.rst Ethernet ======== The phyCORE-RT1170 module features one external Gigabit Ethernet port (eth0) using the TI DP83867IRRGZ PHY, while the phyBOARD-Atlas carrier board provides one external 10/100 Mbps Ethernet port (eth1) using the KSZ8081RNB1A PHY. All network configuration is handled using Zephyr’s built-in commands. For detailed hardware-level information, refer to section *7.2 Ethernet* in the |hw-manual-link|. Requirements ------------- * CAT5e cable * Network switch connected to a DHCP enabled network Shell Usage ----------- Zephyr's ``net`` shell subsystem lets you inspect and manage network interfaces at runtime. To list the available network interfaces along with their link state, MAC address, and any assigned IP addresses: .. code-block:: console :substitutions: |target-prompt| net iface .. code-block:: none :caption: Expected Output uart:~$ net iface Default interface: 1 Interface eth0 (0x800042a0) (Ethernet) [1] =================================== Link addr : 22:67:82:57:CB:72 MTU : 1500 Flags : AUTO_START,IPv4,IPv6 Device : ethernet (0x300b6264) Status : oper=UP, admin=UP, carrier=ON Ethernet capabilities supported: TX checksum offload RX checksum offload 10 Mbits 100 Mbits 1 Gbits MAC address filtering Ethernet PHY device: phy@0 (0x300b6204) Ethernet link speed: 1 Gbits full-duplex IPv6 unicast addresses (max 2): fe80::2067:82ff:fe57:cb72 autoconf preferred infinite IPv6 multicast addresses (max 3): ff02::1 ff02::1:ff57:cb72 IPv6 prefixes (max 2): IPv6 hop limit : 64 IPv6 base reachable time : 30000 IPv6 reachable time : 43427 IPv6 retransmit timer : 0 IPv4 unicast addresses (max 1): IPv4 multicast addresses (max 2): 224.0.0.1 IPv4 gateway : 0.0.0.0 DHCPv4 state : disabled Interface eth1 (0x80004330) (Ethernet) [2] =================================== Link addr : B6:18:16:76:84:43 MTU : 1500 Flags : AUTO_START,IPv4,IPv6 Device : ethernet (0x300b6284) Status : oper=UP, admin=UP, carrier=ON Ethernet capabilities supported: TX checksum offload RX checksum offload 10 Mbits 100 Mbits MAC address filtering Ethernet PHY device: phy@1 (0x300b61e4) Ethernet link speed: 100 Mbits full-duplex IPv6 unicast addresses (max 2): fe80::b418:16ff:fe76:8443 autoconf preferred infinite IPv6 multicast addresses (max 3): ff02::1 ff02::1:ff76:8443 IPv6 prefixes (max 2): IPv6 hop limit : 64 IPv6 base reachable time : 30000 IPv6 reachable time : 23013 IPv6 retransmit timer : 0 IPv4 unicast addresses (max 1): IPv4 multicast addresses (max 2): 224.0.0.1 IPv4 gateway : 0.0.0.0 DHCPv4 state : disabled ``eth0`` is the module's Gigabit Ethernet port, while ``eth1`` is the carrier board's 10/100 Mbps port. Both interfaces are up and have negotiated a link, but neither has an IPv4 address yet since DHCPv4 is disabled by default. Obtaining an IPv4 Address ~~~~~~~~~~~~~~~~~~~~~~~~~~ If a DHCP server is reachable on the network, Zephyr's DHCPv4 client requests an address automatically once the interface link comes up. To manually start (or restart) the DHCPv4 client on a specific interface: .. code-block:: console :substitutions: |target-prompt| net dhcpv4 client start 1 |target-prompt| net dhcpv4 client start 2 Replace the trailing number with the interface index reported by ``net iface`` (interfaces are numbered starting at 1). Once a lease has been obtained, run ``net iface`` again to confirm the assigned address: .. code-block:: console :substitutions: |target-prompt| net iface .. code-block:: none :caption: Expected Output uart:~$ net iface Default interface: 1 Interface eth0 (0x800042a0) (Ethernet) [1] =================================== Link addr : 22:67:82:57:CB:72 MTU : 1500 Flags : AUTO_START,IPv4,IPv6 Device : ethernet (0x300b6264) Status : oper=UP, admin=UP, carrier=ON Ethernet capabilities supported: TX checksum offload RX checksum offload 10 Mbits 100 Mbits 1 Gbits MAC address filtering Ethernet PHY device: phy@0 (0x300b6204) Ethernet link speed: 1 Gbits full-duplex IPv6 unicast addresses (max 2): fe80::2067:82ff:fe57:cb72 autoconf preferred infinite IPv6 multicast addresses (max 3): ff02::1 ff02::1:ff57:cb72 IPv6 prefixes (max 2): IPv6 hop limit : 64 IPv6 base reachable time : 30000 IPv6 reachable time : 43427 IPv6 retransmit timer : 0 IPv4 unicast addresses (max 1): 10.0.0.20/255.255.255.0 DHCP preferred IPv4 multicast addresses (max 2): 224.0.0.1 IPv4 gateway : 10.0.0.254 DHCPv4 lease time : 6000 DHCPv4 renew time : 3000 DHCPv4 server : 10.0.0.1 DHCPv4 requested : 10.0.0.20 DHCPv4 state : bound DHCPv4 attempts : 1 DHCPv4 state : bound Interface eth1 (0x80004330) (Ethernet) [2] =================================== Link addr : B6:18:16:76:84:43 MTU : 1500 Flags : AUTO_START,IPv4,IPv6 Device : ethernet (0x300b6284) Status : oper=UP, admin=UP, carrier=ON Ethernet capabilities supported: TX checksum offload RX checksum offload 10 Mbits 100 Mbits MAC address filtering Ethernet PHY device: phy@1 (0x300b61e4) Ethernet link speed: 100 Mbits full-duplex IPv6 unicast addresses (max 2): fe80::b418:16ff:fe76:8443 autoconf preferred infinite IPv6 multicast addresses (max 3): ff02::1 ff02::1:ff76:8443 IPv6 prefixes (max 2): IPv6 hop limit : 64 IPv6 base reachable time : 30000 IPv6 reachable time : 23013 IPv6 retransmit timer : 0 IPv4 unicast addresses (max 1): 10.0.0.21/255.255.255.0 DHCP preferred IPv4 multicast addresses (max 2): 224.0.0.1 IPv4 gateway : 10.0.0.254 DHCPv4 lease time : 6000 DHCPv4 renew time : 3000 DHCPv4 server : 10.0.0.1 DHCPv4 requested : 10.0.0.21 DHCPv4 state : bound DHCPv4 attempts : 1 DHCPv4 state : bound In above example, both interfaces have now obtained a lease from the DHCP server: ``eth0`` was assigned ``10.0.0.20`` and ``eth1`` was assigned ``10.0.0.21``. Testing Connectivity ~~~~~~~~~~~~~~~~~~~~~ To verify network connectivity, ping a reachable host directly from the shell. In this example, we ping the DHCP server at ``10.0.0.1``: .. code-block:: console :substitutions: |target-prompt| net ping 10.0.0.1 .. code-block:: none :caption: Expected Output uart:~$ net ping 10.0.0.1 PING 10.0.0.1 28 bytes from 10.0.0.1 to 10.0.0.21: icmp_seq=1 ttl=64 time=1 ms 28 bytes from 10.0.0.1 to 10.0.0.21: icmp_seq=2 ttl=64 time=1 ms 28 bytes from 10.0.0.1 to 10.0.0.21: icmp_seq=3 ttl=64 time=1 ms Replace the IP address with that of any other reachable host on your network to test connectivity from a different interface. .. include:: ../../common/support-disclaimer-us.rst