Posts

Showing posts from January, 2015

Linux : Basic Network Configuration , Set ip,eth0,gateway,netmask Temporarily or Permanent

For latest Redhat Linux OS versions, we can configure network in few steps. There are two types of methods are there for network configuration Temporary: In which IP temporarily will be assigned to Ethernet card, and will gone across reboot or  network restart. Permanent: In which network configuration will be set permanently (in config files), so will be consistent across the reboot or network restart. We will see both types here, before that we will need few things kinda prerequisite as below: Sample Set-up Scenario : Linux Static TCP/IP Settings IP address: 192.168.1.50 Netmask: 255.255.255.0 Hostname: UL_SERVER Gateway IP: 192.168.1.1 Display All interfaces ( Including Disabled Interfaces ) # ifconfig -a Dislplay only Active/Enable Ineterface #ifconfig Disable and Enable an Interface # ifconfig eth0 down # ifconfig eth0 up Method  1 - Temporary Netwok Setup Assign ip-address to an Interface and set netmask and broa...

LVM Basics: Creating A New Filesystem With fdisk lvm and mkfs

Logical Volume Management (LVM) is a disk management tool supported by all major Linux distributions. With LVM, disks and partitions can be abstracted to contain multiple disks and partitions into one device. Basic building blocks of LVM: 1.        Physical volume (PV): Partition on hard disk (or even the disk itself ) on which you can have volume groups. It is divided into physical extents(PE).  physical volumes = big building blocks used to build your hard drive. 2.        Volume group (VG): Group of physical volumes used as a storage volume (as one disk). They contain logical volumes. volume groups = as hard drives. 3.        Logical volume (LV): A logical partition of a volume group and is composed of physical extents. Logical volumes = normal partitions. 4.        Physical extent (PE): The smallest size in the physical volume that can be assig...

AIX : Remove Filesystem , Volume Group And Reclaim Associated SAN Disk

Geeks , Today we will see some basic set of operation to free SAN disk from AIX server and to make those disks ready/available for SAN (storage team) to reclaim. lspv | wc -l <- its like lsscsi , here we will count total number of devices before removal lsvg -p testvg <- it will give powerdisk associated with testvg (take all powerdisk names in a file) powermt display dev=<powerdisk> <- it will give powerdisk paths and logical ID of powerdisk (take all paths name in a file for all powerdisks) lsvg -l testvg <- it will list filesystems under testvg i.e. /test fuser -cu /test <- to check if FS is in use or not umount /test <- to unmount /test rmfs -ir /test <- it will remove filesystem and data ( i=to show warning, r=to remove mount point ) reducevg <vgname i.e. testvg > <pwrdsk> <- it will remove phy vol from a vol grp , when all phy vol removed, the vol grp will be deleted powermt remove dev=<powerdisk> ...

sftp : Secure Copy Of File From One Server To Another Server

File Transfer Protocol (FTP) was widely used protocol to transfer files or data remotely in unencrypted format which is not secure way to communicate , because all transmissions happens in clear text and the data can be readable by anyone during sniffing the packets on the network. SFTP (Secure File Transfer Protocol) runs over SSH protocol (using port 22 for secure connection). WINSCP also uses SFTP in background. 1.Connect to a remote server for sFTP By default SSH protocol is used to authenticate and establish a SFTP connection. To start an SFTP session, enter the username and remote hostname or IP address at the command prompt. Once authentication successful, you will see a shell with an sftp> prompt. [root@localserver ~]# sftp ajay@192.168.1.11 or  sftp ajay@remoteserver Connecting to 192.168.1.11... ajay@192.168.1.11's password: sftp> 2. Commands of sFTP (help) At sftp shell prompt, type "?" or "help" to get list of all commands ...

NIC Bonding : Bonding / Teaming Multiple Network Interfaces (NIC) Into a Single Interface

Bonding is nothing but Linux kernel feature that allows to club multiple like NICs (such as eth0, eth1) into a single virtual link such as bond0.,  which may increase the bandwidth and provides redundancy of NIC Cards.  - redundant links - fault tolerance or load balancing  There are various types of Channel Bonding modes are available but mainly we will use two below :- 0: Load balancing (Round-Robin) : Traffic is transmitted in sequential order or round-robin fashion from both NIC. This mode provides load balancing and fault tolerance. 1: Active-Backup : Only one slave NIC is active at any given point of time. Other Interface Card will be active only if the active slave NIC fails. Creating Ethernet Channel Bonding :- We have two Network Ethernet Cards i.e eth1 and eth2 where bond0 will be created for bonding  Configure eth1 and eth2 for bonding purpose :- # vi /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE="eth1" TYPE=Ethernet ONBOOT="yes" B...

IP Aliasing : Create Multiple IP Addresses to One Single Network Interface

The concept of configuring multiple IP addresses on a single network interface is called IP aliasing. In this , we can create multiple or many virtual interfaces (aliases) to a single physical card, so no need of diff network cards. Example : IP aliasing for setting up multiple virtual sites on Apache using one single network interface with different IP addresses on a single subnet network. Note :-Please note that all additional network IP address must be in same subnet. For example if your eth0 using 192.168.1.20 IP address then alias must be setup using 192.168.1.0/24 subnet. Lets say we have two IP address as below :- IPADDR 1 = 192.168.1.10 which is assigned to interface eth0 IPADDR 2 = 192.168.1.11 which needs to use by IP Aliasing. We have an interface called “ifcfg-eth0“, the default interface for the Ethernet device. If you’ve attached second Ethernet device, then there would be an “ifcfg-eth1” device and so on. These device network files are located in “/etc/syscon...

RPM Command cheat sheet to Install, Uninstall, Upgrade, Query RPM Packages

RPM command is used for installing, uninstalling, upgrading, querying, listing, and checking RPM packages on your Linux system. RPM stands for Red Hat Package Manager. With root privilege, you can use the rpm command with appropriate options to manage the RPM software packages. Syntax Description rpm -ivh {rpm-file} Install the package rpm -Uvh {rpm-file} Upgrade package rpm -ev {package} Erase/remove/ an installed package rpm -ev --nodeps {package} Erase/remove/ an installed package without checking for dependencies rpm -qa Display list all installed packages rpm -qi {package} Display installed information along with package version and short description rpm -qf {/path/to/file} Find out what package a file belongs to i.e. find what package owns the file rpm -qc {pacakge-name} Display list of configuration file(s) for a package rpm -qcf {/path/to/file} Display list o...