Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux基礎知識

用 ntop 監控主機網路流量:安裝、設定與安全提醒

1. 安裝

rpm -ivh ntop-3.2-1.el4.rf.i386.rpm

2. 建立日誌目錄與帳號

mkdir /var/log/ntop/
useradd -g ntop -s /bin/true -M ntop

3. 首次啟動(需 root)設定管理密碼

/usr/bin/ntop -P /usr/share/ntop -u ntop -A
  • -P [dir]:指定 db 檔存放路徑
  • -u [user]:指定以哪個使用者身分執行服務
  • -A:設定 admin 密碼(ntop 內建 admin 管理者帳號)

4. 參考首次啟動說明

less /usr/share/doc/ntop-3.0/1STRUN.txt

5. 編輯 /etc/ntop.conf

--interface eth0,lo
#--no-Mac
--local-subnets 192.168.10.0/24
--http-server 3000
--db-file-path /usr/share/ntop
--daemon
--user ntop
--trace-level 3
--disable-schedule

--local-subnets 若是在路由器或閘道上跑,請改成自己的網段;單機測試可省略。

6. 啟動

/etc/init.d/ntop start     # 或 ntop -i eth0

7. 查看流量

https://localhost:3000/

8. 停止

/etc/init.d/ntop stop

部署位置與安全

ntop 架在 hub 環境下能看到網路上所有封包;架在 switch 上則除非開放 SPAN(鏡像埠),否則只看得到送給自己的封包。

由於 ntop 會監聽連接埠,強烈建議用 iptables 限制可存取的來源 IP,否則等於把整段網路流量分析結果攤在網路上,是明確的安全風險。有興趣可再研究它的外掛模組以擴充功能。

Copyright © Linux教程網 All Rights Reserved