SSH to a Host With Multiple Hops

If you want to make an SSH connection to a host which is reachable only with multiple ssh connections you may use below command to connect it easly. (Note that older versions of ssh do not have this option but you can use some workarounds to do the same (proxy command and etc.)) Assume that you are in A, want to access hostC which is only reachable through hostB A –> hostB –> hostC then the command becomes: ssh -J @hostB @hostC this will give…

Openvswitch Cheat Sheet

Add libvirt network to be used with open vswitch Create an xml file like below (it is going to be listed in networks) 1 2 3 4 5 6 <network> <name>obr0</name> <forward mode=’bridge’/> <bridge name=’obr0’/> <virtualport type=’openvswitch’/> </network> The parameters are: The name of the network The forward mode is set to bridge The bridge name is the bridge name The virtualport is set to openvswitch Then introduce this network to libvirt using commands below: virsh net–define <newnetworkfile.xml> virsh net–start <newnetworkname> virsh net–autostart <newnetworkname>   Add Mirror: ovs-vsctl –id=@pout get port mir0…

Nagios Tutorial for Programmers – 1

If you’re reading this post, then you probably know what Nagios is. It is a good, open-source monitoring solution for most of the needs. Most of the Nagios concept is very straight-forward for system admins. But if you’re rather a programmer then a system administrator some of Nagios concepts may confuse you. You have already looked for what “Passive Check” stands for already! If you’re like me this tutorial is for you. Please note that this post is rather a learning process than a complete…

Debian Bring Manually Configured Interface Up at Boot/Reboot

Edit /etc/network/interfaces and make following changes: 1.Add interface to auto line (your interface name may change and number of interfaces may also change). This change makes interface to be brought up at boot time: auto lo eth0 eth1 eth2 2.Add following lines for each interface. This change will make interface to be manually configured: iface eth1 inet manual    pre-up /sbin/ifconfig $IFACE up    post-down /sbin/ifconfig $IFACE down reboot and see your changes.

KVM Persistent Interface Names

If you’re using KVM for virtualization you may notice that your ethernet device that is attached to the bridge may have different names each time KVM restarts, and KVM manages attaching/detaching this interface to the bridge by itself. If you’re using standard linux bridge you can check attached ports: brctl show This gives you current bridges (KVM and user defined) and ports on them as shown below: But you may have some special rules/routes/mirrors based on this interface name. If this interface name ever changes…

Autostart KVM Guest on System Boot

If you want your virtual machine to start when host starts, there are two ways to do this. First one uses command line and pretty straightforward. Second one uses virt-manager (a GUI to manage kvm guests) Command line: virsh autostart <domain> Replace domain with your virtual machine name (case sensitive). For instance, if you have a VM named “websrv” virsh autstart websrv will mark websrv to autostart on host reboot/boot. Virt-manager GUI Open virt-manager and select your virtual machine from list. Then display properties of…

Openvswitch RPM build on Centos 7

{{unknown}}If you ever needed to build openvswitch for Centos 7 (including kernel module) this post may help you. Commands to build a RPM: Download openvswitch source. I’ve tested with 2.7.x and 2.9.x series. So I recommend you to do the same. It can be found at (if link becomes absolute look for a newer one, if newer one fails, look for this one) http://openvswitch.org/releases/openvswitch-2.7.0.tar.gz wget can be used to download it: wget http://openvswitch.org/releases/openvswitch-2.7.0.tar.gz wget http://openvswitch.org/releases/openvswitch-2.9.0.tar.gz we’ll be using some build tools, so install them to the system…

Linux Bridge as Hub

You can configure your linux bridge (brctl operates them) as a hub (if you want to) with setting the aging property of the bridge to 0 as below: brctl setageing <bridge> 0 This make your bridge to behave as a hub. Most of you may not remember a network hub’s functionality that is different from switches. Hubs are dummy devices, in other words they forward every packet to every other ports. It has no look-up table to decide packets destination port. Whereas switches are smart…