-
Notifications
You must be signed in to change notification settings - Fork 155
[draft] feat(usbgadget): share JetKVM's internet via USB ethernet #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
This is super nice... why 172.16.55.0/24 instead of 172.16.0.0/12? |
The smallest possible network that's hopefully not overlapping with anything existing on the host. I randomly chose this network from the available RFC 1918 space.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really cool, can't wait for the kernel system image to support it.
@IDisposable thank you for sharing the excitement on this feature. As you've noticed, the code needs a lot of work and is not yet ready for line-by-line scrutiny. This PR is in DRAFT state for this reason. The main things I wanted to learn and that are demonstrated as part of this PoC:
There has been a lot of great improvements lately on network interface management in |
An early PoC implementation to share JetKVM's internet via USB Ethernet to the target host.
What can be seen on the screenshot:
traceroute
that sends packets through the JetKVM device to the internetPrerequisites
Requires USB Ethernet, NAT and nftables support in the OS from jetkvm/rv1106-system#16
USB gadget ethernet
Following USB ethernet protocols are available:
I am not an expert in the standards. I have used ECM for testing.
The standards basically differ in terms of transfer speeds and driver support in the OS. The Wiki page on Ethernet over USB has more information.
Setup
On the JetKVM, in
/userdata/kvm_config.json
, enable:"ethernet_ecm": true
"network_config": { "nat_enable": true }
Observe the following log entries from JetKVM to validate the setup has worked:
On the target device, bring the interface up and set it up as a default route:
I've picked the network
172.16.55.0/24
(RFC 1918) as a private network for USB ethernetTODO
172.16.55.0/24
)