Skip to main content

Wi-Fi Adapter

The Wi-Fi Adapter turns your BLEShark Nano into a Wi-Fi card for your computer. The Nano joins one of its saved networks and shares that connection back over the USB cable, so a laptop or desktop with no wireless of its own (or one you would rather route through the Nano) can get online through the Nano's radio.

Because the traffic runs across the USB link, the connection is point to point between the Nano and the one computer it is plugged into.

A normal USB Wi-Fi dongle plugs into a computer and announces itself as a network card. The Nano cannot do that, for two reasons:

  • The Nano's USB hardware only ever acts as a device, never as a host. It has no USB On-The-Go (OTG) support, so you cannot plug a separate Wi-Fi dongle into the Nano and have it drive it. If anything is going to be the adapter, it has to be the Nano itself.
  • When you plug the Nano in, it appears as a serial port (the same port the CLI uses), not as a network card. There is no way for it to present itself to the computer as an Ethernet or Wi-Fi interface.

So the only pipe between the Nano and your computer is that serial port. To carry network traffic across it, the Nano wraps each packet using a simple serial framing called SLIP and sends it down the wire. Your computer unwraps the packets at the other end and hands them to the operating system as if they had arrived on a real network interface.

What SLIP Is

SLIP (Serial Line Internet Protocol, described in RFC 1055) is the oldest and simplest way to send IP traffic over a serial line. It marks where each packet ends, so the two sides can tell packets apart in the byte stream.

That simplicity comes with limits:

  • One link and two ends. SLIP connects exactly one computer to the Nano. It is not a shared network, and there is no switching or broadcast to other machines.
  • No addressing of its own. SLIP carries packets but never assigns addresses, so both ends are set by hand (the CLI does this for you). The Nano always sits at 192.168.7.1 and your computer takes 192.168.7.2.
  • No error checking or compression. There is no checksum and no negotiation on the link. It trusts the USB connection underneath to deliver the bytes intact.
  • Throughput is modest. Everything is squeezed through the USB serial channel, so the adapter is fine for browsing, scanning, and light tooling, but it is not a high speed link.

The tunnel uses a fixed MTU of 1400 bytes. You do not normally need to change this.

Starting the Adapter on the Nano

You can start the adapter straight from the device:

  • Open Wi-Fi -> Adapter from the Wi-Fi Tools menu.
  • Pick the network you want the Nano to join from the saved-network list.
  • The screen shows "Starting" while the Nano associates.
  • Once it connects it shows "Adapter up" and "Waiting for host", along with docs.infishark.com as a reminder to finish setup on your computer.

5GHz networks are not supported.

Until your computer brings up its end of the link, the Nano stays on that waiting screen. As soon as real traffic starts to flow, it switches to a live view you can page through with the side buttons: one page shows throughput and a running graph, the other shows the joined network, the address, and the hostname. To stop the adapter, reboot the Nano with the side switch.

Bluetooth pauses while the adapter runs

The radio is busy carrying your computer's traffic, so Bluetooth is turned off while the adapter is active. It comes back on its own once you stop the adapter.

Once the Nano is up and waiting, bring up the matching connection on your computer using one of the methods below.

Using the infishark CLI

The CLI is the easiest way to run the adapter. In one command it starts the Nano, brings up the connection on your computer, and cleans everything up again when you stop it. It currently runs on Linux and needs root, because it creates a network interface. macOS and Windows support is planned.

List the networks saved on the device:

infishark wifi saved list

Start the adapter, joining one of those saved networks by its slot number:

sudo infishark wifi adapter 0

Or join a network directly, without saving it to the device:

sudo infishark wifi adapter --ssid "MyNetwork" --pass "hunter2"

By default the interface is created and left ready, but your existing connection stays as the default route. To send all of your computer's traffic through the Nano, add --route-all:

sudo infishark wifi adapter 0 --route-all

Press Ctrl-C to stop. The CLI tells the Nano to shut the adapter down, restores your original routing, and removes the interface. Press d while it is running to toggle the Nano's screen updates (turning it off stops the CPU cycles for OLED updates, which does free up a little more throughput).

If the Nano is not the only serial device attached, point the CLI at the right port with --port:

sudo infishark wifi adapter 0 --port /dev/ttyACM0
tip

If you use --route-all and names stop resolving, your DNS server was probably on your old network and is no longer reachable. Set a public resolver such as 1.1.1.1 or 8.8.8.8.

Manual Setup

If you started the adapter from the Nano's own menu and are not using the CLI, you can bring up your computer's end by hand. The settings are the same in every case:

  • Your computer's address on the link: 192.168.7.2, mask /30.
  • The Nano, which is your gateway: 192.168.7.1.
  • MTU: 1400.

Linux

Linux has a built-in SLIP driver, so nothing extra is needed beyond slattach (part of net-tools). With the adapter already running on the Nano:

# Find the Nano's serial port (usually /dev/ttyACM0)
ls /dev/ttyACM*

# Attach the serial port as a SLIP network interface (sl0)
sudo slattach -p slip -s 115200 /dev/ttyACM0 &

# Give your end an address and bring the link up
sudo ip addr add 192.168.7.2/30 dev sl0
sudo ip link set sl0 mtu 1400 up

# Send traffic through the Nano
sudo ip replace default dev sl0

The baud rate passed to slattach does not matter over USB, so any standard value works.

tip

If large downloads stall while small requests work fine, clamp the TCP segment size on the link:

sudo iptables -t mangle -A POSTROUTING -o sl0 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1360

The CLI applies this for you automatically.

When you are done, remove the route and stop slattach:

# Shut down the sl0 interface
sudo ip link set sl0 down

# Remove the MSS clamping rule (removes the "ghost" rule from the kernel). Note: We use -D to delete the rule.
sudo iptables -t mangle -D POSTROUTING -o sl0 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1360

# Re-route traffic to original wireless interface card
sudo ip replace default via <gateway> dev <interface> # <-- replace gateway and interface. Find gateway with `ip route`

# Kill slattach
sudo kill $(pgrep -i "slattach")

Then reboot the Nano.

macOS

macOS does not ship a SLIP driver, so there is no built-in command to attach the serial port as a network interface. To use the adapter on macOS today, run it through a userspace SLIP client that presents the link as a utun interface, then give that interface the settings above (address 192.168.7.2/30, gateway 192.168.7.1, MTU 1400).

Native macOS support through the infishark CLI is planned, and will remove these manual steps.

Windows

Windows has no built-in SLIP support either. There are two practical routes:

  • Run the connection through a userspace SLIP client that creates a virtual network adapter, configured with the settings above.
  • Use WSL2: attach the Nano's serial port into your Linux distribution (for example with usbipd-win), then follow the Linux steps above from inside WSL.

Native Windows support through the infishark CLI is planned.

Use networks you are allowed to use

The adapter joins a Wi-Fi network with the credentials you give it and appears on that network as an ordinary client. Only connect to networks you own or are authorised to use.