Packetwatch.net

USB serial adapter in FreeBSD



Last modified: Jun. 13, 2009

Contents
1 - Summary
2 - Kernel options
3 - Plug in USB serial adapter
4 - Connect to router


1 - Summary

This guide explains how to use a USB serial adapter in FreeBSD. It also
explains how to connect to a device like a router over a serial connection.
As an example we will connect to a Cisco router. This has been tested in
FreeBSD 7.0 and 7.1.


2 - Kernel options

You will need to have the following options in your kernel.
  device          uhci                    # UHCI PCI->USB interface
  device          ohci                    # OHCI PCI->USB interface
  device          ehci                    # EHCI PCI->USB interface (USB 2.0)
  device          usb                     # USB Bus (required)
  device          ugen                    # Generic
  device          ucom                    # USB serial support
  device          uplcom                  # USB support for Prolific PL-2303 serial adapters
If you didn't already have them in your kernel you will need to reboot before
using the USB serial adapter.


3 - Plug in USB serial adapter

Log in with a normal user account. Plug in the USB serial adapter into the
computer and check to make sure it was detected properly.
# dmesg | tail -n 1
ucom0: Prolific Technology Inc. USB-Serial Controller, class 0/0, rev 1.10/3.00,
addr 2 on uhub0

Find what the actual device is listed as.
# ls -l /dev/cuaU*
crw-rw----  1 uucp  dialer    0, 116 Mar  2 18:54 /dev/cuaU0
crw-rw----  1 uucp  dialer    0, 117 Mar  2 18:54 /dev/cuaU0.init
crw-rw----  1 uucp  dialer    0, 118 Mar  2 18:54 /dev/cuaU0.lock
In our example it's listed as /dev/cuaU0.


4 - Connect to router

Connect a serial cable from the USB serial adapter to the console port on
the back of the Cisco router. Type the following and press [Enter] to connect.
# sudo cu -l /dev/cuaU0 -s 9600
Connected

User Access Verification

Username: xxx
Password: xxx
Welcome to router.test.com!
router>

When you are done type exit.

router>exit

router con0 is now available
Press RETURN to get started.

Type '~.' to exit. Press 'Shift+~' then period.

~
[EOT]
#


Last modified: Thu Jan 1 00:00:00 1970 UTC
Packetwatch Research 2002-2017.