Tladi Domain Services Contact Us | Customer Login

Domain Registration

 


Posts Tagged ‘howto’

HOWTO: CentOS: vnstat

Saturday, November 7th, 2009

Vnstat is a useful tool for keeping an eye on your bandwidth usage. This utility doesn’t require any special type of access to your ethernet interfaces either, as it reads all of its data from the /proc filesystem.

At the time of writing, vnstat is not available in the native CentOS repositories, so installation requires downloading, compiling and installing the application from source.

The following steps will walk you through that:

1.) Get the source:
cd /usr/local/src
wget http://humdi.net/vnstat/vnstat-1.9.tar.gz

2.) Unpack it:
tar -zxf vnstat-1.9.tar.gz

3.) Build it:
cd vnstat-1.9
make
make install

4.) Test compatibility with your current kernel:
vnstat --testkernel

5.) See your available interfaces:
vnstat --iflist

6.) Initialise the databases for the interfaces you wish to monitor:
vnstat -u -i eth0

7.) Install the start up script:
cp examples/init.d/centos/vnstat /etc/init.d/

8.) Set the start up script runlevels:
chkconfig --levels 2345 vnstat on

9.) Start the vnstat daemon:
/etc/init.d/vnstat start

That’s all there is to it. Now you can keep an eye on your bandwidth usage. e.g. set up a simple script run via cron to email you your stats each day.

HOWTO: CentOS: Multiple IP’s

Friday, October 23rd, 2009

It’s simple really.
Create a file /etc/sysconfig/network-scripts/ifcfg-eth0:0 [eth1:x for 2nd interface etc.] containing:


DEVICE=eth0:0
ONPARENT=yes
IPADDR=192.168.1.1
BROADCAST=192.168.1.255
NETMASK=255.255.255.0
NETWORK=192.168.1.0

Manipulating the interface manually:
Bring it up: /sbin/ifup eth0:0
Take it down: /sbin/ifdown eth0:0

The ONPARENT option will automatically bring it up and down in conjunction with the parent interface eth0.
To remove automatic behaviour, just delete or move the file away somewhere else.



Terms of Service | Privacy Policy
(c) Copyright 2008-2009 Tladi Domain Services.