1ser2net(8) System Manager's Manual ser2net(8)
2
3
4
6 ser2net - Serial to network proxy
7
8
10 ser2net [-c configfile] [-C configline] [-p controlport] [-n] [-d] [-b]
11 [-v] [-P pidfile]
12
13
15 The ser2net daemon allows telnet and tcp sessions to be established
16 with a unit's serial ports.
17
18 The program comes up normally as a daemon, opens the TCP ports speci‐
19 fied in the configuration file, and waits for connections. Once a con‐
20 nection occurs, the program attempts to set up the connection and open
21 the serial port. If another user is already using the connection or
22 serial port, the connection is refused with an error message.
23
24
26 -c config-file
27 Set the configuration file to one other than the default of
28 /etc/ser2net.conf
29
30 -C config-line
31 Handle a single configuration line. This may be specified mul‐
32 tiple times for multiple lines. This is just like a line in the
33 config file. This disables the default config file, you must
34 specify a -c after the last -C to have it read a config file,
35 too.
36
37 -n Stops the daemon from forking and detaching from the con‐
38 trolling terminal. This is useful for running from init.
39
40 -d Like -n, but also sends the system logs to standard output. This
41 is most useful for debugging purposes.
42
43 -P pidfile
44 If specified, put the process id (pid) of ser2net in the pid‐
45 file, replacing whatever was in that file previously. A pidfile
46 is not created by default, you must specify this to create one.
47 Note also that this filename must be specific with the full
48 path, as ser2net will change directory to "/" when it becomes a
49 daemon. when it
50
51 -u If UUCP locking is enabled, this will disable the use of UUCP
52 locks.
53
54 -b Cisco IOS uses a different mechanism for specifying the baud
55 rates than the mechanism described in RFC2217. This option sets
56 the IOS version of setting the baud rates. The default is
57 RFC2217's.
58
59 -v Prints the version of the program and exits.
60
61 -p controlport
62 Enables the control port and sets the TCP port to listen to for
63 the control port. A port number may be of the form [host,]port,
64 such as 127.0.0.1,2000 or localhost,2000. If this is specified,
65 it will only bind to the IP address specified for the port.
66 Otherwise, it will bind to all the addresses on the machine.
67
68 If the port number is zero, that means that standard in/out will
69 be used for the only input/output, and only one port should be
70 specified in the config. This way, it can be used from inetd.
71
72
74 The control port provides a simple interface for controlling the ports
75 and viewing their status. To accomplish this, it has the following com‐
76 mands:
77
78 showport [<TCP port>]
79 Show information about a port. If no port is given, all ports
80 are displayed.
81
82 showshortport [<TCP port>]
83 Show information about a port, each port on one line. If no port
84 is given, all ports are displayed. This can produce very wide
85 output.
86
87 help Display a short list and summary of commands.
88
89 exit Disconnect from the control port.
90
91 version
92 Display the version of this program.
93
94 monitor <type> <tcp port>
95 Display all the input for a given port on the calling control
96 port. Only one direction may be monitored at a time. The type
97 field may be tcp or term and specifies whether to monitor data
98 from the TCP port or from the serial port Note that data moni‐
99 toring is best effort, if the controller port cannot keep up the
100 data will be silently dropped. A controller may only monitor
101 one thing and a port may only be monitored by one controller.
102
103 monitor stop
104 Stop the current monitor.
105
106 disconnect <tcp port>
107 Disconnect the tcp connection on the port.
108
109 setporttimeout <tcp port> <timeout>
110 Set the amount of time in seconds before the port connection
111 will be shut down if no activity has been seen on the port.
112
113 setportconfig <tcp port> <config>
114 Set the port configuration as in the device configuration in the
115 /etc/ser2net.conf file. If conflicting options are specified,
116 the last option will be the one used. Note that these will not
117 change until the port is disconnected and connected again.
118 Options 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
119 set the various baud rates. EVEN, ODD, NONE set the parity.
120 1STOPBIT, 2STOPBITS set the number of stop bits. 7DATABITS,
121 8DATABITS set the number of data bits. [-]XONXOFF turns on (-
122 off) XON/XOFF support. [-]RTSCTS turns on (- off) hardware flow
123 control. [-]LOCAL ignores (- checks) the modem control lines
124 (DCD, DTR, etc.)
125
126 setportcontrol <tcp port> <controls>
127 Modify dynamic port controls. These do not stay between connec‐
128 tions. Controls are: DTRHI, DTRLO Turns on and off the DTR
129 line. RTSHI, RTSLO Turns on and off the RTS line.
130
131 setportenable <tcp port> <enable state>
132 Sets the port operation state. Valid states are: off to shut
133 the TCP port down, raw to enable the TCP port transfer all I/O
134 as-is, rawlp to enable the TCP port input and device output
135 without termios setting, and telnet to enable the TCP port is up
136 run the telnet negotiation protocol on the port.
137
138
140 Configuration is accomplished through the file /etc/ser2net.conf. A
141 file with another name or path may be specified using the -c option, or
142 individual config lines may be specified with the -C option. This
143 file consists of one or more entries with the following format:
144
145 <TCP port>:<state>:<timeout>:<device>:<options>
146
147 or
148
149 BANNER:<banner name>:<banner text>
150
151 or
152
153 TRACEFILE:<tracefile name>:<tracefile>
154
155 FIELDS
156 TCP port
157 Name or number of the TCP/IP port to accept connections from
158 for this device. A port number may be of the form [host,]port,
159 such as 127.0.0.1,2000 or localhost,2000. If this is specified,
160 it will only bind to the IP address specified for the port.
161 Otherwise, it will bind to all the ports on the machine.
162
163 state Either raw or rawlp or telnet or off. off disables the port
164 from accepting connections. It can be turned on later from the
165 control port. raw enables the port and transfers all data as-is
166 between the port and the long. rawlp enables the port and
167 transfers all input data to device, device is open without any
168 termios setting. It allow to use /dev/lpX devices and printers
169 connected to them. telnet enables the port and runs the telnet
170 protocol on the port to set up telnet parameters. This is most
171 useful for using telnet.
172
173 timeout
174 The time (in seconds) before the port will be disconnected if
175 there is no activity on it. A zero value disables this funci‐
176 ton.
177
178 device The name of the device to connect to. This must be in the
179 form of /dev/<device>.
180
181 device configuration options
182 Sets operational parameters for the serial port. Values may be
183 separated by spaces or commas. Options 300, 1200, 2400, 4800,
184 9600, 19200, 38400, 57600, 115200 set the various baud rates.
185 EVEN, ODD, NONE set the parity. 1STOPBIT, 2STOPBITS set the
186 number of stop bits. 7DATABITS, 8DATABITS set the number of
187 data bits. [-]XONXOFF turns on (- off) XON/XOFF support.
188 [-]RTSCTS turns on (- off) hardware flow control. [-]LOCAL
189 ignores (- checks) the modem control lines (DCD, DTR, etc.)
190 [-]HANGUP_WHEN_DONE lowers (- does not lower) the modem control
191 lines (DCD, DTR, etc.) when the connection closes. NOBREAK Dis‐
192 ables automatic clearing of the break setting of the port. rem‐
193 ctl allows remote control of the serial port parameters via RFC
194 2217. See the README for more info. <banner name> displays the
195 given banner when a user connects to the port.
196
197 tr=<filename> When the port is opened, open the given tracefile
198 and store all data read from the physical device (and thus writ‐
199 ten to the user's TCP port) in the file. The actual filename is
200 specified in the TRACEFILE directive. If the file already
201 exists, it is appended. The file is closed when the port is
202 closed.
203
204 tw=<filename> Like tr, but traces data written to the device.
205
206 tb=<filename> trace both read and written data to the same file.
207 Note that this is independent of tr and tw, so you may be trac‐
208 ing read, write, and both to different files.
209
210
211 banner name
212 A name for the banner; this may be used in the options of a
213 port.
214
215 banner text
216 The text to display as the banner. It takes escape sequences
217 for substituting strings, see "FILENAME AND BANNER FORMATTING"
218 for details.
219
220
221 tracefile name
222 A name for the tracefile, this is used in the tw, tr, and tb
223 options of a port.
224
225 tracefile
226 The file to send the trace into. Note that this takes escape
227 sequences for substituting strings, see "FILENAME AND BANNER
228 FORMATTING" for details. Note that when using the time escape
229 sequences, the time is read once at port startup, so if you use
230 both tw and tr they will have the same date and time.
231
232
233 Blank lines and lines starting with `#' are ignored.
234
235
237 Filenames and banners may contain normal "C" escape sequences:
238
239 \a - bell
240 \b - backspace
241 \f - form feed
242 \n - newline
243 \r - carraige return
244 \t - tab
245 \v - vertical tab
246 \\ - \
247 \? - ?
248 \' - '
249 \" - "
250 \nnn - octal value for nnn
251 \xXX - hex value for XX
252
253 They may also contain, \d for the device name and \p for the TCP port
254 number.
255
256 A banner may contain \s for the serial port parameters (eg 9600N81) of
257 the given connection.
258
259 A filename may also contain the following sequences:
260
261 \Y -> year
262 \y -> day of the year (days since Jan 1)
263 \M -> month (Jan, Feb, Mar, etc.)
264 \m -> month (as a number)
265 \A -> day of the week (Mon, Tue, etc.)
266 \D -> day of the month
267 \e -> epoc (seconds since Jan 1, 1970)
268 \U -> microseconds in the current second
269 \p -> local port number
270 \d -> local device name
271 \I -> remote IP address (in dot format)
272 \H -> hour (24-hour time)
273 \h -> hour (12-hour time)
274 \i -> minute
275 \s -> second
276 \q -> am/pm
277 \P -> AM/PM
278
279 These sequences may be used to make the filename unique per open and
280 identify which port/device the filename was for. Note that in file‐
281 names when using \d, everything up to and including last / in the
282 device name is removed, because you can't have a / in a filename. So
283 in a filename /dev/ttyS0 would become just ttyS0.
284
285
287 ser2net uses the tcp wrappers interface to implement host-based secu‐
288 rity. See hosts_access(5) for a description of the file setup. Two
289 daemons are used by ser2net, "ser2net" is for the data ports and
290 "ser2net-control" is for the control ports.
291
292
294 SIGHUP
295 If ser2net receives a SIGHUP, it will reread it configuration file
296 and make the appropriate changes. If an inuse port is changed or
297 deleted, the actual change will not occur until the port is dis‐
298 connected.
299
300
302 Almost all error output goes to syslog, not standard output.
303
304
306 /etc/ser2net.conf
307
308
310 telnet(1), hosts_access(5)
311
312
314 None.
315
316
318 Corey Minyard <minyard@acm.org>
319
320
321
322Serial to network proxy 06/02/01 ser2net(8)