I figured I would build one with a raspberry pi for much less (and have a lot more fun). My total cost was about $225US.
Parts:
-1 pi (case, power supply, sd card) - $70
-1 small powered USB hub -$14
-1 Startech ICUSB2328 8-port usb to serial (it has a jack for optional power supply, but my usb hub supplies enough power) - $137
Software:
-raspbian
-screen
-putty for access from Windows machines
I thought the setup would be rather trivial until I discovered the device nodes did not match up with the physical ports on the ICUSB2328. After a couple of reboots, I realized it was worse than that, the device node to physical port mappings were pretty random on each boot.
udev to the rescue! Thanks to this blog entry http://hintshop.ludvig.co.nz/show/persi ... l-devices/, I was able to ensure that I had device nodes consistently mapped to the physical ports. By reviewing lsusb and /var/log/messages, I created the corresponding udev rules to use each port's serial number to map to a symlinked device node, serial[0-7] with the following /etc/udev/rules.d/99-usb-serial.rules:
Code: Select all
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AH018GUC", SYMLINK+="serial0"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AH018GUB", SYMLINK+="serial1"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AH018GU9", SYMLINK+="serial2"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AH018GU6", SYMLINK+="serial3"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AH018GU7", SYMLINK+="serial4"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AH018GU8", SYMLINK+="serial5"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AH018GUD", SYMLINK+="serial6"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AH018GUA", SYMLINK+="serial7"
The pi's ethernet is connected to a separate management network and is accessible via ssh. I also decided to create a user and set the login shell to ~/menu, for a very rudimentary menu. Just in case I leave a session timeout, I added the option to reconnect to an existing screen session:
Code: Select all
#!/bin/bash
# menu
while [ answer != "0" ]
do
clear
echo -e "\r\n\r\n"
echo -e "To exit from any terminal, press <CTL>-a + k\r\n\r\n"
echo "Select device to which to connect"
echo -e "\n"
echo " 1) firewall1"
echo " 2) firewall2"
echo " 3) switch1"
echo " 4) switch2"
echo " 5) switch3"
echo " 6) pdu1"
echo -e "\n"
echo " 99 exit"
echo " 00 shell"
echo " 0 reconnect to timed out session"
echo -e "\n"
read -p " ?" answer
case $answer in
99) exit ;;
0)
screen -x ;;
1)
screen /dev/serial0 ;;
2)
screen /dev/serial1 ;;
3)
screen /dev/serial2 ;;
4)
screen /dev/serial3 ;;
5)
screen /dev/serial4 ;;
6)
screen /dev/serial5 ;;
00) clear && bash ;;
*) screen -x ;;
esac
# echo "press RETURN for menu"
# echo -e "\n"
# read key
done
exit 0