I'm attempting to connect to a switch through the console using the following socat command:
socat tcp4-listen:5050,reuseaddr,fork file:/dev/ttyUSB1,nonblock,raw,echo=0
However, when connecting to it from an external source using Telnet, I encounter the following problem:
Trying 192.168.50.10...
Connected to 192.168.50.10.
Escape character is '^]'.
SW1#
SW1# ss
ss
% Command incomplete: ss
SW1#
SW1#
The command prompt echoes, and the commands are printed twice. Even the commands I send are echoed back.
When I connect with nc, I encounter the following issue:
SW1# sss
sss
% Unknown command: sss
SW1#
It re-echos the entered command.
I would appreciate guidance on how to resolve this issue.
i use echo=0 to solve this but it didn't work.
After extensive research, I found an alternative tool for
socatcalledser2net. I implemented a server console by adding the following configuration in the/etc/ser2net.conffile:This configuration allows you to access the console of your server over Telnet on port 2204 with the specified serial port settings.