Packetwatch.net

USB serial adapter on FreeBSD 6.x



Last modified: Apr. 18, 2007

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


1 - Summary

This guide explains how to install a USB serial adapter in FreeBSD 6.x.
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.


2 - Kernel options

You will need to make the following changes to your kernel. Recompile the
kernel and reboot.

# su - root
# cd /usr/src/sys/i386/conf
Remove the following from your kernel config file.
  device          ugen                    # Generic
# vi GENERIC
Add the following to your kernel config file.
  device          ucom                    # USB serial support
  device          uplcom                  # USB support for Prolific PL-2303 serial adapters
# vi GENERIC
# cd /usr/src
# make buildkernel KERNCONF=GENERIC
# cp -Rp /boot/kernel/ /boot/kernel.old/
# make installkernel KERNCONF=GENERIC
# shutdown -r now


3 - Test USB serial adapter

After you reboot log in with a normal user account. Plug in the USB serial
adapter into the computer and check to make sure it was detetectd properly.

Run dmesg and you should a line similiar to this at the end.

# dmesg
...
...
...
ucom0: Prolific Technology Inc. USB-Serial Controller, rev 1.10/3.00, addr 2

Find what the actual device is listed as.

# ls -l /dev/cuaU*
crw-rw----  1 uucp  dialer    0, 112 Apr 17 18:08 /dev/cuaU0
crw-rw----  1 uucp  dialer    0, 113 Apr 17 18:08 /dev/cuaU0.init
crw-rw----  1 uucp  dialer    0, 114 Apr 17 18:08 /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.

# 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.