I have an embedded Linux system with a single Ethernet port, but I need to go to many ports. It is obvious I need to add magnetics and ports. The trickier parts follow.

My processor has an on-board MAC and I'm using a single-driver PHY. Do I only need a new PHY with more drivers? Is it possible to use multiple PHYs on the same MAC? Do I need a MAC for each port?

  • 1
    \$\begingroup\$ If it matters, the processor is Atmel AT91RM9200, PHY is Micrel KSZ8721 \$\endgroup\$ Oct 27, 2010 at 16:10

4 Answers 4


If this is for a prototype - consider adding a USB ethernet adapter.

If you're building a product, I'd consider an onboard ethernet switch chip. Like this:


(source: micrel.com)

The ADM6996 may also be an option, if you can find it.

  • 1
    \$\begingroup\$ Good call, I didn't think about a switch, guess I wasn't thinking about it in that sense. \$\endgroup\$
    – Kellenjb
    Oct 27, 2010 at 16:29
  • \$\begingroup\$ Very good choice. \$\endgroup\$
    – Kortuk
    Oct 27, 2010 at 16:32
  • \$\begingroup\$ I added a note to my answer to explain where I was coming from. It may or may not be helpful to him, but might be helpful to someone in the future. \$\endgroup\$
    – Kellenjb
    Oct 27, 2010 at 16:47
  • 1
    \$\begingroup\$ Switches are available as separate devices which work over Ethernet - See my answer below. Also, it's generally a good idea to wait longer than an hour to accept an answer, 48 hours is probably better. \$\endgroup\$ Oct 27, 2010 at 19:09
  • 1
    \$\begingroup\$ As a bonus, some of these ethernet switch chips will add a VLAN tag so your processor can tell which port the traffic came in on. (Typically when this is enabled it stops bridging traffic directly between ports, all ports can talk to your processor and it can choose to forward the traffic onward if desired.) \$\endgroup\$
    – Ben Voigt
    Oct 28, 2010 at 6:40

If your processor only has one PHY, you're not going to get a lot more speed by embedding the switch on your board. It will be much easier to just add a switch:

alt text

As the text on this example indicates, any halfway decent switch will autonegotiate 10/100/1000 Mbps, cable crossover.

Switches are available in anywhere from 4 to 48 ports, with 5 ports being a common number for simple desktop switches. They can sit on your desk or be rack-mounted. You can chain them together for ridiculous numbers of ports, if you feel so compelled. You can get them for less than $10 (visit Newegg), or as much as 10,000. One important thing to consider is whether you want a managed or unmanaged switch, but we'd need more information to make this decision, and this is swiftly turning into a question for ServerFault.

An external switch is probably the most flexible, simple, and cheap way to do what you want. It will be physically larger than putting the contents of a switch on your PCB, but I wouldn't do that unless it was absolutely necessary.

  • \$\begingroup\$ That would be simpler except for the environment that my device will be in. A big point of my device is to consolidate all the discrete bits my client currently uses in a specific setup that they deploy in thousands of locations all over the country. \$\endgroup\$ Oct 28, 2010 at 18:38
  • \$\begingroup\$ My two takes on that bit of info: (1) That design goal and that kind of quantity make an onboard switch much more attractive. (2) Doesn't a client like that already have Ethernet switches in your install locations? \$\endgroup\$ Oct 28, 2010 at 19:24
  • \$\begingroup\$ They do at already-installed locations, but they hopefully won't at future locations. \$\endgroup\$ Nov 1, 2010 at 14:49

If each port is going on a completely separate network you can get away with a single MAC address, but this really doesn't work if you are going to have it on the same network.

I would highly recommend having separate drivers with separate MAC address per port.

My answer is focused on if you were creating a device like an embedded firewall where you were wanting traffic to come in on one port, filtered, and then be sent back out on a different port going to a different network.


I second the switch suggestion.

If you need to separate different networks then configure the switch chip to split the ports into different VLANs and trunk all VLANs to the port that the Linux box is on.

Linux will be able to access all VLANs as though the system had individual network interfaces to the different networks.

Most, if not all, switch chips can be configured via a serial EEPROM, so modifying an off-the-shelf switch for a POC or a one-off hack ought to be easy enough.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.