Ethernet For Hackers: Equipment Exploration

Last time, we talked about the surface-level details of Ethernet. They are fundamental to know for Ethernet hacking, but theyâre also easy to pick up from bits and pieces online, or just from wiring up a few computers in your home network. Now, thereâs also a bunch of equipment and standards that you will want to use with Ethernet â easy to find whether used or new, and typically as easy to work with. Letâs give you a few beacons!
Routers And Switches
Whenever you see a box with a few Ethernet ports, itâs either referred to as a router, or a switch, sometimes people will even use the word âhubâ! Fortunately, itâs simpler than it may seem. A router is a smart device, typically with an OS, that ties two or more networks together â routing packers from one network to another, and typically taking care of things like handing out local IP addresses via DHCP. A switch merely helps Ethernet devices exchange packets between each other on the same level â itâs typically nowhere near as smart as a router gets. Oftentimes, a home router will contain a switch inside, so that you can plug in multiple of your home devices at once. Thatâs the main difference â a switch merely transmits packets between Ethernet-connected devices, while a router is a small computer taking care of packet forwarding between networks and possibly including an Ethernet switch on the side.

Itâs easy to find a router for hacking purposes, and weâve been reprogramming them for two decades now. Often, they run Linux, and if they donât, they can be coerced. Inside a common router, you get a Linux device, typically with barely any CPU power, RAM or ROM, but you can run fun stuff alright â a file share, some control software for your robot, or maybe a tiny home automation suite.
Taking the other tack, itâs easy to build something that fulfills the functions of a router â take a low-power PC, put a Linux OS onto it, set up a DHCP server and packet forwarding script of some sort, and add a switch for anything you might want to network up. If you need a WiFi access point, you can plug in a network card and set up something like hostapd
. Or donât â there are also WiFi APs available: a single-purpose device with a single Ethernet port, that tend to be wonderful at what they do, unless you go for the cheapest option possible.
Thereâs plenty of hacking potential in Ethernet routers and switches alike. For routers, thereâs the obvious OS hacking, but even thatâs not all. For instance, you can use a multi-port router as a switch in a pinch, as long as you disable the âsmartâ features like DHCP server and donât plug anything into the WAN port. Once, when I needed a gigabit Ethernet switch and only had a cheap router with gigabit ports, I did just that. Understand these devices, and you will be able to reuse them in a variety of ways. Speaking of reuse â if you have an outdated router, take one apart, and you can get RJ45 (8P8C) jacks, Ethernet transformers (aka magnetics), switch-mode PSU circuits you can reuse, and some nice WiFi antennas in case you need to boost your ESP32âs coverage in a pinch.
As for switches, here are a few hacks that turn regular switches into âmanagedâ switches that add extra quality of life features like VLANs, port mirroring, or security features. Weâve even covered a hack that lets you tap into the Linux OS powering a particularly fancy switch! Want to build your own Ethernet switch? Weâve previously shown you products from a company building hacker-oriented commercial embeddable Ethernet switches, that Iâm sure you could easily learn from and put your own spin on. The company involved started out as âopen-sourceâ but took down the hardware design file repo at some point after we started covering their products; thankfully, there are forks still available. Plus, switch schematics can be pretty easy to find, and teardowns even more so!
Have you heard about Ethernet hubs? âHubâ is generally a synonym for âswitchâ these days, but back in the 10 Mbps days, it used to be a different device â a passive way to tie three Ethernet devices into a network using resistors, diodes, or transistors. Every packet is sent to every device, of course, and it only works for low speeds because it makes the connection half-duplex, and the signal strength is weakened, but the upside is that itâs extremely simple. Iâve never encountered a hub in real life, but if youâre wondering, Iâve found two designs, one using resistors (translated, original) and another using diodes. Both of these designs have three ports â if youâre ever in need of a low-speed Ethernet network, this should do in a pinch.
Power over Ethernet
Speaking of things that you can build yourself, powering your devices is undoubtedly a priority. Letâs talk about Power over Ethernet, where you will find it, how you can build it on your own, and when you might want to reconsider doing that.

Thereâs also the PoE âstandardâ where you use two pairs for 100 Mbps and then just put a high-ish DC voltage on two of the remaining pairs. Itâs charitably referred to as âpassive PoEâ, and it is what youâre likely to encounter in cheap products. Youâd better watch out to ensure that it doesnât blow up your port â thereâs no negotiation, and usual devices donât take kindly to it. In addition to that, there are a few proprietary standards, like the Mikrotik Gigabit PoE.
The 802.3af PoE standard works by superimposing a DC voltage onto the signal, using two possible pair combinations, known as Mode A and Mode B respectively. Thereâs also a higher power option, which uses all four pairs for higher power devices. Power is only applied to the pairs after PoE negotiation, and negotiation only happens after a compatible device is detected on the other end. 802.3af PoE tends to come with a pricetag, and thatâs mostly because it has a fair bit more electronics involved, typically even including a small but hefty transformer.
If your device doesnât come with PoE and you want to add it the proper way, thereâs also modules you can buy online and add inline, 802.3af injectors and extractors. It might take a fair minute to find one, but you generally wonât go wrong using a 802.3af-compliant PoE module if you want to go the DIY route while sticking to foolproof PoE tech â they make a lot of sense if most of your network already supports 802.3af and itâs just a few devices that donât. Oh, and of course, itâs possible to design your own. If you do that, you can even add support for both proper 802.3af and passive PoE!


Passive PoE, the straightforward version, has its spot under the sun and in our toolboxes too. Of course, you better be careful shoving passive PoE-powered cables into places â it can burn out a port on your laptop or Pi, if youâre not careful. Nevertheless, if youâre fine with 10/100Mbps, have control over the network, and just want to wire up a Raspberry Pi or two, passive PoE is a wonderful way to do it â the cheapest, the simplest, and the most flexible. One classic hacky way to make passive PoE work is simply cutting into Ethernet cables, but if youâll be touching the cabling often, remember that this is breakage-prone. If you want to make a passive PoE circuit easy to maintain when your network inevitably needs some tweaking, you can also buy passive PoE injectors and receivers online â and theyâll be much, much cheaper too! So, you exchange user error protection for lower cost and greater hackability â sounds like exactly the kind of tradeoff a hacker should know about.
Hereâs my own advice for passive PoE, having wired up a couple of small-scale networks with it. You should clearly mark passive PoE cables, because theyâre meant to go through a PoE tap (âinjectorâ) before you plug them into any device â a red sharpie, maybe a piece of red tape, but a sticker that says âdo not touch if you donât know what youâre doingâ is the best option problem. This is the most important part with passive PoE, and you might be able to guess why I stress it. You might be tempted to add PoE by soldering onto the pads of an Ethernet jack on your deviceâs PCB, but do a multimeter test first â it might be a jack with integrated Ethernet transformer, or there might be resistors connected to the unused pairs.
Also, you have to choose your voltage with passive PoE, and you canât just do 5 V. The voltage drop over meters of Ethernet cabling is going to halve this voltage immediately, with barely anything left unless youâre powering something really low power. Remember, active PoE uses 48 V for a good reason â as you increase voltage, you decrease current needed to carry the same amount of power. 12 V might be tempting, but 24 V is significantly more advantageous, as long as you donât use cheap DC-DC modules â those will fail you, especially when powering a Raspberry Pi. Last but not least, if you are about to re-crimp cable carrying a passive PoE link, remember to disconnect the other end, unless you want to have sparks fly.
Weâve covered PoE quite a bit, and even hacks that add PoE to ESP32 using 802.3af modules, reuse the Raspberry Pi PoE header for single-cable wireup, or even transmit Ethernet over DC power instead. Now, for a change, letâs talk about the polar opposite â a way to do Ethernet that does not allow you to do any power transmission at all, which is Ethernet over fiber optics, and how you can get there.
Media Converters
If youâve ever hacked a bit further than pure home applications of Ethernet, youâll know thereâs a way to put it onto fiber optic. Fiber is wonderful for even longer distance runs than Ethernet can achieve, itâs even more resillient too. Sometimes it lets you reuse an existing fiber connection â many a provider now prefers pulling fiber. A piece of hardware capable of converting Ethernet to fiber is called a âmedia converter,â and theyâre not that hard to find online as separate pieces of equipment â especially given that many are discarded by small-scale ISPs as they upgrade their tech.

Now, unlike Ethernet, you canât easily crimp fiber, you have to weld it with a special machine, and if you donât have that machine, you might have to settle with buying pre-terminated fiber lengths. You also have to be seriously careful when bending fiber â it canât withstand much abuse. However, if the upsides of fiber are tempting for you, what you can do is go find a media converter online, plug your Ethernet cable into it, and on the other port of it, or two ports, and bam, you get fiber Ethernet.
One unexpected use case for a hacker is total galvanic isolation â lightning-proofing your Ethernet links on the cheap. If youâve ever wanted to add a surefire, guaranteed lightning protection to an Ethernet connection, converting it into a short run of fiber optic cable through two media converters is perhaps the best decision you can make! Fiber is also resilient to electromagnetically noisy environments.
At this point, you might be wondering â how exactly do you build new Ethernet devices? Whether itâs an ESP32, a DIY router, or an Ethernet-enabled stepper motor, worry not. Next time, we will go through the practical side of using Ethernet â Ethernet transformers, internals, and wireup, nuances like Bob Smith termination, magjack recommendations, PHYs and MACs, and how to bend the rules at the hardware level. For illustration and example circuit purposes, expect to see a fair few Ethernet-based hacks from all around the hacker world!
Featured image: â10base-Tâ by [gratuit]
from Blog â Hackaday https://ift.tt/R0Ud2b5
Comments
Post a Comment