ser2net(8) | System Manager's Manual | ser2net(8) |
ser2net - Serial to network proxy
ser2net [-c configfile] [-C configline] [-p controlport] [-n] [-d] [-b] [-v] [-P pidfile]
The ser2net daemon allows telnet and tcp sessions to be established with a unit's serial ports or with an IPMI Serial Over LAN (SOL) interface.
The program comes up normally as a daemon, opens the network ports specified in the configuration file, and waits for connections. Once a connection occurs, the program attempts to set up the connection and open the serial port. If another user is already using the connection or serial port, the connection is refused with an error message.
Note that this is the old-style configuration lines and is likely to go away when old style configuration is removed.
To make things easier to handle, any # in the config string that is not inside quote (what would normally start a comment in yaml) is converted to a new line. Plus a new line is added after each separate config string. So, for instance:
-Y 'connection: &con01# accepter: tcp,2013'
-Y ' connector: serialdev,/dev/ttyEcho0,9600n81,local'
-Y ' options:# banner: "### A Banner ###\r\n"'
can be put on the ser2net command line.
The admin interface provides a simple interface for controlling the ports and viewing their status. To accomplish this, it has the following commands:
If the "yaml" command is issued, echo is turned off and all output is YAML compliant. The form is basically the same as the non-YAML output, with some minor adjustments to make it YAML compliant. In addition, all responses are in the form:
%YAML 1.1
---
response:
<response info here>
...
If there is an error, it is returned in the response with the "error" key. If the command succeeded, no "error" key will be present in the response mapping. The "..." will be at the end of all responses.
The following commands are available in yaml output mode: exit, version, showport, disconnect, setporttimeout, setportenable, setportcontrol, reload,
If "%YAML" is seen in the input, YAML input and output modes are activated, echo is disabled, and all input is expected to be in the form:
---
command:
name: <command name>
id: <optional id>
parms: [ parm1 [, parm2 [...]]]
...
The id is optional and will just be returned in the response. The parms are optional, too, unless the command requires them. Extra parms are ignored, along with unknown keys in the main mapping.
Note that you have to deal with the "->" that is issued when the connection is made, before going into YAML mode, YAML doesn't handle that well.
In YAML output mode, you will get asynchronous reports of connections and disconnections in the form:
%YAML 1.1
---
new connection:
name: !!str 'con1'
remaddr: !!str 'ipv6,::1,59072'
...
%YAML 1.1
---
disconnect:
name: !!str 'con1'
remaddr: !!str 'ipv6,::1,59072'
...
Configuration is accomplished through the file /etc/ser2net/ser2net.yaml. A file with another name or path may be specified using the -c option. If the file ends in .yaml, it will be processed with the new yaml parser. If it ends in anything else, it will use the old configuration file format, no longer supported or documented. The old style configuration will go away at some point.
The yaml configuration file is described in ser2net.yaml(5)
ser2net uses the name (the connection alias) of the connection to tell if it is new, changed or deleted. If the new configuration file has a connection with the same name, it is treated as a change.
This has some unusual interactions with connections that allow more than one simultaneous connection. It works just like the other port, but the accepter is disabled and new connections will not be accepted until all the existing connections are closed.
All error output after startup goes to syslog, not standard output, unless you use the -d option.
/etc/ser2net/ser2net.yaml, /etc/ser2net/ser2net.key, /etc/ser2net/ser2net.crt, /usr/share/ser2net
None.
Corey Minyard <minyard@acm.org>
06/02/01 | Serial to network proxy |