Ethernet over USB
The Ethernet component enables microcontrollers to establish a network connection over USB. The microcontroller will appear to the host computer as an Ethernet dongle. With the correct configuration, Home Assistant can reach it through the host. This establishes a wired network connection without any dedicated hardware.
Other USB functions such as the logger over USB_CDC can be used at the same time.
IPv6 is supported.
The following microcontrollers are currently supported:
- RP2040
- RP2350
# Example configurationrp2: board: rpipico
ethernet: type: usb manual_ip: static_ip: 192.168.137.100 gateway: 192.168.137.1 subnet: 255.255.255.0See Ethernet for configuration variables.
Configuring the Host Computer
Section titled “Configuring the Host Computer”Configuration depends on the operating system running on host computer.
USB Host Configuration on HA OS
Section titled “USB Host Configuration on HA OS”When connecting directly to a host computer running HA OS, configuration works like this:
- Prepare your microcontroller by flashing ESPHome with Ethernet over USB and static ip address
192.168.137.100 - Visit Settings -> System -> Network and take note of the network interfaces
- Connect the microcontroller
- Reboot HA OS. Note: Restarting Home Assistant is not enough.
- Visit Settings -> System -> Network again.
You should find a new one, for example
enu1u4i2. - Configure the new interface with IPv4 using “Static”.
Add the address192.168.137.1/24and leave the gateway empty: the microcontroller is on the link. - Optionally, use a SSH addon to run
ping 192.168.137.100. It should respond. - Add ESPHome integration
with host
192.168.137.100
USB Host Configuration on Windows
Section titled “USB Host Configuration on Windows”We can use Internet Connection Sharing. It provides DHCP on the 192.168.137.0/24 subnet and routing to the rest of the network using NAT (network address translation).
- Prepare your microcontroller by flashing ESPHome with Ethernet over USB
and static ip address
192.168.137.100 - Disconnect the microcontroller
- Win + R, then type
ncpa.cpland hit Enter - Connect the microcontroller again
- A new network connection should appear
- Right click your normal network connection, select Properties.
- Select the
SharingTab - Check the box for
Allow other network users to connect through this computer’s Internet connection - As
Home networking connection, choose the new network connection that appeared in Step 5. - Win + R, then type
cmdand hit Enter ping 192.168.137.100. It should respond.- Follow Connecting to Home Assistant via API.
Without manual_ip, the microcontroller may get any address in 192.168.137.0/24.
USB Host Configuration on macOS
Section titled “USB Host Configuration on macOS”macOS needs no driver: the microcontroller appears as a new network interface.
- Prepare your microcontroller by flashing ESPHome with Ethernet over USB and static ip address
192.168.137.100 - Connect the microcontroller
- Open System Settings > Network and select the new interface (its name depends on the board, for example
RP2040), or find it as a neweninterface inifconfig - Under Details > TCP/IP, set Configure IPv4 to Manually, with IP address
192.168.137.1and subnet mask255.255.255.0 ping 192.168.137.100. It should respond.- Follow Connecting to Home Assistant via API.
WARNING
Known issue: in some boots macOS turns the device’s network interface on and right off again, because of a macOS bug that Apple is working on. The device then stays off the network until it restarts, which ESPHome does on its own when it has no connection. This only happens at startup, for example after a firmware update.
USB Host Configuration on Linux
Section titled “USB Host Configuration on Linux”Network configuration on Linux depends on your network management software. If you don’t know which one you are running, try these commands:
sudo systemctl status NetworkManagersudo systemctl status systemd-networkdsudo systemctl status dhcpcd
One of them will be active (running).
NetworkManager
Section titled “NetworkManager”- Prepare your microcontroller by flashing ESPHome with Ethernet over USB and static ip address
192.168.137.100 - Disconnect the microcontroller
ip linkto check your existing network interfaces- Connect the microcontroller again
ip linkagain, a new network interface should be listed. This example assumesusb0nmcli connection add type ethernet ifname usb0 con-name pico ipv4.method shared ipv4.addresses 192.168.137.1/24sudo iptables -A FORWARD -i usb0 -j ACCEPT(or nftables equivalent)sudo iptables -A FORWARD -o usb0 -j ACCEPT(or nftables equivalent)ping 192.168.137.100- make iptables rules persistent by adding them to the files in
/etc/iptables/*.rules(or nftables equivalent) - Follow Connecting to Home Assistant via API.
dhcpcd
Section titled “dhcpcd”dhcpcd cannot act as a DHCP server, so we must use static ip addresses.
- Prepare your microcontroller by flashing ESPHome with Ethernet over USB and static ip address
192.168.137.100 - Disconnect the microcontroller
ip linkto check your existing network interfaces- Connect the microcontroller again
ip linkagain, a new network interface should be listed. This example assumesusb0- add the following to
/etc/dhcpcd.conf:
interface usb0static ip_address=192.168.137.1/24systemctl restart dhcpcdping 192.168.137.100sudo sysctl -w net.ipv4.conf.all.forwarding=1sudo iptables -A FORWARD -i usb0 -j ACCEPT(or nftables equivalent)sudo iptables -A FORWARD -o usb0 -j ACCEPT(or nftables equivalent)sudo iptables -t nat -A POSTROUTING -s 192.168.137.0/24 ! -o usb0 -j MASQUERADE(or nftables equivalent)- make iptables rules persistent by adding them to the files in
/etc/iptables/*.rules(or nftables equivalent) - Follow Connecting to Home Assistant via API.
systemd-networkd
Section titled “systemd-networkd”The IPv4Forwarding= and IPv6Forwarding= settings below need systemd 256 or later.
- Prepare your microcontroller by flashing ESPHome with Ethernet over USB and static ip address
192.168.137.100 - Disconnect the microcontroller
ip linkto check your existing network interfaces- Connect the microcontroller again
ip linkagain, a new network interface should be listed. This example assumesusb0- create
/etc/systemd/network/pico.networkwith this content:
[Match]Name=usb0
[Network]Address=192.168.137.1/24
IPv4Forwarding=yesIPMasquerade=yesDHCPServer=yes
IPv6Forwarding=yesIPv6SendRA=yesDHCPPrefixDelegation=yes
[DHCPServer]EmitDNS=yesUplinkInterface=:auto
[IPv6SendRA]EmitDNS=yesUplinkInterface=:autosudo iptables -A FORWARD -i usb0 -j ACCEPT(or nftables equivalent)sudo iptables -A FORWARD -o usb0 -j ACCEPT(or nftables equivalent)sudo systemctl restart systemd-networkdping 192.168.137.100- make iptables rules persistent by adding them to the files in
/etc/iptables/*.rules(or nftables equivalent) - Follow Connecting to Home Assistant via API.
Manual Configuration
Section titled “Manual Configuration”This config will not survive a Linux reboot, but may be ok for testing.
- Prepare your microcontroller by flashing ESPHome with Ethernet over USB and static ip address
192.168.137.100 - Disconnect the microcontroller
ip linkto check your existing network interfaces- Connect the microcontroller again
ip linkagain, a new network interface should be listed. This example assumesusb0- You can also check
lsusb -tanddmesg ip link set usb0 upip addr add 192.168.137.1/24 dev usb0ping 192.168.137.100
Connecting to Home Assistant via API
Section titled “Connecting to Home Assistant via API”Once your device responds to pings, you may want to connect it to Home Assistant. If Home Assistant runs directly on the USB Host, (e.g. directly connected to a Home Assistant Green or HA OS) you can setup the ESPHome integration directly.
- Add ESPHome integration
- Host is
192.168.137.100
Outgoing Connection
Section titled “Outgoing Connection”If Home Assistant runs on a different computer, we need to establish a connection across the NAT.
One way is to use Outgoing Connections, which need Home Assistant
2026.10.0 or later. The device dials Home Assistant on port 6054, so the USB host must route or forward it.
- Add an encryption key and outgoing connection to your yaml.
# Example configurationapi: encryption: key: !secret api_encryption_key outgoing_connection: host: <ip-of-your-home-assistant> delay: 10sYou can use the key generator from the API docs.
- Flash the changes to your microcontroller.
- Build a SSH tunnel for the initial configuration, which must be an incoming connection.
On the USB Host:ssh user@your-home-assistant-server -R 6053:192.168.137.100:6053 - Add ESPHome integration
- Host is
127.0.0.1 - Enter the encryption key when asked.
- After successful setup, stop the SSH tunnel.
- The connection should fail and then reestablish on its own as the outbound connection comes alive.
Other Options
Section titled “Other Options”Connection can also be established in ways other than outgoing_connection.
For example you may setup port forwarding, use Wireguard or
remove the NAT and setup a static route.