LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2023, 09:41 AM   #1
Mithrandir_
LQ Newbie
 
Registered: Apr 2022
Posts: 13

Rep: Reputation: 0
SSHing to RNDIS device (custom distro running 4.4.0) from Ubuntu Server 22.04


Hello,

I've had this issue forever now. Every time I need to SSH on to my device I need to boot up windows and use Bitvise or Putty to SSH on to my device - for some reason it just doesn't seem to want to initialize whatever needs to be initialized for the device to be recognized either on my native MacOS or on my Ubuntu Server VM.

I've given up on Mac as finding a working RNDIS driver seems to be a nightmare, is not supported by Apple etc. Okay, whatever, I'm pretty much running my linux server all the time anyway because I use it as a build machine for my software.

Now I am determined to get to the bottom of this and finally get my SSH working. I know next to nothing about networking so bear with me.

First things first I ran lsmod | grep rndis on both the target(device) and host(ubuntu server).

on the server I get:
Code:
rndis_wlan
rndis_host
cdc_ether
and some other stuff. So they both seem to have rndis drivers installed.

on the target I get:
Code:
usb_f_rndis            24576  2
u_ether                24576  1 usb_f_rndis
libcomposite           53248 12 usb_f_mass_storage,usb_f_rndis

next I ran ip addr show

server
Code:
 
usb0: <BROADCAST,MULTICAST> mtu 1500 disc noop state DOWN group default qlen 1000
link/ether 8e:92:............ brd ff:ff:ff...........
basically the same on the target:
Code:
2: usb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether fe:af:37:71:a8:f3 brd ff:ff:ff:ff:ff:ff
lsusb yields:

server:
Code:
BUS 001 Device 004: ID 05e8:a4a1 ICC, Inc. NameOfDevice
target:
Code:
Bus 001 Device 001: ID 1d6b:0002
when I disconnect the USB cable and do dmsg I get

server:
Code:
usb 1-3: USB disconnect, device number 4
rndis_host 1-3:1.0 usb0: unregister 'rndis_host' usb-000:00;1d.7-3, RNDIS device
target:
Code:
configfs-gadget gadget: high-speed config #1: c
upon connect:

server:
Code:
rndis_host 1-3:1.0 usb0: register 'rndis_host' at usb-0000:00:1d.7-3, RNDIS device 02:4b:9d:8b:a8:a5
target, sometimes nothing, sometimes
Code:
configfs-gadget gadget: high-speed config #1: c
and ifconfig -a looking at usb0

server:
Code:
usb0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 56:f6:0a..... txquelen 1000 (Ethernet)
RX packets 0
RX errors 0
TX packets 0
TX errors 0
target
Code:
usb0      Link encap:Ethernet  HWaddr FE:AF:37:....
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I know that once the RNDIS driver is working the IP addres is supposed to be 192.168.236.2

This works fine on windows...

Last edited by Mithrandir_; 02-23-2023 at 09:52 AM.
 
Old 02-23-2023, 02:08 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
How are you setting the IP on the server and bringing up the interfface? Is it using NetworkManager?
 
Old 02-24-2023, 02:31 AM   #3
Mithrandir_
LQ Newbie
 
Registered: Apr 2022
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by smallpond View Post
How are you setting the IP on the server and bringing up the interfface? Is it using NetworkManager?
The usb0 gadget pops up on its own when I plug in the device. AFAIK RNDIS is supposed to set up an ethernet-over-usb connection on its own, but for some reason it doesn't want to do that when it's connected to Linux. For windows it does everything on its own and I can just SSH on the device.

Not really sure what you mean by network manager? I have no GUI on either side - just terminals.
 
Old 02-24-2023, 02:41 AM   #4
Mithrandir_
LQ Newbie
 
Registered: Apr 2022
Posts: 13

Original Poster
Rep: Reputation: 0
I should probably mention that the Ubuntu server is running as a VM in Parallels on my Macbook Pro, which is the host. The network adapter is bridged between the two.
 
Old 02-24-2023, 05:54 AM   #5
Mithrandir_
LQ Newbie
 
Registered: Apr 2022
Posts: 13

Original Poster
Rep: Reputation: 0
I tried assigning both parties a static address with sudo ifconfig usb0 IPADDRESS netmask 255.255.255.0

They both look something like this now, but I am still unable to ping between them:

Code:
usb0      Link encap:Ethernet  HWaddr 9E:11:8A:58:16:AF
          inet addr:192.168.137.2  Bcast:192.168.137.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:139 errors:0 dropped:13 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11072 (10.8 KiB)  TX bytes:516 (516.0 B)
 
Old 02-28-2023, 08:29 AM   #6
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
In addition to IP you also need to add a route to the routing table.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RNDIS - how to get USB->Ethernet mapping? brundlefly Linux - Networking 1 07-02-2012 02:20 PM
Need assistance SSHing into Fedora 14 when Fedora had no problem SSHing into Ubuntu theif519 Fedora 12 06-04-2011 02:34 PM
USB Device Driver and RNDIS Initialization wcdanie General 0 05-29-2009 12:39 PM
usb-rndis-lite and syncE and PDA's. ...missing cdc_ether. MikeOfAustin Linux - Software 0 06-17-2007 07:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration