Serial ports

Dump the serial ports list

The list of serial ports that are present on the system can be dumped with the following command:

vsr> show state serial-port
serial-port ttyS0
    ..
serial-port ttyS1
    ..
serial-port ttyS2
    ..
serial-port ttyS3
    ..

Enable/disable console on serial ports

The serial ports that are present on the list dumped by the state command can have their consoles enabled/disabled using the config mode.

To enable serial ports consoles, do:

vsr> edit running
vsr running config# system console serial-port tty
ttyS0    ttyS1     ttyS2    ttyS3
vsr running config# system console serial-port ttyS0
vsr running config# system console serial-port ttyS1
vsr running config# system console serial-port ttyS2
vsr running config# commit
Configuration committed.

In the above configuration, the ttyS0, ttyS1 and ttyS2 ports consoles have been enabled. The completion will help you choose the serial ports from the list dumped by the state.

To disable a port console, do:

vsr> edit running
vsr running config# del system console serial-port ttyS0
vsr running config# commit
Configuration committed.

In the above configuration, the ttyS0 port console that we enabled previously, has been disabled. We only have ttyS1 and ttyS2 ports consoles enabled.

Show the enabled serial ports

The list of enabled serial ports can be dumped using the following state command:

vsr> show state system console serial-port
serial-port ttyS1
    ..
serial-port ttyS2
    ..

Note

When a new system is launched for the first time, there is no configuration for serial ports consoles. However the ttyS0 is enabled and will be shown by the show state system console serial-port command.

However, as soon as we input a configuration of serial ports only the ports consoles of this configuration will be enabled. So, for instance, if our first configuration doesn’t have ttyS0, its console will be disabled.

To illustrate this example, we can run these commands after starting our system:

vsr> show state system console serial-port
serial-port ttyS0
    ..
vsr> edit running
vsr running config# system console serial port ttyS1
vsr running config# commit
Configuration committed.
vsr running config# show state system console serial-port
serial-port ttyS1
    ..