顯示具有 ipcop 標籤的文章。 顯示所有文章
顯示具有 ipcop 標籤的文章。 顯示所有文章

2013年6月7日 星期五

IPCOP 監看各IP流量

不管是 IPCOP 1.4 or 2 都可以用 iftop 這個 console command來即時監測網路流量。

  1. 先從 IPCOP web 界面啟用 ssh ,注意IPCOP ver 1.4 和 ver 2 預設的ssh port不同。
  2. 利用 putty (Win) 或 ssh 連上 IPCOP root
  3. 在IPCOP console上面執行 iftop -nN 就可以即時監控頻寬用量。

部份參數說明:
-n   不解析主機名稱,只顯示 IP
-N  不解析服務名稱,只顯示 port 號碼
-B  以 bytes/sec 顯示單位 (預設是 bits/sec)
-i interface                Listen to packets on interface.


附記:
在Centos 5.x 上面安裝 iftop

rpm -Uvh http://mirror01.idc.hinet.net/EPEL/5Server/x86_64/epel-release-5-4.noarch.rpm

yum install iftop

2013年1月31日 星期四

IPCOP 2 SNAT manual config

Add
/sbin/iptables -t nat -A CUSTOMPOSTROUTING -s 10.x.y.z -j SNAT --to-source 67.x.y.z
in /etc/rc.d/rc.firewall.local 

under : 

start)
    ## add your 'start' rules here
    ## SNAT for custom config
 /sbin/iptables -t nat -A CUSTOMPOSTROUTING -s 192.168.x.y -j SNAT --to-source 123.234.x.y


then run 
/etc/rc.d/rc.firewall.local

Next time you reboot IPCOP, this rc.firewall.local will also applied automatically.