Configure IP Addressing on CentOS

## ## Configure eth0 # # vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0" NM_CONTROLLED="yes" ONBOOT=yes HWADDR=A4:BA:DB:37:F1:04 TYPE=Ethernet BOOTPROTO=static NAME="System eth0" UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 IPADDR=192.168.1.44 NETMASK=255.255.255.0

## Configure Default Gateway # # vi /etc/sysconfig/network

NETWORKING=yes HOSTNAME=centos6 GATEWAY=192.168.1.1

## Restart Network Interface #

/etc/init.d/network restart

## Configure DNS Server # # vi /etc/resolv.conf

nameserver 8.8.8.8 # Replace with your nameserver ip nameserver 192.168.1.1 # Replace with your nameserver ip

### Source: https://gist.github.com/fernandoaleman/2172388#file-linux-static-ip

By vichhaiy Posted in Linux

Understanding DNS Zone…

zone "example.com" in {
type master;
file "/etc/bind/zones/master.example.com";
allow-transfer { key dns-server.example.com; };
allow-query { any; };
also-notify { 172.16.200.23; 172.16.202.23; };
notify yes;
};

Let’s understand each line and its meaning in the above shown zone clause inside our bind installation.

zone "example.com": is the opening of the zone clause and it specifies the zone for which this configuration is applicable.
type master: this statement is used to specify that this server is going to be the master server for the zone example.com, and will be authoritatively modifying the zone content.
file "/etc/bind/zones/master.example.com": This statement denotes the file on our DNS server which contains the zone file and its records(we will see that file in some time).
allow-transfer {key dns-server.example.com}: This line is the most important line that is part of the security feature in bind for secure zone transfer. This line says that zone trasfer is allowed only to servers that have this key named dns-server.example.com. Please note the fact that the name of this key must be same on the slave servers as well.
allow-query {any;}: This line specifies that this zone can be queried by any ip address.
also-notify {172.16.200.23; 172.16.202.23; }: This line says that the bind server should notify these servers whenever a zone modification happens. If you see the statement, it is also-notify, means bind is will already be informing some servers about its zone modification, along with that include these servers as well(i will exaplain this a little later while making the zone file for example.com).
notify yes; is an option used to convey bind to notify slaves about the zone modification.

;zone file for domain example.com
$TTL 300 ; zone default of 5 minutes
$ORIGIN example.com.
@ IN SOA ns1.example.com. admin.example.com. (
2013100702 ; serial number
2h ; refresh
15m ; update retry
5w ; retry
2h ; <minimum></minimum>
)
IN MX 10 mail.example.com.
IN NS ns1.example.com.
IN NS ns2.example.com.
ns1 IN A 172.16.202.55
ns2 IN A 172.16.203.85
www IN A 172.16.200.18
apps IN A 172.16.200.19
ftp IN A 172.16.200.22

Why Linux?

Although Windows is the most popular OS (Operating System) for casual computer users, this does not necessarily make it the "best" OS. Ubuntu, which is a Linux distribution, has many features that make it a good alternative to Windows:

  • It’s free. True, one could download pirated versions of Windows. But that would be illegal.
  • It’s an open source operating system. This means anyone is entitled to download and view the source code to any/all parts of the operating system. Or change it, to suit whatever purpose they want to use it for. If they choose to distribute their modified version, other people can then go on to change that too, allow the software to evolve to serve different needs.
  • It’s community driven. This means that anyone can contribute to the effort, be it with programming, art, sounds, documentation, or answering users’ questions on the Internet. It’s not controlled by a Fortune 500 company with questionable legal practices.
  • It’s more reliable. Linux crashes far less often than Windows, unless you purposely overload the system.
  • It’s free software. Almost all of the software associated with the OS is available for free and can be easily installed with just a couple of clicks.
  • It’s safe. There are very few viruses written for Linux due to its relatively low user base (compared to Windows). There are only 49 viruses in Linux and most are patched in kernel updates (from Spatry’s Cup of Linux).
    • If someone were to write viruses for Linux they would have to be very sophisticated due to the fact that the virus could not be executed unless it were given root permissions.
    • The virus would have to be run as the root user if it was intended to cause any serious damage due to the restrictions that normal users have by default.
    • There are some viruses out there that can cause loss of users data. Just be extra careful when anyone tells you to run a command, and only take advice from trusted people/sources.
  • Did I mention it’s free to download, free to use, and free to upgrade, and will be forever?
By vichhaiy Posted in Linux

How to use “route” command on Linux

Route command is used to show/manipulate the IP routing table. It is primarily used to setup static routes to specific host or networks via an interface.

Let’s start with some very basic…

1. Running route at the command line without any options will display the routing table entries:

#route

2. Learn to add and remove routes from your routing table:
eth0 : Exit interface

gw : GateWay

#route add -net 192.168.0.0/24 dev eth0
#route del -net 192.168.0.0/24 dev eth0

#route add -net 192.168.0.0/24 gw 192.168.10.1
#route del -net 192.168.0.0/24 gw 192.168.10.1

That’s all!

Unix Less Command: 10 Tips for Effective Navigation

I personally prefer to use less command to view files (instead of opening the file to view in an editor). Less is similar to more command, but less allows both forward and backward movements. Moreover, less don’t require to load the whole file before viewing. Try opening a large log file in Vim editor and less — you’ll see the speed difference.

The navigation keys in less command are similar to Vim editor. In this article, let us look at few less command navigation and other operations which will make you a better command line warrior.

1. Less Command – Search Navigation

Once you’ve opened a log file (or any file) using less file-name, use the following keys to search. Please note that the match will be highlighted automatically by default.

Forward Search

  • / – search for a pattern which will take you to the next occurrence.
  • n – for next match in forward
  • N – for previous match in backward

Backward Search

  • ? – search for a pattern which will take you to the previous occurrence.
  • n – for next match in backward direction
  • N – for previous match in forward direction

Tip: If you dont bother about which direction the search is happening, and you want to search file path, or URL, such as “/home/ramesh/”, you can use backward search (?pattern) which will be handy as you don’t want to escape slashes each time.

Search Path In forward: /\/home\/ramesh\/ In backward: ?/home/ramesh/

2. Less Command – Screen Navigation

Use the following screen navigation commands while viewing large log files.

  • CTRL+F – forward one window
  • CTRL+B – backward one window
  • CTRL+D – forward half window
  • CTRL+U – backward half window

3. Less Command – Line navigation

In a smaller chunk of data, where you want to locate particular error, you may want to navigate line by line using these keys:

  • j – navigate forward by one line
  • k – navigate backward by one line

4. Less Command – Other Navigations

The following are other navigation operations that you can use inside the less pager.

  • G – go to the end of file
  • g – go to the start of file
  • q or ZZ – exit the less pager

5. Simulate tail -f inside less pager – Press F

Once you’ve opened a file using less command, any content that is appended to the file after that will not be displayed automatically. However, you can press Fless command will show the status ‘waiting for data‘. This is as similar to ‘tail -f’.

Also, refer to our earlier article about how to view multiple logs files using tail -f.

6. Less Command – Count magic

Similar to Vim editor navigation command, you can give 10j to scroll 10 lines down, or 10k to go up by 10 lines.

  • 10j – 10 lines forward.
  • 10k – 10 lines backward.
  • CTRL+G – show the current file name along with line, byte and percentage statistics.

7. Other useful Less Command Operations

  • v – using the configured editor edit the current file.
  • h – summary of less commands
  • &pattern – display only the matching lines, not all.

8. Open any types of files using less command

As we discussed in our earlier article, you can use less command to Open & view 10 different file types.

9. Less Command – Marked navigation

When you are viewing a large log file using less command, you can mark a particular position and return back to that place again by using that mark.

  • ma – mark the current position with the letter ‘a’,
  • ‘a – go to the marked position ‘a’.

10. Less Command – Multiple file paging

Method 1: You can open multiple files by passing the file names as arguments.

$ less file1 file2

Method 2: While you are viewing file1, use :e to open the file2 as shown below.

$ less file1 :e file2

Navigation across files: When you opened more than two files ( for e.g – less * ), use the following keys to navigate between files.

  • :n – go to the next file.
  • :p – go to the previous file.

Source: http://www.thegeekstuff.com/2010/02/unix-less-command-10-tips-for-effective-navigation/

SCP vs RSYNC

The major difference between these tools is how they copy files.

Scp basically reads the source file and writes it to the destination. It performs a plain linear copy, locally, or over a network.

Rsync also copies files locally or over a network. But it employs a special delta transfer algorithm and a few optimizations to make the operation a lot faster. Consider the call.

rsync A host:B 
  • If the destination file B already exists, the delta transfer algorithm will make sure only differences between A and B are sent over the wire.
  • Rsync will check files sizes and modification timestamps of both A and B, and skip any further processing if they match.
  • Rsync will write data to a temporary file T, and then replace the destination file B with T to make the update look "atomic" to processes that might be using B.

Anther difference between them concerns invocation. Rsync has a plethora of command line options, allowing the user to fine tune its behavior. It supports complex filter rules, runs in batch mode, daemon mode, etc. Scp has only a few switches.

In summary, use scp for your day to day tasks. Commands that you type once in a while on your interactive shell. Its simpler to use, and in those cases rsync optimizations won’t help much.

For recurring tasks, like cron jobs, use rsync. As mentioned, on multiple invocations it will take advantage of data already transferred, performing very quickly and saving on resources. It is an excellent tool to keep two directories synchronized over a network.

Also, when dealing with large files, use rsync with the -P option. If the transfer is interrupted, you can resume it where it stopped by reissuing the command. See Sid Kshatriya’s answer.

Source: http://stackoverflow.com/questions/20244585/what-is-the-difference-between-scp-and-rsync?rq=1

Ubuntu Desktop features for Education essentials

Ubuntu Desktop is a Linux-based Open Source OS that is globally popular. It is because of many rich features & advanced graphic design for low-end to high-end range of users to specifically compete with Windows Desktop & Mac OS.

Below are some features for Educational purposed users:

ü Open source — free from licensing restrictions

ü Microsoft-compatible office productivity suite

ü Fully translated into 40+ languages

ü Long Term Support releases come with five years of security patches and updates

ü On-site consulting services and training available

ü Virus free and highly secure

ü Runs well on old and new hardware

ü A wide range of education-specific apps for students and educators alike

Source: http://www.ubuntu.com/desktop/education

maxresdefault.jpg

Install Mikrotik to VMware

To better install MikroTik routerOS x86 to your Vmware, choose OS type: Linux 2.6.x & HDD IDE (Not Scsi), configure ip (ip address add address=10.1.1.1/24 interface=ether1), test ping, then connect with winbox via IP:10.1.1.1 (user: admin, blank passord). To show ip, ip address print. That’s it.

By vichhaiy Posted in Linux

GNS3 – Assign an IP Address to Linux Microcore QEMU Guest

Problem:

The whole point of having these guest machines is for testing communications, putting an IPaddress on them so you can ping things, is a pretty basic step.

Solution

1. Console in, and execute the following commands, obviously change the IP addresses to the ones you require.

sudo su
ifconfig eth0 192.168.1.11 netmask 255.255.255.0 up
route add ip default gw 192.168.1.254
route add default gw 192.168.1.254

Add IP to Microcore

Source: http://www.petenetlive.com/KB/Article/0000932.htm

How to Add Host in Zabbix Server to Monitor

After installing Zabbix Server and Zabbix Agent, lets move to add your first host in Zabbix monitoring. There are Zabbix is template rich tools, It contains lots of pre defined templates which we can easily used with our hosts.

There are two ways to add hosts in Zabbix:

1. Zabbix has capability to scan your network and automatically add all the hosts in Zabbix server.
2. Second method is used for adding hosts manually.

Using this tutorial, we are going to add host manually. Follow the below steps to add your first host which is running with Linux operating system.

Adding New Host in Zabbix

Firstly we need to login to zabbix web interface using admin account.

After login follow the steps given below, You may also refer screenshot showing just after these steps.

  • Click on Configuration Menu
  • Click on Hosts submenu
  • Click on Create Host button at right side

add-zabbix-host-1

Now fill the following details of remote host and go to Templates tab.

  • Enter Hostname: Hostname of Remote system
  • Visible name: Name to be display in zabbix
  • Group: Select the desired group for you host
  • Agent interface: Fill the info of Zabbix agent running on host
  • Status: Select initial status

add-zabbix-host-2

  • Click on add link
  • Select desired Template : Please select carefully, Because it will enabled all checks for the host
  • Click on save button

add-zabbix-host-3

add-zabbix-host-4

Congratulation! You have added first host for zabbix monitoring. Repeat the same task for other hosts too.

How to View Graph in Zabbix

Graphs are always attracted the new users, Below screenshot will help you to how to view graphs in zabbix. If you have just added the host, you need to wait for few time, so that zabbix can collect some data from remote host to show on graph.

graph-network

Thank You for using this article, if this tutorial helps please do forgot to share it with your friends.

Use below link to read more about zabbix configurationhttps://www.zabbix.com/documentation/2.0/manual/config

Source: http://tecadmin.net/add-host-zabbix-server-monitor/