How to enable RNDIS USB ethernet device?
All, I have a milkV-duo (Pi Pico look-alike running Risc chip) that runs Linux (busybox) and provides an RNDIS network interface to the host. For some reason when I connect the device to Arch, it is properly identified and the network device is created, but the interface is always brought up DOWN. Providing an address with ip link (it runs on 192.168.42.1) seems to enable the interface, but when you ssh to that IP it just logs into the Arch host instead of the milkV-duo. On connect the rndis host interface is created: Jan 05 00:30:34 2pi kernel: usb 2-8: new high-speed USB device number 6 using ehci-pci Jan 05 00:30:34 2pi kernel: usb 2-8: device descriptor read/64, error -71 Jan 05 00:30:34 2pi kernel: usb 2-8: New USB device found, idVendor=3346, idProduct=1009, bcdDevice= 5.10 Jan 05 00:30:34 2pi kernel: usb 2-8: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Jan 05 00:30:34 2pi kernel: usb 2-8: Product: RNDIS Jan 05 00:30:34 2pi kernel: usb 2-8: Manufacturer: Cvitek Jan 05 00:30:34 2pi kernel: usb 2-8: SerialNumber: 0123456789 Jan 05 00:30:34 2pi kernel: rndis_host 2-8:1.0 usb0: register 'rndis_host' at usb-0000:00:1d.7-8, RNDIS device, 22:39:53:06:09:42 Jan 05 00:30:34 2pi kernel: rndis_host 2-8:1.0 enp0s29f7u8: renamed from usb0 But then for some reason the dnsmasq-dhcpd running on the chip doesn't get an address to automatically enable the interface. Checking Arch you have: # ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:23:ae:89:58:90 brd ff:ff:ff:ff:ff:ff inet 192.168.6.111/24 brd 192.168.6.255 scope global dynamic noprefixroute enp2s0 valid_lft 4986sec preferred_lft 4086sec inet6 fe80::b133:3c77:ce09:5b19/64 scope link valid_lft forever preferred_lft forever 5: enp0s29f7u8: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 22:39:53:06:09:42 brd ff:ff:ff:ff:ff:ff Simply assigning an IP allows you to ping it and get a ssh prompt: # ip addr add 192.168.42.1 broadcast + dev enp0s29f7u8 # ping 192.168.42.1 PING 192.168.42.1 (192.168.42.1) 56(84) bytes of data. 64 bytes from 192.168.42.1: icmp_seq=1 ttl=64 time=0.020 ms 64 bytes from 192.168.42.1: icmp_seq=2 ttl=64 time=0.018 ms 64 bytes from 192.168.42.1: icmp_seq=3 ttl=64 time=0.049 ms ^C --- 192.168.42.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2015ms # ssh david@192.168.42.1 david@192.168.42.1's password: You have new mail. Last login: Fri Jan 5 00:30:05 2024 from 192.168.6.114 00:33 2pi:~> l total 920 drwx------ 41 david david 4096 Jan 5 00:30 . drwxr-xr-x 12 root root 4096 Aug 30 23:11 .. drwxr-xr-x 2 david david 4096 Jul 10 2022 .FreeCAD <snip...> However, that has just logged into the host and not the milkV-duo board. So it almost looks like it is considering enp0s29f7u8 as alias for loopback. I must be missing something easy and fundamental, but I can't figure out what. Of course, plugging it into Win10 and using PuTTY, the address is already there and ssh connects directly to the board and not the host. There is no route added: # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default _gateway 0.0.0.0 UG 1002 0 0 enp2s0 192.168.6.0 0.0.0.0 255.255.255.0 U 1002 0 0 enp2s0 Adding the address with ip link enables avahi-daemon for the interface and mdns: Jan 05 00:54:38 2pi avahi-daemon[328]: Joining mDNS multicast group on interface enp0s29f7u8.IPv4 with address 192.168.42.1. Jan 05 00:54:38 2pi avahi-daemon[328]: New relevant interface enp0s29f7u8.IPv4 for mDNS. Jan 05 00:54:38 2pi avahi-daemon[328]: Registering new address record for 192.168.42.1 on enp0s29f7u8.IPv4. Jan 05 00:54:39 2pi avahi-daemon[328]: Joining mDNS multicast group on interface enp0s29f7u8.IPv6 with address fe80::2039:53ff:fe06:942. Jan 05 00:54:39 2pi avahi-daemon[328]: New relevant interface enp0s29f7u8.IPv6 for mDNS. Jan 05 00:54:39 2pi avahi-daemon[328]: Registering new address record for fe80::2039:53ff:fe06:942 on enp0s29f7u8.*. Anybody else mess with one of these boards or a similar RNDIS device and know how to successfully bring the interface up so you can connect with the milkV board and not the host? -- David C. Rankin, J.D.,P.E.
Hi,
# ip addr add 192.168.42.1 broadcast + dev enp0s29f7u8 # ping 192.168.42.1 PING 192.168.42.1 (192.168.42.1) 56(84) bytes of data. 64 bytes from 192.168.42.1: icmp_seq=1 ttl=64 time=0.020 ms 64 bytes from 192.168.42.1: icmp_seq=2 ttl=64 time=0.018 ms 64 bytes from 192.168.42.1: icmp_seq=3 ttl=64 time=0.049 ms ^C --- 192.168.42.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2015ms
Where did you run "ip addr add 192.168.42.1 broadcast + dev enp0s29f7u8"? Regards Bjoern
On 1/5/24 04:47, Bjoern Franke wrote:
Where did you run "ip addr add 192.168.42.1 broadcast + dev enp0s29f7u8"?
That was an attempt on the Arch box. I'll have to solder in the pins to the serial terminal to reach the milkv board since Arch isn't picking up the address the board hands out via dhcpd. -- David C. Rankin, J.D.,P.E.
On 1/5/24 04:47, Bjoern Franke wrote:
Where did you run "ip addr add 192.168.42.1 broadcast + dev enp0s29f7u8"?
Okay, I know what I need to do, I just have to figure out the commands to do it. I need to set enp0s29f7u8 t get it's address via dhcpdcd. The milkv device will then hand the Arch box an address and then I can access the milkv ssh server at 192.168.42.1. Thanks Bjoern! -- David C. Rankin, J.D.,P.E.
Hi,
I know what I need to do, I just have to figure out the commands to do it. I need to set enp0s29f7u8 t get it's address via dhcpdcd. The milkv device will then hand the Arch box an address and then I can access the milkv ssh server at 192.168.42.1.
Glad to hear you fixed it. :) I was just wondering why you seemed to add the IP of the device locally. Regards Bjoern
On 1/6/24 05:57, Bjoern Franke wrote:
Glad to hear you fixed it. :) I was just wondering why you seemed to add the IP of the device locally.
CRI-syndrome (cranal/rectal inversion..., i.e. head up my ....) -- David C. Rankin, J.D.,P.E.
participants (2)
-
Bjoern Franke
-
David C. Rankin