Archive Page 4 of 65



How to monitor traffic at Cisco router using Linux (Netflow)

By default Cisco IOS doesn’t provide any traffic monitoring tools like iftop or iptraff available in Linux. While there are lots of proprietary solutions for this purpose including Cisco Netflow Collection, you are free to choose nfdump and nfsen open source software to monitor traffic of one or many Cisco routers and get detailed monitoring data through your Linux command line or as graphs at absolutely no cost.

Below is beginner’s guide that helps to quickly deploy netflow collector and visualizer under Linux and impress everybody by cute and descriptive graphs like these:

nfsen screen

It is highly recommended to look through Netflow basics to get brief understanding of how it works before configuring anything. For example, here is Cisco’s document that gives complete information about Netflow. In a few words to get started you should enable netflow exporting on Cisco router and point it to netflow collector running under Linux. Exported data will contain complete information about all packets the router has received/sent so nfdump and nfsen working under Linux will collect it and visualize to present you the graph like above example.

Cisco Router Setup

1. Enable flow export on ALL Cisco router’s interfaces that send and receive some traffic, here is an example:

Router1# configure terminal
Router1(config)#interface FastEthernet 0/0
Router1(config-if)#ip route-cache flow input
Router1(config-if)#interface FastEthernet 0/1
Router1(config-if)#ip route-cache flow input
...

2. Setup netflow export:

Router1# configure terminal
Router1(config)#ip flow-export source FastEthernet0/0
Router1(config)#ip flow-export source FastEthernet0/1
Router1(config)#ip flow-export version 5
Router1(config)#ip flow-export destination 1.1.1.1 23456

Where 1.1.1.1 is IP address of Linux host where you plan to collect and analyze netflow data. 23456 is port number of netflow collector running on Linux.

Linux Setup

1. Download and install nfdump.

cd /usr/src/
wget http://sourceforge.net/projects/nfdump/files/stable/nfdump-1.6.2/nfdump-1.6.2.tar.gz/download
tar -xvzf nfdump-1.6.2.tar.gz
cd nfdump-1.6.2
./configure --prefix=/ --enable-nfprofile
make
make install

2. Download and install nfsen.

It requires web server with php module and RRD so make sure you have the corresponding packages installed. I hope you’re running httpd with php already so below are rrd/perl related packages installation hints only.

Fedora/Centos/Redhat users should type this:

yum install rrdtool rrdtool-devel rrdutils perl-rrdtool

Ubuntu/Debian:

aptitude install rrdtool librrd2-dev librrd-dev librrd4 librrds-perl librrdp-perl

If you run some exotic Linux distribution just install everything that is related to rrd + perl.

At last, nfsen installation:

cd /usr/src/
wget http://sourceforge.net/projects/nfsen/files/stable/nfsen-1.3.5/nfsen-1.3.5.tar.gz/download
tar -xvzf nfsen-1.3.5.tar.gz
cd nfsen-1.3.5
cp etc/nfsen-dist.conf etc/nfsen.conf

In order to continue you should edit file etc/nfsen.conf to specify where to install nfsen, web server’s username, its document root directory etc. That file is commented so there shouldn’t be serious problems with it.

One of the major sections of nfsen.conf is ‘Netflow sources’, it should contain exactly the same port number(s) you’ve configured Cisco with — recall ‘ip flow-export …’ line where we’ve specified port 23456. E.g.

%sources = (
    'Router1'    => { 'port' => '23456', 'col' => '#0000ff', 'type' => 'netflow' },
);

Now it’s time to finish the installation:

./install.pl etc/nfsen.conf

In case of success you’ll see corresponding notification after which you will have to start nfsen daemon to get the ball rolling:

/path/to/nfsen/bin/nfsen start

From this point nfdump started collecting netflow data exported by Cisco router and nfsen is hardly working to visualize it — just open web browser and go to http://linux_web_server/nfsen/nfsen.php to make sure. If you see empty graphs just wait for a while to let nfsen to collect enough data to visualize it.

That’s it!

pixelpoke.com — web hosting reviews

It is a pleasure to write reviews of quality, informative and well designed websites. Pixelpoke.com is one of such websites: it offers web hosting reviews in pretty easy way manner. If you plan to start your own website you need a host. If you need a host you should look through www.pixelpoke.com to make right decision and actually bring the website online.

Usually there are a lot of factors on which it depends what hosting company to choose and what service plan to select. If you plan to open your first website and do not wish to spend too much money to keep it online you just should read cheap hosting review on www.pixelpoke.com, that would definitely help you to create clear picture of what’s available on the market and what to choose from all those hosting providers. In contrast you may be experienced web administrator looking for powerful Linux hosting providing SSH access and rest advantages of Linux operating system, if this is so just take a look at hosting review at www.pixelpoke.com.

When trying to choose the best hosting for the website it is important to take into consideration all the factors e.g. positive and nagative reviews of certain hosting around the web, pros and cons of the hosting itself, quality of support, payment methods and so on. Why to invent the bicycle once again if you can just look through all the factors of certain web hosting provider at www.pixelpoke.com? I personally was surprised to find copy/paste of example discussions with support teams of each reviewed hosting providers — that’s really useful to get an initial view of quality of the support.

mp3-2000.com — free mp3 music downloads

Everyone needs to add more music to everyday life from time to time to get relax. I personally prefer to discover new music trends using websites for free music downloads, it’s one of the best ways to relax and forgot about all the problems (that’s besides biking of course). One of such websites is www.mp3-2000.com — now you can browse, search and download free and legal music easy way. Just in a few clicks.

How it works? www.mp3-2000.com manages the database of all the music that is available in Internet for free but legally. After many years of development and populating of the database this website stores massive array of free music downloads available for everyone.

Considering to buy some music albums from Amazon for $7.99 each? I would recommend to check www.mp3-2000.com as the chances to find those music in its database and then download them legally for free are pretty high. Search engine that is embedded into the website makes it possible to search the music by album, artist and song. While writing this review www.mp3-2000.com has indexed 1,502,301 songs!

The index page always shows 50 of the most popular songs so it is worth to be added to favorites :) It is also very important for me that there is no need to complete any registrations to download free music, I can just search what I need and then download mp3 for free.

The easiest way to split and merge pdf files in Ubuntu

The easiest way to split, merge or edit pdf files in Ubuntu is to use pdftk utility. This rather old (latest version was released in 2006) but still simple and powerful program can be installed in Ubuntu (Debian or any deb-family Linux distribution) by the following command in terminal:

sudo aptitude install pdftk
(if you run Fedora, RedHat or CentOS use this one: sudo yum install pdftk)

Split large pdf into many one-page files:

pdftk largepdfile.pdf burst

(as the result you will get many small files like pg_0001.pdf, pg_0002.pdf and so on).

Merge files into one PDF file:

pdftk *.pdf cat output onelargepdfile.pdf

pdftk is extremely powerful and makes it possible to do almost anything with input pdf files. Thus above two commands are just examples showing how to split and merge pdf files in Ubuntu easily.

Split huge files in Ubuntu or any other Linux distro

Recently I’ve bought WD TV media player for streaming full HD movies (primarily in 1080p resolution) to my home TV from external storage like usb HDD or ipod classic. You might already know that size of average HD movie rip is more than 4GB (e.g. full HD Avatar movie image is literally 21 GB mkv file) so it’s just impossible to store such huge files on any FAT32 formatted HDD or ipod. My ipod classic 160 GB is windows formatted so it uses FAT32 filesystem where maximum file size is 4 GB. As far as ipod cannot be formatted into ext3 but still be able to play music (just sweet dreams) I have to split huge files to 3.99GB parts and store them to my ipod for later reassemble. When it’s time to watch the some HD movie stored at ipod it’s required to assemble those 3.99 GB parts into one solid file, transfer it to media player and then actually watch the movie.

Rather long preface but solution is quite simple. If u run Ubuntu you can try lxsplit utility for breaking files into parts (binary packages for other Linux distributions as well as source code are available at lxsplit project’s homepage.):

sudo apt-get install lxsplit

In order to split some file in 3.99GB parts use the following command:

lxsplit -s /path/to/hugemoviefile.mkv 3999M

Depending on size of hugemoviefile.mkv you will get several parts hugemoviefile.mkv.001, hugemoviefile.mkv.002 and so on stored in current directory. It means that if you’re going to store those parts on some external storage like ipod you can do the following:

cd /media/ipod/
lxsplit -s /path/to/hugemoviefile.mkv 3999M

and hugemoviefile.mkv.001.. will saved in /media/ipod/ directory regardless where hugemoviefile.mkv is located.

Now coming to assembling procedure. It’s just as easy as splitting:

lxsplit -j hugemoviefile.mkv.001

Once done you will get hugemoviefile.mkv saved in current directory.

Have an interesting article? You’re welcome to contact me and get it published at LinuxScrew.com!




Pages: Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ...63 64 65 Next
Friendly Sites:Who is behind Linux Screw?
GeekyBits³ | Bash Cures Cancer | OMG! Ubuntu!
My SysAd Blog | Web Upd8
ZEPY | Linux config Wiki | Planet Sysadmin
a non-geek's linux notes | Linux Today
TuxArena: The arena of Tux | LinuxAlt.Com
My name is Artem N. (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››