Configure replace from terminal on IOS/IOS-XE

Today I stumbled on a problem that I wanted to replace VPN names in my whole config on CSR1000v. 

Instruction on how to do it I’ve found on invaluable Ivan Pepelnjak’s blog:

http://blog.ipspace.net/2008/01/copy-text-files-into-router-flash.html

Basically I created a file in Notepad++, replaced what I wanted then I copied the new content to new file on flash via ssh session using the instruction in the link provided above e.g.

Afterwards I just replaced current config with the one in file: 

 And voila!

Manual kernel installation on Debian

Recently I had to manually install  kernel on one Debian machine. Steps are as follows:

  • Download kernel-headers and kernel-image deb packages
  • Install these packages with

 After installation the following files shall appear in /boot directory:

  •  Still we are missing initial RAM disk and this one can be created with mkinitramfs:

After this step RAMdisk will appear in /boot:

  • Update grub and check /boot/grub/grub.cfg to verify that new entry is added:

Create fake loop device on Fedora

First question – what is the purpose? Such fake loop device can be used as pv in lvm in case we want to play around and don’t want to add a new disk.

  • Prepare a binary file with dd e.g.  /srv/swift-disk.bin
  • Create a script in e.g:  /usr/lib/systemd/scripts and ensure that it is executable:

  • Create a service in: /usr/lib/systemd/system

  •  Enable and start a service:

Installing additional packages for Python on Windows

On Windows 7 I have tried to install paramiko package so as to have possibility to SSH from Python scripts to network devices or any other SSH servers.

  1. Install setuptools https://pypi.python.org/pypi/setuptools#id3
  2. Install VC++ compiler for Python2.7 http://www.microsoft.com/en-us/download/details.aspx?id=44266
  3. Install a required package:

 VC++ compiler installation is needed as some of the downloaded files needs compilation to executable files or libraries.

BGP Soft Reset on IOS-XE

While trying to connect CSR1000v to Quagga I encountered the issue that I could not see received routes:

By default (it seems) that soft reconfiguration for inboud updates is not enabled (as it requires addtional memory resources to store received-routes in BGP Adj-RIB-in table) .

Configuration is as simple as:

Accessing cloud images

For both Fedora and Ubuntu cloud images we can access them using ssh public key generated during bootup.

Key can be obtained from a console log:

  • Horizon -> Instances -> <fedora_ubuntu_instance> -> Console -> View Full Console Log
  • sudo vim /var/lib/nova/instances/<instance_id>/console.log

SSH can be done from from a proper ip namespace on compute nodes:

Or from any different host if Public IP is associated with the instance.

Nova installation on OpenSUSE 13.1

Firewalld
  • Firewall rules can be modified from GUI:
  • Assign internal interfaces to “Internal zone”
  • Add SSH service to “External zone”
RabbitMQ

In order to allow to access rabbitmq from a remote (and local) host to rabbitmq server before starting rabbitmq-server add in /etc/rabbitmq/rabbitmq.config:

Instance creation fails with “Cannot find suitable CPU” on Debian 7

KVM by default does not work (even though vmx/smx is enabled for CPUs) – instance creation fails with “Cannot find suitable CPU”.

Solution:

  • In /etc/libvirtd/qemu.conf:
  • remove file /var/cache/libvirt/qemu/capabilities and restart host (libvirtd restart does not suffice)
  • After restart check capabilities with: