Search for highlighted text in Word

Search a document for highlighted text (any colour) using Find with Advanced option, leave “Find what:” blank and select Highlight in Format list.

So, if you have a config.cfg from an old VOSS switch which you want to re-use on a new switch you can highlight the lines that you need to change and search for them using this method later when you are ready to update it.

The final updated file can be copied to VOSS switches and then loaded using the source command.

If you use source config.cfg debug stop syntax, it will display commands (line-by-line) and if any have invalid syntax, it will stop and the last one will only parse and test but not apply. If you remove “syntax” it will attempt to apply all commands.

Or copy the file and boot with it with the no boot config flags verify-config set. It will keep reading the file even if it hits something it does not like.

Since VOSS release 8.2 a new feature was added for management. The clip or VLAN IP used for management will need to be converted to SMI. Insert the line migrate-to-mgmt under either the “interface loopback x” or “interface vlan x” lines in the config you are using.

Compare original config with running-config and amend where needed.

Create a list of VLAN commands in Excel

First, open a new Excel workbook and import the list of VLANs from the “show interface gigabit vlan” command in VOSS. Prepare the data in Notepad ++ by inserting a “=” as a column break between each word to help with the import into columns. You want a single cell with a list of VLANs.

Identify a free cell in the sheet and use the Data tab Text to Column tool to split the list of comma separated VLANs into new columns.

Select all of the VLAN columns and paste into a new cell using Transpose which will create a list of VLANs in a single column.

Always ensure the columns are set as type “Text”.

Insert a new column alongside the previous one and add the interface number alongside each VLAN.

Then we can use the concatenate formula to combine the VLANs and interface at the end of the string “vlan members add”.

For example, the formula would be =CONCATENATE(“vlan members add “,O2,” “,P2) placed in the adjacent cell in a new column alongside the VLAN and Interface columns. We can then select the cell and drag it down the rest of the column to create the list of VLAN commands needed to add a long list of VLANs to an individual port.

Alternatively, use GREP to extract all of the “vlan members” lines from the saved config file and import into Excel (into columns). Add a column alongside “members” which can contain “remove” or “add”. If needed remove the slot and “/” characters from the port numbers if applying on a switch with a different format. Higher speed ports may need changing manually as well. Create a new column which concatenates the cells to build the commands to assign VLANs to ports. This method probably cleaner.

EXOS Editor

On the CLI use command EDIT to view or change a policy or script file. For example, type edit script newvlan.xsf with a line in it that adds a new VLAN (create vlan yellow). Then use the command run script newvlan.xsf will apply the command and create the VLAN.

Type Ctrl & D and then “:” will allow you to quit without saving (:q!) or save the modified file (:wq!). 

Also, it is possible to save the running config to a script for ease of replaying maybe with a slight alteration using save configuration as-script config.xsf (and view using the EDIT command). 

Obviously, use show configuration should be used to view the running configuration. It is possible to compare differences between configuration files by adding the difference parameter and the names of the two configuration files to compare. And to show the factory defaults as well as the new configuration using the detail option.

 

Copy all text from XMC device terminal

XMC can connect direct to a device using the CLI Credentials but the web terminal is not easy to use if you want to select text from the terminal.

Until now. I found a way to select all the text from the top to the bottom of the screen.

Open a terminal to a switch and capture the show running config output. This can be done manually but is a real pain to have to scroll down the screen.

Instead, click the mouse at the top of the text, press Ctrl + Shift and select a few lines. Whilst still holding down Ctrl + Shift use the scroll bar and go right to the bottom and click at the bottom of the screen and then click “c”. The text will now be available in the clipboard and can be pasted elsewhere.

Adding new username to XMC

Check existing usernames on the Linux server before and after.

cat /etc/passwd | awk -F: ‘{print $1}’

Add a new username:

useradd -m <newadmin>

passwd <newadmin>

Enter password twice.

Add same username in XMC under Administration>Users and associate with NetSight Administration group. 

Logout of XMC and test login with new username.

https://extremeportal.force.com/ExtrArticleDetail?an=000077421&q=netsight%20user

 

 

ECIQ Configuration Failed

Reasons for configuration download failures will vary. Hover over the error message and it will show a reason for the failure.

When completing device templates make sure the syntax and text is permitted by the target operating system.

For example, EXOS restricts the characters allowed for the SysLocation and if the user fills out the SNMP Location in the template with illegal characters then the download will fail.

Tested the string on the CLI to confirm the validity of the string. In below case the apostrophe is not a valid character.

* EXOS-VM.12 # configure snmp syslocation “myhouse’s”
ERROR : Invalid characters are used in sysLocation.
Allowed characters: A-Z, a-z, 0-9, +-@_.,:;()/[]

EXOS Link-Local IP

Link-Local addressing (subnet 169.254.x.x) allows a host device to automatically and predictably derive a non-routable IP address for IP communication over Ethernet links.
By configuring the Ethernet management port “just out of the box” with an IP address, a user can connect a laptop directly to the management Ethernet port. If the laptop is not configured with a fixed IP address, it tries to get an IP address from a DHCP server. If it cannot, it assigns its own Link-Local address putting the switch and the laptop on the same subnet. The laptop can then use Telnet or a web browser to access the switch removing the need for the serial cable.
The IPv4 address format is used to make it simple for a user to determine the switch’s IP address. The formula is to use the lower 2 bytes of the MAC address as the last two numbers in the Link-Local IPv4 address.

• MAC address: 00:04:96:97:E9:EE
• Link-Local IP address: 169.254.233.238 or 0xa9fee9ee

Web browsers accept a hexadecimal value as an IPv4 address. (Microsoft IE displays the URL with the number dot notation 169.254.233.239.)

The web URL is http://0xa9fee9ee or just 0xa9fee9ee
The user documentation directs the customer to access the web browser by typing 0xa9fe followed by the last two number/letter groups in the MAC address found on the switch label. No hexadecimal translation is required.
With this information, you can connect the Ethernet port directly from a laptop to this switch using the temporary Link-Local address. You can communicate via web or Telnet to perform the initial switch configuration, if needed, and no longer needs a serial cable to configure a switch.

Ansible Tags

Placing tags inside playbooks will allow you to select specific tasks from within. 

Tip: It is possible to reuse the same tag in more than one task. Example below uses different tags to differentiate between tasks.

$ cat hello.yml

– name: Tags
hosts: localhost
tasks:

– name: Debug Module Message One

debug:
msg:
– “Welcome One!”

tags: one

– name: Debug Module Message Two

debug:
msg:
– “Welcome Two!”

tags: two

Example…

ansible-playbook hello.yml –tag two

$ ansible-playbook hello.yml –tag two

PLAY [Tags] *

TASK [Gathering Facts] ****
ok: [localhost]

TASK [Two] **
ok: [localhost] => {
“msg”: [
“Welcome Two!”
]
}

PLAY RECAP **
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

Remove and Reinstall Cygwin

Maybe time has come to remove Cygwin to free up space or to start over. Cygwin does not support an uninstall program but can be done manually.

  1. Open command prompt with administrator privilages
  2. Type takeown /r /d y /f cygwin64
  3. Type lcacls cygwin64 /t /grant everyone:f
  4. Type rmdir /s /q cygwi64
  5. Regedit and delete HKEY_CURRENT_USER_Software_Cygwin
  6. Regedit and delete HKEY_LOCAL_MACHINE_Software_Cygwin
  7. Delete shortcut on desktop
  8. Restart

Download latest setup-x86_64 and run it. Do not install everything! Only start by installing ‘gcc-core’, ‘make’, ‘openssl’ ‘openssh’, ‘vim’ and ‘python3.8’. Also, include the ‘python3.8-crypto’ file which will save you a lot of pain when adding packages with pip3 which rely on cryptography package. It is quite easy to go down a rat hole when a dependency fails and you get disheartened when a lot of red messages appear on screen. There are times you need to use the Cygwin setup program to install specific packages.

Open Cygwin terminal and type python should start python 3.8 shell.

Cygwin Virtualenv

Over time the number of Python packages installed becomes too high to understand their dependencies on each other. I tried to add a package and changed my environment where I lost the list of previously installed packages. Rather than go into detail all I can say is that it was a lesson learnt.

Because it is sometimes difficult to fix an issue and is time consuming I wanted to create a virtual environment in Cygwin so I could develop new applications and not impact my normal day to day setup.

Here are the steps I used to create a virtual environment in Cygwin:

  1. Check which pip to use for the Python version you use.
  2. pip3 install virtualenv
  3. mkdir PythonApp
  4. cd PythonApp
  5. virtualenv PythonAppVenv
  6. Check new environment folder PythonAppVenv created in PythonApp folder
  7. Activate the virtual environment by typing source PythonAppVenv/bin/activate
  8. (PythonAppVenv) should appear on the left side of the name prompt
  9. Check list of packages is different to normal list with pip3 list
  10. Install a new package and it will only add it to the virtual environment
  11. Check the PythonAppVenv lib/python3.8/site-packages folder or type pip3 list
  12. Once you are finished, you deactivate the virtual environment using the command deactivate