Halaman

Kamis, 31 Juli 2014

How to Configure TFTPD

How to setup TFTP server on Debian

Step 1: Installation of tftpd package (server) and client
aptitude install tftpd
aptitude install tftp

Step 2: Creating Directory and setting permission
mkdir /tftpboot
chmod 777 /tftpboot
chown imran.imran /tftpboot

Step 3: Checking and editing(if required) the /etc/inetd.conf
Correct the location of director from /srv/tftp to /tftpboot

tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot

Don't forget to restart.
It is is tricky to restart the tftpd, you have to restart inetd, but in Debian it is openbsd-inetd
cd /etc/init.d
./openbsd-inetd restart

Step 4: Testing
Type following
tftp 127.0.0.1
tftp>

Step 5: Security

you can edit /etc/hosts.allow and /etc/hosts.deny for restriction.

That's it.

Further doc

http://www.debianhelp.co.uk/tftp.htm
http://www.onlamp.com/pub/a/bsd/2003/06/05/FreeBSD_Basics.htm

Indo Doc

http://blog.ub.ac.id/hnachan/2010/12/08/protokol-tftp-trivial-file-transfer-protocol/
http://www.php.indah.web.id/2012/03/inetd-xinetd-daemon-socket-jaringan.html

Make TFTP

TFTP (Trivial File Transfer Protocol), a simple form of the File Transfer Protocol (FTP). TFTP uses the User Datagram Protocol (UDP)and provides no security features. It is often used by servers to boot diskless workstations, X-terminals, and to backup routers configurations files.

To install it in Debian or ubuntu:

#apt-get install tftpd tftp
edit /etc/xinetd.d/tftp file, if file doesnt exist create one.
service tftp

{

disable = no

socket_type = dgram

protocol = udp

wait = yes

user = root

server = /usr/sbin/in.tftpd

server_args = -s /tftpboot

per_source = 11

cps = 100 2

flags = IPv4

}
Create a directory called tftpboot in root
#mkdir /tftpboot
Change mode of the directory
#chmod 777 tftpboot
Restart xnetd
#/etc/inid.d/xinetd restart
Now test your connections
#tftp 192.168.10.10
Telnet to your cisco router and start backing up your configuration files.

Reference :
http://shirwa.wordpress.com/2007/11/15/backing-cisco-configuration-file-using-tftpd-in-linux/
http://linux.die.net/man/8/tftpd
http://www.tek-tips.com/viewthread.cfm?qid=532990
http://superuser.com/questions/670503/cant-create-new-files-on-tftp-server

Kamis, 24 Juli 2014

RSYSLOG with Cisco router

To setup RSYSLOG with Cisco router, we need to first install the packet on the linux by entering apt-get install rsyslog.
After installing the package, we will then proceed to configure the configuration by opening /etc/rsyslog.conf.
Uncomment # provides UDP syslog reception $ModLoad imudp $UDPServerRun 514 and then add local7.*   /var/log/cisco to the configuration.
Lastly, add $AllowedSender UDP, 127.0.0.1, (ip address) to the end of the configuration file. Restart the service by service rsyslog restart. Create the log file in /var/log/ by entering touch cisco.

For the router, enable logging by entering logging host (linux ip address) sequence-num-session in the global configuration mode.sequence- num-session (Optional) Includes a session sequence number tag in the syslog message. logging trap (1-7) to filter out the priority of the logs.
Generate some logging traffic and verify if the logging is sucessful or not by opening the log file created in /var/log/cisco.
Cisco log reference : http://www.cisco.com/c/en/us/td/docs/ios/netmgmt/command/reference/nm_book/nm_09.html#wp1082864

Jumat, 11 Juli 2014

Installing Nagios Core monitoring system (client and server)


The monitoring server
1. Install Nagios Core and dependancies
apt-get install nagios3 nagios-nrpe-plugin

2. Create the admin user
htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin

3. Create a host to monitor (pico /etc/nagios3/conf.d/server1.cfg)
define host {
use generic-host
host_name server1
alias server1
address 192.168.1.3
}
define service {
use generic-service
host_name server1
service_description Disk Space
check_command check_all_disks!20%!10%
}
define service {
use generic-service
host_name server1
service_description Current Users
check_command check_users!20!50
}
define service {
use generic-service
host_name server1
service_description Total Processes
check_command check_procs!250!400
}
define service {
use generic-service
host_name server1
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0!4.0
}

Replace server1 with the actual hostname of the server being monitored and the IP address to correct one.
This configuration will allow you to monitor the disk usage, active users, number of processes and the cpu load of a single server. Configuring host groups and other services are outside the scope of this article.
4. Restart Nagios
/etc/init.d/nagios3 restart

4. Enter the webadmin by opening this location in a web browser: http://yourserver/nagios3
Clients monitored by the monitoring server
1. Install the Nagios NRPE (Nagios Remote Plugin Executor)
apt-get install nagios-nrpe-server

2. Allow the monitoring server to connect to this NRPE (pico /etc/nagios/nrpe.cfg)
allowed_hosts=192.168.1.2

Replace 192.168.1.2 with the IP address of the monitoring server.
NRPE listens for connections on TCP port 5666 so make sure your firewall allows connections to that port from the monitoring server.
3. Restart NRPE
/etc/init.d/nagios-nrpe-server restart

Source : http://www.debiantutorials.com/installing-nagios-core-monitoring-system-client-and-server/

Simple SNMPD Server Configuration

apt-get install snmp snmpd
 

pico /etc/snmp/snmpd.conf

agentAddress udp:161,udp6:[::1]:161
rocommunity linux

sysLocation    cyber_building_indonesia
sysContact     nasohi@ciptandani.net


/etc/init.d/snmpd restart


snmpwalk localhost -c linux -v1

Referensi :
http://www.debianhelp.co.uk/snmp.htm
https://wiki.debian.org/SNMP
http://www.laub-home.de/wiki/SNMP_Installation_und_Konfiguration_%28Debian/Ubuntu%29