任天堂Switch (2019)
The Nintendo Switch Switch (2019)

原始链接: https://blog.cynthia.re/post/nintendo-switch-ethernet-switch

## 任天堂Switch变身网络交换机:一个成功案例 2019年12月,作者开始了一个将任天堂Switch(代号NX)改造为功能性网络交换机的项目。最初的想法是利用NX的USB端口进行连接,但需要软件实现。回忆起Switchroot项目——为NX提供Android和Linux——提供了一个解决方案。 在SD卡上安装Switchroot Ubuntu并通过hecate启动后,USB以太网适配器最初未被识别。故障排除涉及内核重新编译,最终应用了Switchroot下载文件夹中的更新。该更新成功启用了USB网络接口。 适配器识别后,作者使用`brctl`和`ip`命令配置了一个桥接接口,将一个适配器连接到局域网,另一个连接到测试计算机。该设置被证明是成功的,实现了至少90Mbps的速度。该项目展示了任天堂Switch令人惊讶的多功能性,并在作者的Twitter账户@bitcynth上有更详细的记录。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Nintendo Switch Switch (2019) (cynthia.re) 6 分,zdw 发表于 1 小时前 | 隐藏 | 过去 | 收藏 | 讨论 帮助 考虑申请YC的2026年夏季项目!申请截止至5月4日 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

Dec 9 2019

Yesterday I had the idea that it would be cool if I turned a Nintendo Switch (will be referred to as NX to avoid confusion as NX is the code name for the Nintendo Switch) console into an actual network switch. I thought about it a bit and realized that it would be doable in hardware at least, since the NX docking station has USB-A ports.

The Nintendo Switch Switch

Next step is software, while I have done some NX homebrew stuff in the past, it didn’t sound fun implementing this pretty much from scratch. But then I remembered switchroot that has Android and Linux for the NX and setting up a network switch inside Linux would be easy.

So the first step was to install switchroot Ubuntu. I just flashed the image file to an SD card, booted it with hekate (a boot loader for the NX) and followed the setup wizard.

After that was done, I plugged in the USB Ethernet dongle, opened a terminal on the switch and executed lsusb.

cynthia@cynthia-switch:~$ lsusb
Bus 002 Device 002: ID 057e:200c Nintendo Co., Ltd 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 009: ID 057e:200a Nintendo Co., Ltd 
Bus 001 Device 011: ID 2357:0601  
Bus 001 Device 005: ID 0b95:7e2b ASIX Electronics Corp. AX88772B
Bus 001 Device 012: ID 04d9:0348 Holtek Semiconductor, Inc. 
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 002: ID 057e:200c Nintendo Co., Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

My dongle is 2357:0601, For some reason it does not have a vendor name but I confirmed that was not unique to the switch so proceeded along.

However, when I checked ip link all I saw was interfaces internal to the NX like lo and the WiFi interface, but no USB network card. To help debug why my USB interfaces were not showing up, I used the usb-devices tool and saw Driver=(none) for my USB Ethernet dongle. :(

I was honestly a bit confused and not sure what to do next, I tried re-compiling the kernel and all sorts of stuff that didn’t help.

Then I realized. On the download page for switchroot there is an updates folder, so I tried that.

All I had to do was download the update zip and extract it to the boot partition of the SD card after I had deleted the boot directory and the boot.scr file. I put the SD card in the NX again and booted it back up with hekate.

Upon opening a terminal and running ip link I was presented with this:

16: enx9cebe816215d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 9c:eb:e8:16:21:5d brd ff:ff:ff:ff:ff:ff
18: enx8416f90eae20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 84:16:f9:0e:ae:20 brd ff:ff:ff:ff:ff:ff

🎉🎉🎉 Finally I had gotten the dongles to work and it was only the configuration left!

So I just did some quick configuration with brctl and ip:

brctl addbr br0 # Adding the bridge interface

# Adding the physical interface to the bridge
brctl addif br0 enx8416f90eae20 enx9cebe816215d 
ip link set br0 up # Set the bridge interface to up

Then I connected one dongle to my LAN and one to a computer that I used for testing.

And after checking twitter.com on the test computer finally it was all working!

A speedtest shows that it can at least do 90Mbps (one of my dongles is only 100Mbps).

Speedtest

Final Setup

If this was to your liking then maybe you will find my Twitter interesting @bitcynth.

I have some other plans related to this that will be posted soon™.

联系我们 contact @ memedata.com