giovedì 4 aprile 2013

Oracle Linux: NIC bonding

NIC bonding allow the use of multiple NICs for increased network performance or availability. Multiple NICs are combined into a single "network entity" called bond in which NICs can be added or removed.

So, let's start:

Create the bond alias. This alias will point to a network configuration file where we will define the properties of our bond like the IP address and bonding options.

[root@oracle ~]# nano /etc/modprobe.conf

add the following line into modprobe.conf

alias bond0 bonding

Now create the configuration file for interface bond0:

[root@oracle ~]# cd /etc/sysconfig/network-scripts/

[root@oracle network-scripts]# touch ifcfg-bond0

[root@oracle network-scripts]# nano ifcfg-bond0


Insert this in ifcfg-bond0 file:

DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.0.0.0
NETMASK=255.255.255.0
IPADDR=10.0.0.122
USERCTL=no
BONDING_OPTS="mode=1 miimon=100"


Where:

NETWORK=10.0.0.0 is the network class we are using.
IPADDR=10.0.0.122 is the IP address of this machine
BONDING_OPTS="mode=1 miimon=100" are the bonding options.

mode=1 is used for active backup policy which means that only one network adapter is active and the remaining are waiting for main NIC to fail in order to replace it.
Common values for "mode" are: 0 round robin and 1 active backup
miimon=100 is the frequency in milliseconds of MII link monitoring. 100ms is a suggested value.

bond0 configuration file is completed, now we need to edit configuration files for all NICs participating into this bond. For this guide I'm using only two NICs in bond0 so I have to edit only ifcfg-eth0 and ifcfg-eth1


[root@oracle ~]# nano /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
HWADDR=00:50:56:BF:00:25
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no


[root@oracle ~]# nano /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=none
HWADDR=00:50:56:BF:00:34
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no


As you can see we configure all interfaces of the bond to be slaves using bond0 as master.

Restart network to apply changes:

[root@oracle ~]# service network restart
As for last step we need to add a default gateway for our machine:

[root@oracle ~]# /sbin/route add -net default gw 10.0.0.250
Try to ping an internet address, if ping echo reply returns correctly make permament this route adding previous command to rc.local file.

[root@oracle ~]# nano /etc/rc.local

Add:

/sbin/route add -net default gw 10.0.0.250


rc.local will be called each time the machine will startup.


That's all!!

martedì 2 aprile 2013

VMware: How to install Cisco Nexus 1000v - Part1

In this topic I briefly explain how to install Cisco Nexus 1000v virtual switch in VMware vSphere 5.1

Prerequisites for this installation are:

  • Nexus1000v.4.2.1.SV2.1.1a.zip file which contains Cisco software. You can download it from this page.
  • Three VM Networks:
    1. Management Network (VM Kernel)
    2. Control Network (VM PortGroup)
    3. Port Network (VM PortGroup)

These networks should be separated usingh VLANs as stated in Cisco Nexus 1000V Getting Started Guide.

First we need to install Nexus 1000V Virtual Supervisor Module(VSM).
Unzip Nexus1000v.4.2.1.SV2.1.1a.zip, the OVA file that will be deployed is located in "Nexus1000v.4.2.1.SV2.1.1a\VSM\Install" folder.

Open VMware vSphere Client, click File > Deploy OVF Template, choose nexus-1000v.4.2.1.SV2.1.1a.ova and follow the installation as stated in screenshots below.



Insert the Nexus 1000v administrator password and the management IP Address of the switch:




Once VSM is installed, we need to use Cisco installer to finalize the installation of the switch providing vCenter credentials.
Go to "Nexus1000v.4.2.1.SV2.1.1a\VSM\Installer_App" folder and run Nexus1000V-install_CNX.jar (Java must be installed in your machine in order to run this).
Select vCenter Server Connection and provide vCenter credentials as in the following images:


Once installation is finished click Close and in vSphere Client under Inventory > Networking you will see the Cisco 1000v Virtual Distributed Switch.

In a following post I will explain how to simple configure it creating port groups.

That's all!!