> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ethernet

This guide covers configuring, operating, and troubleshooting Ethernet connectivity on the Qualcomm Dragonwing IQ-9075 EVK. The platform supports interface enumeration, data path, link speed configuration, MAC address management, MTU configuration, and network diagnostics.

## Prerequisites

* IQ-9075 EVK hardware
* Ethernet cable (RJ45)
* Host PC on the same network as the IQ-9075 EVK
* SSH client software
* Basic Linux command-line knowledge

## Architecture

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/iq9075-ethernet-architecture.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=91d6d7fac4ae8a51de6ed793ea4ccf3b" width="550" height="853" data-path="Ubuntu/images/peripheral-interfaces/iq9075-ethernet-architecture.png" />

| Component                                  | Description                                                                                                                                                                                |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Application Processor Subsystem (APSS)** | Runs on a Linux-based operating system                                                                                                                                                     |
| **Ethernet driver**                        | Linux kernel driver providing data connectivity over a wired Ethernet interface                                                                                                            |
| **PHY driver**                             | Low-level driver managing the Ethernet physical layer; implements a state machine for PHY lifecycle from initialization to link establishment; interacts with MDIO to access PHY registers |
| **Ethernet hardware**                      | 1× QEP8081 PHY for 10/100/1000/2500 Mbps, enabled by RJ45 connector                                                                                                                        |

## Getting Started

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/iq9075-ethernet-workflow.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=05f9482cf816daec4eef1ee38a3004a6" width="1868" height="181" data-path="Ubuntu/images/peripheral-interfaces/iq9075-ethernet-workflow.png" />

## Bring Up Ethernet

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/iq9075-ethernet-bringup-workflow.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=00f4d7ffb8ac6f40c82c87bad9c1bc0f" width="812" height="112" data-path="Ubuntu/images/peripheral-interfaces/iq9075-ethernet-bringup-workflow.png" />

<Note>
  Establish access to the device via SSH over Wi-Fi or the serial prompt before proceeding. See the [Set up the device](../set-up-the-device) section for instructions.
</Note>

<Note>
  Flash the corresponding CDT on the device to ensure the correct configuration is used for Ethernet bring-up.
</Note>

<Steps>
  <Step title="Configure MAC Address (optional)">
    The IQ-9075 EVK ships with a factory MAC address. Skip this step to use it as-is.

    To change the MAC address:

    ```shell theme={null}
    sudo ifconfig end0 hw ether XX:XX:XX:YY:YY:YY
    ```

    <Warning>
      This MAC address is valid only for the current boot cycle. After rebooting, the device reverts to the address from persistent storage.
    </Warning>
  </Step>

  <Step title="Assign an IP Address">
    On a public network, the DHCP server assigns an IP address automatically. To assign a static IP address manually:

    ```shell theme={null}
    ifconfig end0 192.168.1.2
    ```
  </Step>

  <Step title="Configure MTU">
    ```shell theme={null}
    ifconfig end0 down
    ifconfig end0 mtu 1500
    ifconfig end0 up
    ```
  </Step>

  <Step title="Verify Bring-Up">
    Confirm the following:

    * `end0` is visible in `ifconfig` output
    * Interface status shows `UP BROADCAST RUNNING MULTICAST`
    * IP address is correctly assigned
    * MTU is set to the desired value (typically 1500)
    * No errors in RX/TX packet counters
  </Step>
</Steps>

## Ethernet Operations

### Check Connectivity

Use `ping` to verify connectivity between the device and a remote host. The client IP address must be in the same subnet as the device.

```shell theme={null}
ping 169.254.227.240
```

### Configure NIC Settings

Use `ethtool` to view and configure NIC parameters such as speed, duplex, and auto-negotiation:

```shell theme={null}
ethtool end0
```

To view NIC packet statistics:

```shell theme={null}
ethtool -S end0
```

### Configure Network Interface

Use `ifconfig` to assign addresses and configure interface parameters:

```shell theme={null}
ifconfig end0
```

### Monitor Network Connections

Use `netstat` to monitor incoming/outgoing connections, routing tables, and port usage:

```shell theme={null}
netstat -r
```

### Capture Network Traffic

Use `tcpdump` to intercept and analyze packets:

```shell theme={null}
sudo tcpdump -i any -s 0 -w /home/ubuntu/tcpdump.pcap
```

### View Routing Table

```shell theme={null}
ip r s
```

## Configure Link Speed

Set link speed from the supported modes shown in `ethtool` output:

```shell theme={null}
sudo ethtool -s end0 autoneg on speed 1000 duplex full
```

## Troubleshooting

### Collect Diagnostic Logs

<Steps>
  <Step title="Collect dmesg logs">
    ```bash theme={null}
    sudo dmesg > /home/ubuntu/dmesg_logs.txt
    ```

    Look for: driver initialization messages, PHY detection, link status changes, and errors.
  </Step>

  <Step title="Collect tcpdump logs">
    ```bash theme={null}
    sudo tcpdump -i any -s 0 -w /home/ubuntu/tcpdump.pcap
    ```

    Press `Ctrl+C` to stop capture.
  </Step>

  <Step title="Pull log files to host PC">
    ```bash theme={null}
    scp ubuntu@<device_ip>:/home/ubuntu/tcpdump.pcap .
    scp ubuntu@<device_ip>:/home/ubuntu/dmesg_logs.txt .
    ```
  </Step>

  <Step title="Collect diagnostic output">
    ```bash theme={null}
    {
      echo "=== ETHTOOL OUTPUT ==="
      ethtool end0
      echo "=== ETHTOOL STATISTICS ==="
      ethtool -S end0
      echo "=== IFCONFIG OUTPUT ==="
      ifconfig end0
      echo "=== NETSTAT OUTPUT ==="
      netstat -r
      echo "=== IP ROUTE OUTPUT ==="
      ip route show
    } > /home/ubuntu/ethernet_diagnostics.txt
    ```

    Then transfer:

    ```bash theme={null}
    scp ubuntu@<device_ip>:/home/ubuntu/ethernet_diagnostics.txt .
    ```
  </Step>
</Steps>

### Common Issues

<AccordionGroup>
  <Accordion title="No Link Detected">
    **Symptoms:** `ethtool end0` shows "Link detected: no"; interface shows as DOWN.

    **Steps:**

    ```bash theme={null}
    # Check PHY status
    sudo dmesg | grep -i phy
    sudo dmesg | grep -i end

    # Verify interface is up
    ifconfig end0

    # Check auto-negotiation
    ethtool end0
    ```

    **Solutions:** Replace faulty cable, ensure both ends are securely connected, verify link partner is powered on, check for PHY driver errors in `dmesg`.
  </Accordion>

  <Accordion title="Cannot Ping Remote Host">
    **Symptoms:** Link detected but ping fails; "Destination Host Unreachable" or "Network is unreachable".

    **Steps:**

    ```bash theme={null}
    # Verify IP configuration
    ifconfig end0

    # Check routing table
    ip route show
    netstat -r

    # Check ARP table
    arp -a

    # Capture ICMP traffic
    sudo tcpdump -i end0 icmp
    ```

    **Solutions:** Configure correct IP address and subnet mask; add default gateway if needed (`route add default gw <gateway_ip>`); verify firewall rules are not blocking ICMP.
  </Accordion>

  <Accordion title="Slow Network Performance">
    **Symptoms:** High latency, slow file transfers, packet loss.

    **Steps:**

    ```bash theme={null}
    # Check link speed and duplex
    ethtool end0 | grep -E "Speed|Duplex"

    # Check for errors
    ethtool -S end0 | grep -E "error|drop|collision"
    ifconfig end0 | grep -E "errors|dropped|overruns"

    # Check MTU
    ifconfig end0 | grep MTU
    ```

    **Solutions:** Force 1000 Mbps full-duplex if auto-negotiation fails; replace cable if errors are detected; adjust MTU for specific network requirements.
  </Accordion>

  <Accordion title="Interface Not Detected">
    **Symptoms:** `end0` does not appear in `ifconfig` output.

    **Steps:**

    ```bash theme={null}
    # Show all interfaces including down
    ifconfig -a

    # Check kernel logs
    sudo dmesg | grep -i ethernet
    sudo dmesg | grep -i emac
    sudo dmesg | grep -i "end0"

    # Check device tree
    ls /sys/class/net/
    ```

    **Solutions:** Ensure correct CDT is flashed; verify Ethernet driver is compiled in kernel; check for hardware initialization errors in `dmesg`; reboot and check again.
  </Accordion>

  <Accordion title="MAC Address Issues">
    **Symptoms:** MAC address changes after reboot, random MAC assigned, or MAC conflicts.

    **Steps:**

    ```bash theme={null}
    # Check current MAC address
    ifconfig end0 | grep ether

    # Verify persistent storage
    ls /var/persist/
    cat /var/persist/config.ini | grep MAC_ID
    ```

    **Solutions:** Create or restore `/var/persist/config.ini`. Format: `MDIOBUSID1: 1: MAC_ID01: XX:XX:XX:YY:YY:YY`. Back up `config.ini` before software upgrades.
  </Accordion>
</AccordionGroup>

### Advanced Diagnostics

**Filter Ethernet-related dmesg messages:**

```bash theme={null}
sudo dmesg | grep -iE 'eth|emac|phy|link'
```

**Analyze tcpdump captures:**

```bash theme={null}
# Filter by protocol
tcpdump -r /home/ubuntu/tcpdump.pcap icmp
tcpdump -r /home/ubuntu/tcpdump.pcap tcp

# Filter by host
tcpdump -r /home/ubuntu/tcpdump.pcap host 192.168.1.10
```

For detailed analysis, open the `.pcap` file in Wireshark on your host PC.

**Monitor real-time hardware statistics:**

```bash theme={null}
watch -n 1 'ethtool -S end0 | head -20'
```

## Command Reference

| Command           | Purpose                | Example             |
| ----------------- | ---------------------- | ------------------- |
| `dmesg`           | View kernel messages   | `dmesg \| grep eth` |
| `ethtool <if>`    | Check link status      | `ethtool end0`      |
| `ethtool -S <if>` | View NIC statistics    | `ethtool -S end0`   |
| `ifconfig <if>`   | Check interface config | `ifconfig end0`     |
| `ip addr show`    | Show IP addresses      | `ip addr show end0` |
| `ip route show`   | Show routing table     | `ip route show`     |
| `ping <host>`     | Test connectivity      | `ping 192.168.1.10` |
| `tcpdump -i <if>` | Capture packets        | `tcpdump -i end0`   |
| `netstat -r`      | Show routes            | `netstat -r`        |
| `netstat -i`      | Show interface stats   | `netstat -i`        |
| `arp -a`          | Show ARP table         | `arp -a`            |

## Resources

* [ethtool man page](https://man7.org/linux/man-pages/man8/ethtool.8.html)
* [ifconfig man page](https://man7.org/linux/man-pages/man8/ifconfig.8.html)
* [netstat man page](https://man7.org/linux/man-pages/man8/netstat.8.html)
* [ip command man page](https://man7.org/linux/man-pages/man8/ip.8.html)
* [tcpdump man page](https://www.tcpdump.org/manpages/tcpdump.1.html)
