Skip to content

Conversation

@Nivispluma
Copy link
Contributor

Title

ADD: Support for LANCOM LCOS SX 5

Description

This PR introduces a new driver for LANCOM devices running LCOS SX 5, which is the OS for the Enterprise models.

Peculiarity

LANCOM does not allow Exec commands to be run in Config Mode, therefore a config-mode-check is added to save_config and cleanup.
SSH Connection to LCOS SX 5 devices normally start in the EXEC Mode. This Mode however offers only inconsistent command usage. Therefore the driver will elevate the Session to privileged EXEC Mode by default during session_preparation
The terminal width commands dont work on LCOS SX 5

Testing

Tested on:

  • XS-6128QF

A File with full show and config test result is attached.

2025-05-02_netmiko-lancom-driver-LCOSSX5-test.txt

super().disable_paging()
self.clear_buffer()

def set_terminal_width(self, *args: Any, **kwargs: Any) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to override the set_terminal_width. It's only ever called from session_preparation which you already override. If you do really want to keep it, you should have it raise NotImplementedError

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have removed the redundant function

@Noppes
Copy link
Contributor

Noppes commented May 12, 2025

Looking at https://www.lancom-systems.de/fileadmin/download/documentation/CLI-Reference/MA_LCOS-SX-5.20-CLI-Reference_EN.pdf, it says to enter config mode its configure and not configure terminal like in cisco, is that correct?

I also see that you check for (Config)# with a capital C is that correct?

offers inconsistent command options
"""
self._test_channel_read()
super().send_command_timing(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason you are calling send_command for this instead of just using self.enable()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tested multiple versions with self.enable(), and i wasn't able to get it working. I think it has to do with LANCOM not prompting for enable passwords at all.
Therefore i chose to use this workaround.

Copy link
Contributor Author

@Nivispluma Nivispluma Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*EDIT: i had the following Error:

ValueError: Failed to enter enable mode. Please ensure you pass the 'secret' argument to ConnectHandler.

However i was able to resolve this by passing the enable_pattern which results in self.enable(enable_pattern=r"#").
Now its working as you suggested :)

@Nivispluma
Copy link
Contributor Author

Sorry for not answering... had a lot going on :-/

Looking at https://www.lancom-systems.de/fileadmin/download/documentation/CLI-Reference/MA_LCOS-SX-5.20-CLI-Reference_EN.pdf, it says to enter config mode its configure and not configure terminal like in cisco, is that correct?

I also see that you check for (Config)# with a capital C is that correct?

The (official) Documentation is not explicit enough here. While configure would be enough to enter config mode it just auto completes to configure terminal. Therefore i chose to just leave the configure terminal.

The capital C is correct (as you can see below). I think that's because LANCOM is a German vendor

(XS-6128QF)>
(XS-6128QF)>enable

(XS-6128QF)#con?

configure

(XS-6128QF)#configure ter?

terminal

(XS-6128QF)#configure ?

<cr>                     Press enter to execute the command.
terminal                 Enter into Global Config Mode.

(XS-6128QF)#configure

(XS-6128QF)(Config)#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants