Candela Technologies Logo
Network Testing and Emulation Solutions

Configuring Serial Connection to LANforge

Goal: Using a serial cable and terminal emulator on Windows to connect to LANforge.

If you experience crashes or system misconfiguration, a network link to LANforge can become unavailable. LANforge machines are shipped with a serial cable for just this possibility. Most LANforge servers come with standard RS232 DB9 pin serial ports, other models have a special RJ45 style connector. You might need a USB to Serial adapter to connect your laptop to the serial cable.
  1. Connect Serial Cable to LANforge
    1. We will use a CT525 for our example There are two different types of CT525, some have a I/O shield with colors, others do not. Both have DB9 serial ports:
    2. Picture of an unmarked I/O plate: screenshot
    3. Picture of a colorized I/O plate: screenshot
    4. Picture of a colorized I/O plate plugged in: screenshot
    5. Other LANforge chassis models can have either RJ45 or DB9 serial ports.
  2. Connect Serial Cable to Windows
    1. Chances are you will be connecting a USB to Serial adapter to your laptop.
    2. Typically, right after you connect the cable to your USB port, you will see a message from Windows letting you know a new drive has been installed.
    3. Windows will map this USB adapter to a COM port. Use Device Manager to discover the new COM port:
      1. Press the Windows key and type device manager screenshot
      2. Hit Enter to open the Device Manager
      3. In Device Manager, select Ports screenshot
      4. In this example, we see that our new USB device was assigned COM3.
  3. Configure PuTTY to connect to serial port
    1. Press the Windows key and search for putty screenshot
    2. When you double click on the PuTTY icon and it launches, you can start customizing your session preferences screenshot
    3. Start by setting your connection type (serial), serial device (com3) and speed (115200). Name your session 'com3' screenshot
    4. Select category Serial, specify the Serial Line COM3, speed (115200) and set both Parity and Flow Control to None. screenshot
    5. Select the Session→Logging category, select Printable Output and name set the Log file name as you prefer. This allows you to collect your commands as notes for later. screenshot
    6. Select the Session category, save the com3 profile and click Save screenshot
    7. Click the Open button. You will see a terminal window appear.
  4. Use PuTTY to Log In over COM3
    1. If the screen is blank, hit Enter to see a login prompt.
    2. Enter username lanforgeEnter, password lanforgeEnter screenshot
  5. Collect console output to a logfile
    1. step 1 screenshot
    2. step 1 screenshot
  6. Common Commands Cheat Sheet: Hit Enter after all commands
    1. pwdEnter ⋮ print current directory
    2. lsEnter ⋮ list items in directory
    3. cdEnter ⋮ change to your Home Directory
    4. cd /home/lanforgeEnter ⋮ go to LANforge home directory
    5. cd /rootEnter ⋮ go to root user's home directory
    6. sudo ./serverctl.bash restartEnter ⋮ Restart LANforge service
    7. sudo rebootEnter ⋮ reboot machine
    8. ip a showEnter ⋮ show interface addresses
    9. df -hEnter ⋮ show disk usage
    10. mv /home/lanforge/scripts/script.shEnter ⋮ move file to new name
    11. dos2unix script.shEnter ⋮ Remove DOS/Windows CRLF style line endings
    12. chmod +x script.shEnter ⋮ Turn script executable
    13. ./script.shEnter ⋮ Run script in current directory
  7. Example of clearing disk space on a LANforge machine
    1. One common problem with any LANforge machine is cleaning out old kernels. This is an example that shows you how to check disk space and how to remove unused kernels.
    2. Check disk space with the df -h command screenshot
    3. Use the dmesg command to see if there are system warning. screenshot
    4. go to the /boot directory. The uname -r command tells you which kernel you are currently running. You may remove old ct kernels. screenshot
    5. In addition to removing old kernels, you can remove modules that correspond to those kernels screenshot
    6. After old kernels and modules have been removed, we re-run grub2-mkconfig to regenerate the boot menu: screenshot
    7. the results will look like this: screenshot

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA | | +1.360.380.1618
Facebook | LinkedIn | Blog