I'm trying to set up Plex in a Docker container using IPvlan L2 routing so I can do port forwarding separately from my host. However, I'm running into issues with Docker not recognizing my parent Ethernet adapter.
When I check my network interfaces on my Ubuntu 24.04.3 LTS machine using "ip addr", I see my USB Ethernet adapter listed as "enx00051bddad7a" and it's active. I attempted to configure my Docker Compose file to use this adapter:
```yaml
networks:
plexnet:
ipv4_address: 10.70.1.21
driver: ipvlan
attachable: true
driver_opts:
parent: enx00051bddad7a
ipvlan_mode: l2
ipam:
config:
- subnet: 10.70.1.0/24
gateway: 10.70.1.1
```
But when I run "docker compose up -d", I get an error saying that the adapter name is invalid. I've also tried to append a VLAN number to the adapter name (like "enx00051bddad7a.11") but I keep facing issues.
I even created a VLAN interface on my host machine with this command:
```bash
sudo ip link add link enx00051bddad7a name adapt0.11 type vlan id 11
```
After verifying it worked, I updated my Docker Compose file to reflect this change, but I still receive an error stating that Docker can't find the interface. When I check from within Docker Desktop, it shows the same adapter output I see on my host machine. Am I missing something here? Why can I use "eth0" in my config, but I can't access it externally? Any advice would be greatly appreciated!
2 Answers
It sounds like you're getting caught up in Docker's handling of network interfaces. When you're using IPvlan, the parent interface must be accessible to Docker itself. Since "eth0" seems to work, that might indicate Docker isn't properly seeing your USB adapter. Make sure to run these commands in the right context. Sometimes Docker containers might not share the same network view as your host machine. You could try creating a macvlan network instead, which might handle your configuration better.
Definitely check if your Docker setup allows access to your specific network interfaces. Running commands in Docker Desktop's terminal sometimes doesn't give you the full picture of what's available on the host. You might want to confirm the Ethernet adapter is recognized in Docker. Another thing you could look at is running your Docker commands with sudo to ensure they have the correct permissions. Lastly, verify if there are any firewall rules blocking connections.

Related Questions
How To Get Your Domain Unblocked From Facebook
How To Find A String In a Directory of Files Using Linux