Skip to content

Instantly share code, notes, and snippets.

@frazei
Last active March 13, 2021 02:16
Show Gist options
  • Save frazei/fa7d6c174e1c80b4ffe18c2ea9302f86 to your computer and use it in GitHub Desktop.
Save frazei/fa7d6c174e1c80b4ffe18c2ea9302f86 to your computer and use it in GitHub Desktop.
RG350 USB Internet Access on OSX

RG350 accesso Internet su OSX tramite USB

Read this in english

Il primo metodo (condivisione internet) ha il vantaggio di essere leggermente più semplice ma lo svantaggio che la RG350 sarà nattata dietro al mac. Il secondo metodo (interfaccia in bridge) è leggermente più complesso ma permette alla RG di essere direttamente nella rete locale.

Nota: purtroppo entrambe le procedure non sono persistenti al riavvio della RG350. Ogni volta che si spegne perde l'interfaccia poichè al momento non ho capito come fare a scrivere su /etc/network/interfaces che è readonly.

Metodo 1: condivisione internet

  1. Attivare condivisione internet sul mac:
  • Preferenze di Sistema > Condivisione > Condividi la tua connessione da: Wi-Fi (oppure USB 10/100/1000 LAN)
  • Ai computer che usano: RNDIS/Ethernet Gadget
  1. Collegare la RG350 al mac tramite il cavo USB in dotazione (va usata la porta USBC di destra) e verificare che nell'app "network" l'indirizzo IP sia 10.1.1.2 e cliccare su "Allow login without password".
  2. Connettersi in SSH dal mac e creare l'interfaccia usb0:0 in DHCP:
# ssh root@10.1.1.2
# ifconfig usb0:0 10.1.1.100
# udhcpc -i usb0:0
  1. Se tutto ha funzionato riaprendo l'app "network" nella riga IP addrs dovrebbe comparire un ip per l'interfaccia usb0:0 diverso da 10.1.1.100 (significa che il dhcp ha funzionato).

Metodo 2: interfaccia in bridge

  1. Collegare la RG350 al mac tramite il cavo USB in dotazione (va usata la porta USBC di destra) e verificare che nell'app "network" l'indirizzo IP sia 10.1.1.2 e cliccare su "Allow login without password".
  2. Connettersi in SSH dal mac e creare l'interfaccia usb0:0 in DHCP:
# ssh root@10.1.1.2
# ifconfig usb0:0 10.1.1.100
# udhcpc -i usb0:0 & exit
  1. Sul mac creare una interfaccia bridge tra il dispositivo USB (si chiama RNDIS/Ethernet Gadget) e l'interfaccia Ethernet del Mac (nel mio caso USB 10/100/1000 LAN):
  • Preferenze di Sistema > Rete > ⚫ Gestisci Interfacce Virtuali... > ➕ Nuovo Bridge
  • Selezionare le due interfacce da mettere in bridge e dare un nome sensato tipo "Bridge USB"
  • La rete Ethernet a cui è collegato il Mac deve avere il DHCP
  • Non scordare di cliccare "Applica"
  1. Se tutto ha funzionato riaprendo l'app "network" nella riga IP addrs dovrebbe comparire un ip per l'interfaccia usb0:0 diverso da 10.1.1.100 (significa che il dhcp ha funzionato)

RG350 USB Internet Access on OSX

Read this in italian

The first method (internet sharing) has the advantage of being easier but it has the cons that RG350 will be behind a NAT. The second one (bridge interface) is slightly more complicated but the RG will be directly connected to the local network.

Note: Unfortunately both procedures are not persistent to RG350's reboot. At every reboot it will loose the interface settings because I don't know how to write on /etc/network/interfaces (it's read only).

Note II: As you can see English is not my mother language and my OSX is installed in Italian. So to make this guide I've translated everything but I'm not sure that interfaces are translated exactly the same.

Method n.1: internet sharing

  1. Enable internet sharing on mac:
  • System Preferences > Sharing > Share your connection from: Wi-Fi (or USB 10/100/1000 LAN)
  • To computer that uses: RNDIS/Ethernet Gadget
  1. Connect the RG350 to the mac using the standard USB cable (use the USBC located to the right) and verify that the in the app "network" the IP address is 10.1.1.2, now click on "Allow login without password".
  2. Use SSH to connect from mac and create the usb0:0 interface in DHCP:
# ssh root@10.1.1.2
# ifconfig usb0:0 10.1.1.100
# udhcpc -i usb0:0
  1. If everything is ok, reopening the "network" app in the field IP addrs you will see the ip address of usb0:0 different from 10.1.1.100 (it means that DHCP is working).

Method n.2: bridge interface

  1. Connect the RG350 to the mac using the standard USB cable (use the USBC located to the right) and verify that the in the app "network" the IP address is 10.1.1.2, now click on "Allow login without password".
  2. Use SSH to connect from mac and create the usb0:0 interface in DHCP:
# ssh root@10.1.1.2
# ifconfig usb0:0 10.1.1.100
# udhcpc -i usb0:0 & exit
  1. On mac create a bridge interface between the USB cable (should be RNDIS/Ethernet Gadget) and the Ethernet interface on mac (in my case is called USB 10/100/1000 LAN):
  • System Preferences > Network > ⚫ Manage Virtual Interfaces... > ➕ New Bridge
  • The Ethernet side of your network must have DHCP enabled
  • Remember to click on "Apply"
  1. If everything is ok, reopening the "network" app in the field IP addrs you will see the ip address of usb0:0 different from 10.1.1.100 (it means that DHCP is working).
@DavidShattenborough
Copy link

I have had success using a connection sharing script by evilsocket from their pwnagotchi project and have written up my method for using the script to get internet access on the RG350:

https://github.com/DavidShattenborough/RG350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment