2013/06/24

centos 6 設定 netflowanalyzer

1812Jの監視のため無料版をインストール

・Netflow Analyzer
NetFlow Analyzerを登録してダウンロード
http://www.manageengine.jp/products/NetFlow_Analyzer/ 
NetFlow Analyzerをインストール
#mv ./ManageEngine_NetFlowAnalyzer_9800_64bit.bin /usr/loca/bin/
#cd /usr/local/bin
#chmod +x ManageEngine_NetFlowAnalyzer_9800_64bit.bin
#./ManageEngine_NetFlowAnalyzer_9800_64bit.bin 
ウィザードに従って進めていく(E-mailは必須)
起動確認
#cd /opt/ManageEngine/NetFlow/bin
#./run.sh
サービス登録
#./linkAsService.sh
#/etc/rc.d/init.d/netflowanalyzer start
iptablesの設定
TCP:9996,8080 UDP:9996
webブラウザから、http://localhost:8080へアクセス
パスワードを変更する
・1812J側の設定
Dialer1のinterfaceを有効
1812J(config)#interface Dialer 1
1812J(config-if)#ip route-cache flow
1812J(config-if)#ip flow ingress
1812J(config-if)#ip flow egress
Fa1のinterfaceを有効
1812J(config)#interface fastEthernet 1
1812J(config-if)#ip route-cache flow
1812J(config-if)#ip flow ingress
1812J(config-if)#ip flow egress
送信元インターフェース設定
1812J(config)#ip flow-export source FastEthernet1送信先のnetflowanalyzerのIPとポートを指定
1812J(config)#ip flow-export destination 192.168.1.XXX 9996netflowのバージョンを指定
1812J(config)#ip flow-export version 5長時間のフローを1分刻みに分割する
1812J(config)#ip flow-cache timeout active 1
インターフェース名が正しく表示される様にsnmpを指定する
1812J(config)#snmp-server ifindex persist
1812J(config)#snmp-server community public RO
グラフに表示される□□□を日本語に表示させる
# cd /opt/ManageEngine/NetFlow/jre/lib/fonts/
# mkdir fallback/
# cd fallback/
# ln -s /usr/share/fonts/vlgothic/VL-Gothic-Regular.ttf ./

2013/06/23

centos 6 設定 zabbix-server agent

環境:CentOS 6.4 ×86_64
参考:http://kodai74.blogspot.jp/2013/03/zabbix.html
zabbix SIAからインストール
・zabbix-serverインストール
#rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-release-2.0-1.el6.noarch.rpm#yum install zabbix-agent zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese
#yum install mysql-server#vi /etc/my.cnf  以下5つを[mysqld]以下に追加
[mysqld]
innodb_file_per_table
innodb_buffer_pool_size=512M
innodb_log_file_size=64M
default-character-set = utf8
skip-character-set-client-handshake
#service mysqld start
#mysqld -u root
mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by ‘パスワード’;
mysql>exit
# mysql -u root zabbix < /usr/share/doc/zabbix-server-mysql-2.0.6/create/schema.sql
# mysql -u root zabbix < /usr/share/doc/zabbix-server-mysql-2.0.6/create/images.sql
# mysql -u root zabbix < /usr/share/doc/zabbix-server-mysql-2.0.6/create/data.sql 
#vi /etc/zabbix/zabbix_server.conf
DBPassword=パスワード
#service zabbix-server start
#service zabbix-agent  start 
#vi /etc/httpd/conf.d/zabbix.conf  コメント外してAsia/Tokyoに変更
php_value date.timezone Asia/Tokyo
# service httpd start 
Webブラウザからhttp://localhost/zabbixへアクセス
ウィザードにしたがって進めていく
Sign in  ->  Username:admin Password:zabbix
Profileからパスワードと言語を変更する 
あとはzabbix-serverをweb上で有効にして監視開始。

centos 6 設定 ssh iptables selinux

環境:CentOS6.4 ×86_64
SSH
sshのポート番号変更とPassword認証不可とRootlogin不可に設定
#vi /etc/ssh/sshd_configPort 22 -> Port 任意の番号(10022)
PasswordAuthentication yes -> no
PermitRootLogin no -> yes
#service sshd restart
authorized_keysを設定
$mkdir .ssh
$chmod 700 .ssh
$vi .ssh/authorized_keys

クライアントで作成したid_rsa.pubを転送して中身をコピペ
$chmod 600 .ssh/authorized_keys
 
iptables
iptablesを設定
#vi iptables-set.sh#!/bin/bash
# フィルタリングルールを消去する
/sbin/iptables -F
# デフォルトポリシーを設定(最初にすべてのポリシーをDROPに設定)
/sbin/iptables -P INPUT DROP
/sbin/iptables -P FORWARD DROP
/sbin/iptables -P OUTPUT DROP
# ループバックを許可する
/sbin/iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
/sbin/iptables -A OUTPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
# プライベートアドレスが使われているパケットを破棄
/sbin/iptables -A INPUT -i eth0 -s 10.0.0.0/8 -j DROP
/sbin/iptables -A INPUT -i eth0 -d 10.0.0.0/8 -j DROP
/sbin/iptables -A INPUT -i eth0 -s 172.16.0.0/12 -j DROP
/sbin/iptables -A INPUT -i eth0 -d 172.16.0.0/12 -j DROP
# 基本サービスを許可, SSH
/sbin/iptables -A INPUT -p tcp -m state –state NEW -m tcp –dport 10022 -j ACCEPT
# すでにコネクションを確立しているものは許可
/sbin/iptables -A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT
# Ping of Death対策
/sbin/iptables -A INPUT -p icmp –icmp-type echo-request -m limit –limit 1/s -j ACCEPT
# 外への接続は全て許可
/sbin/iptables -P OUTPUT ACCEPT
# 保存 + iptables再起動
/etc/init.d/iptables save
/etc/init.d/iptables restart
# 設定が適用されているか確認
/sbin/iptables -L
iptablesの確認
#iptables -L Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all — localhost localhost
DROP all — 10.0.0.0/8 anywhere
DROP all — anywhere 10.0.0.0/8
DROP all — 172.16.0.0/12 anywhere
DROP all — anywhere 172.16.0.0/12
ACCEPT tcp — anywhere anywhere state NEW tcp dpt:10022
ACCEPT all — anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp — anywhere anywhere icmp echo-request limit: avg 1/sec burst 5
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all — localhost localhost
iptablesのfilterテーブルは、
chainがINPUT,OUTPUT,FORWARDの3つあって
それぞれに全体のポリシー(ACCEPT/DROP)を指定して
必要があれば個別にACCEPT/DROPをする。 

selinux
一時設定(Enforcing:有効/Permissive:警告のみ/disabled:無効)
#getenforce
Enforcing
#setenforce 0
# getenforce

Permissive
設定
# vi /etc/selinux/config
SELINUX=disabled

L2TP/IPSEC-VPN IX2025 リモートアクセス.

リモートアクセス VPN テスト シナリオ 想定1:インターネット VPN を使用したリモートアクセス VPN 想定2: VPN 構築後に iphone からインターネットに接続する 機器: NEC  IX2025(8.11.11) と iphone 目標1: LTE 通信の i...