2015/07/30

昨天下午17點多發生一台cisco不明原因的網路不通
早上去查了一下
找不到原因
只好把昨天早上的config 備份倒回去
說也奇怪 就正常了

到了今天中午
宿舍的4台cisco一起出問題
查了一下log如下
Jul 30 11:10:27 GMT+8: %ACL_ERRMSG-4-UNLOADED: 1 fed:  Output IP Vlan ACL on interface Vlan206 for label 3 on asic255 could not be programmed in hardware and traffic will be dropped.
Jul 30 11:10:27 GMT+8: %ACL_ERRMSG-4-UNLOADED: 1 fed:  Output IP Vlan ACL on interface Vlan207 for label 3 on asic255 could not be programmed in hardware and traffic will be dropped.
Jul 30 11:10:27 GMT+8: %ACL_ERRMSG-4-UNLOADED: 1 fed:  Output IP Vlan ACL on interface Vlan208 for label 3 on asic255 could not be programmed in hardware and traffic will be dropped.
Jul 30 11:10:27 GMT+8: %ACL_ERRMSG-4-UNLOADED: 1 fed:  Output IP Vlan ACL on interface Vlan209 for label 3 on asic255 could not be programmed in hardware and traffic will be dropped.
Jul 30 11:10:27 GMT+8: %ACL_ERRMSG-4-UNLOADED: 1 fed:  Output IP Vlan ACL on interface Vlan210 for label 3 on asic255 could not be programmed in hardware and traffic will be dropped.

詢問廠商後得到這樣的回答

原廠對3850/3650 ACL限制的說明,

ACL TCAM (TAQ)有2塊,分別為in與out,但VACL只能使用其中1塊.限制如下:

1.VACL  => 1.5K 筆 (最多,不分in,out)

2.MAC VACL => 單向460筆(in,out分開算)

3.IPv4 VACL  => 單向690筆(in,out分開算)

4.IPv4 PACL,RACL => 單向1380筆(in,out分開算)

5.MAC PACL,RACL =>單向690筆(in,out分開算)

6.IPv6 PACL,RACL =>單向690筆(in,out分開算)



VLAN Access Control List (VACL) − A VACL is an ACL that is applied to a VLAN. It can only be applied to a VLAN and no other type of interface. The security boundary is to permit or deny traffic that moves between VLANs and permit or deny traffic within a VLAN. The VLAN ACL is supported in hardware, and has no effect on the performance.

Port Access Control List (PACL) − A PACL is an ACL applied to a Layer 2 switchport interface. The security boundary is to permit or deny traffic within a VLAN. The PACL is supported in hardware and has no effect on the performance.

Router ACL (RACL) − An RACL is an ACL that is applied to an interface that has a Layer 3 address assigned to it. It can be applied to any port that has an IP address such as routed interfaces, loopback interfaces, and VLAN interfaces. The security boundary is to permit or deny traffic that moves between subnets or n

意思就是說當acl下超過690條後 机器就會不正常了
XD
cisco吔

為什麼以前都沒發生過咧

不知是因為最近snort升到 2.9.7.5 所以 port scan變的比較敏感
還是port scan真的變多了

反正先改了一下程式
要block的ip直接下到fortiget而不先進LP了
看來也沒啥好方法可以處理了

2015/07/28

如何設定proxmox guest的HA
做個記錄

guest file一定要放在share storage上

datacenter - HA - Add - HA managed VM/CT
輸入vmid









在想要執行HA的node上啟動 RGmanager











https://www.youtube.com/watch?v=rQ3PEfFC7lk

比vmware或hyper-v 方便多了

2015/07/22

雖然網路上已經有很多關於使用ssh不用打密碼的教學文章
還是稍微記一下好了

先在client和server使用者的home目錄下建立.ssh的目錄

在client的机器中執行以下指令

ssh-keygen -t rsa 或 ssh-keygen -t dsa

dsa rsa 是二種不同的加密方式 就看要選擇那一種

之後按個几次enter

會在.ssh這個目錄內產生一對檔案
id_dsa  
id_dsa.pub  
id_rsa  
id_rsa.pub

接下來把.pub那個檔案傳到要連線的server上
scp id_rsa.pub server_ip:~/.ssh/

再連到server上執行
cat .ssh/id_rsa.pub >> .ssh/authorized_keys

exit後再次連到server就無需再打密碼了

若有很多的client端key要放到server上
只要把pub檔附加到authorized_keys即可
cat .ssh/id_rsa.pub >> .ssh/authorized_keys

server端 修改  /etc/ssh/sshd_config

PasswordAuthentication no
PubkeyAuthentication yes


如果要開放 root login

PermitRootLogin prohibit-password

改為:

PermitRootLogin yes


某些os可能不接受dsa的key而無法登入 此時就要換用rsa


2015/07/21

2015/7/19 cacti為了解決script output的問題 更新到 0.8.8f
不用想 也知道又出問題了
這次是在升級時就出現空白畫面
XD
不過這次修正的還算滿快的
今天早上升完了
再觀察看看有沒問題

2015/07/15

又到了每半年一次要使用openvas的時間
果不其然 又出問題了
決定以後要用再下vm 回來就好了
不想再裝了
vm使用的是debian
跑在virtualbox上還ok

跑完後因為報表只需要High跟Medium
所以在用ip sort後要再改 levels=hm 才符合需求

整個filter的條件如下

sort=host first=1 result_hosts_only=1 min_cvss_base= min_qod= levels=hm autofp=0 notes=1 overrides=1 rows=100 delta_states=gn
最近每次升級cacti都有問題
升到 0.8.8e 後原本正常的script output 竟然有個值不見了














到forum看看 已經有人反應了
http://forums.cacti.net/viewtopic.php?f=21&t=54856
只能再等了
無言

2015/07/07

今天接到一個工作
要把snort裡的資料匯出成文字檔給外面的單位
因為BASE沒辦法一次全部匯出
所以要自己寫sql了

select event.cid,signature,sig_name,inet_ntoa(iphdr.ip_src),inet_ntoa(iphdr.ip_dst),timestamp from iphdr,event,signature where event.signature=signature.sig_id and event.cid=iphdr.cid into outfile '/tmp/sqloutput.txt';


http://www.andrew.cmu.edu/user/rdanyliw/snort/acid_db_er_v102.html
http://sgros.blogspot.tw/2012/07/querying-snort-sql-database.html
http://note.tc.edu.tw/670.html

2015/07/05

google drive 一直未推出for linux的版本
因此使用了 grive grive-tools
安裝方式如下

sudo add-apt-repository ppa:nilarimogard/webupd8

sudo add-apt-repository ppa:thefanclub/grive-tools

sudo apt-get update

sudo apt-get install grive-tools grive


已知問題

無法挑選那些目錄不要同步
同步的功能怪怪的

2015/06/30

brocade fws 624 密碼忘記時的處理方法

Recover from a lost password.
1. Start a CLI session over the serial interface to the Brocade device.
2. Reboot the device.
3. While the system is booting, before the initial system prompt appears, enter b to enter the boot
monitor mode.
4. Enter no password at the prompt. (You cannot abbreviate this command.)
5. Enter boot system flash primary at the prompt. This command causes the device to bypass the
system password check.
After the console prompt reappears, assign a new password

2015/06/29

user打電話來說要上雲科填報資料要求要有一個固定ip
在ascenlink上有二個地方要設
一個是自動路由





一個是網址轉譯

2015/06/28

最近想在8G的硬碟上裝linux mint
但安裝時會出現










說hd不夠大
為了解決這個問題找了一下資料
也不難處理

修改 /usr/lib/ubiquity/ubiquity/misc.py

    min_disk_size = size * 2 # fudge factor.

    min_disk_size = size * 1.1 # fudge factor.

再執行installer就ok了

http://forums.linuxmint.com/viewtopic.php?f=46&t=182642

2015/06/26

好像愈來愈多人設定forword來把信轉到gmail去
導致因為信件量太多而被google擋了
一直出現

Jun 26 13:43:11 mail postfix/smtp[19923]: 4BB3B9E0624: lost connection with ALT1.ASPMX.L.GOOGLE.COM[64.233.168.26] while receiving the initial server greeting
Jun 26 13:43:13 mail postfix/smtp[19922]: 743E79E058A: lost connection with alt2.gmail-smtp-in.l.google.com[64.233.168.27] while receiving the initial server greeting

除了要求user不要再轉信而用pop3來收信外
想不出來有什麼方式可以解決了

查了一下google有提供轉發的服務
https://support.google.com/a/answer/2956491?hl=zh-Hant

再想看看要不要用

2015/06/19

after cacti upgrade to 0.8.8d
zoom not working
Orz
wait for some days
someone find the problem and solved

download jquery-ui.js from https://jqueryui.com/download/
and put it into  /cacti/include/js/

jquery-ui.js is missing from Cacti 0.8.8d tar.gz package.

This library is needed by jquery-zoom plugin.

This is the script load header from default cacti tree view :

<script type="text/javascript" src="/cacti/include/layout.js"></script>
<script type="text/javascript" src="/cacti/include/js/jquery.js" language="javascript"></script>
<script type="text/javascript" src="/cacti/include/js/jquery-ui.js" language="javascript"></script>
<script type="text/javascript" src="/cacti/include/js/jquery.cookie.js" language="javascript"></script>
<script type="text/javascript" src="/cacti/include/js/jstree.js"></script>
<script type="text/javascript" src="/cacti/include/js/jquery.zoom.js" language="javascript"></script>
<script type="text/javascript" src="/cacti/include/jscalendar/calendar.js"></script>
<script type="text/javascript" src="/cacti/include/jscalendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="/cacti/include/jscalendar/calendar-setup.js"></script>

http://forums.cacti.net/viewtopic.php?f=21&t=54754

2015/06/03

2015/06/02

昨天晚上跳電
今天早上有一個aruba ap105 ping不到
重開poe switch也沒用
下午拿著injector去想說先試試
想不到竟然好了
再接回去原本的switch原本的port
也正常了

無言 =_=

2015/05/17

ubuntu 目前預設都是使用unity 3d為預設桌面環境
但在顯示效能比較差的電腦上總是會有點lag的情況
若要轉回舊版桌面
要安裝
gnome-session-flashback
安裝後登出
在重新登入前按登入區塊右上角的ubuntu圖示就可以選擇不同的桌面環境
在此選擇 gnome flash back(metacity) 登入
若要在桌面上建立捷徑
在 /home/user/桌面 裡建立以下檔案 以terminator為例

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[zh_TW]=/home/user/icon/terminator_7302.png
Name[zh_TW]=terminator
Exec=/usr/share/terminator/terminator
Name=terminator
Icon=/home/user/icon/terminator_7302.png

若要再建立新的捷徑
只要複制檔案 再修改紅色地方即可 icon 要手動找一下

2015/05/16

家裡使用的isp又把ip換了
之前是都打電話去叫他再把ip換回來
不過不想再打了
以後想直接使用kvm(在ubuntu上)
記錄一下kvm的使用方式
安裝完最新版的java後
用firefox打開kvm的ip(不能使用chrome)
登入後
點下kvm會話
選擇java安裝目錄bin裡的
javaws這個檔案來執行即可

avocent適用

必需使用kvm的工具列調整
把以下圖片所示的地方打勾
否則會有按一次鍵輸入二個字的情況發生


2015/05/15

5/13psad又有更新版本
上次2.4版時更新就有問題了
所以沒更新
今天想說再試看看
結果用tar.gz更新還是有問題
想說有提供rpm
所以重裝一台好了
放在centos7 x64上

使用rpm裝完沒問題
但systemctl start psad會起不來

journalctl -xn
找一下停在什麼地方
要補什麼東東

還要再加裝的有

perl-Data-Dumper.x86_64
psmisc.x86_64
mailx
iptables-devel.x86_64
perl-ExtUtils-MakeMaker.noarch
perl-NetAddr-IP.x86_64
perl-Date-Calc.noarch
perl-Sys-Syslog.x86_64
gcc
ntpdate
ftp

另外有几個沒有rpm
IPTables-ChainMgr-1.3
IPTables-Parse-1.4
Unix-Syslog-1.1
使用
perl Makefile.PL
make
make install
手動做

如果有缺什麼再補一下吧

log的格式沒有變
所以程式不用修改
最後把這個ip 在 firewall 完全開放
大家來攻吧!

ps
除了改/etc/psad/psad.conf外
記得在/etc/psad/auto_dl
加上內部的ip
不然log會收不完

2015/05/09

自從之前換isp升速後
發珼舊的ap及無線網卡沒法達到isp給的速度
所以買了新的ap (tp-link tl-wr740n)及asus n10 nano usb無線網卡
但因為使用原廠提供的linux driver一直無法使用
所以使用ndiswrapper掛載windows的driver來使用
但一直有動不動就斷線的困擾
今天再去查了一下
找到了一個方法

sudo apt-get install git
git clone https://github.com/pvaret/rtl8192cu-fixes.git
cd rtl8192cu-fixes
make
sudo make install
sudo modprobe 8192cu

使用改過的driver來編譯使用
目前還沒有問題
再試几天看看吧

2015/05/08

在 mail server的log裡發現

postfix/smtp[1921]: 347A79E0739: to=<abc@gmail.com>, orig_to=<abc@bbb.edu.tw>, relay=alt1.gmail-smtp-in.l.google.com[74.125.25.27]:25, delay=239783, delays=239779/0.04/2.6/0.84, dsn=4.7.0, status=deferred (host alt1.gmail-smtp-in.l.google.com[74.125.25.27] said: 421-4.7.0 [2.3.4.5      15] Our system has detected an unusual rate of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0 rate limited. Please visit 421-4.7.0 http://www.google.com/mail/help/bulk_mail.html to review our Bulk 421 4.7.0 Email Senders Guidelines. d5si4976585pdi.47 - gsmtp (in reply to end of DATA command))

被google擋信了
查了一下google的網頁說明
有三個方式可以處理
最方便的是在DNS設定spf

;spf for google
bbb.edu.tw.  3600  IN   TXT   "v=spf1 ip4:2.3.4.5 include:_spf.google.com ~all"

設定後重啟DNS
等cache更新後就ok了