2013年1月3日 星期四

Extreme 教學

限制 telent access:
#edit policy mytelnet.pol
entry Telnet_Allow {
if match any {
        source-address 192.168.1.0 /24;
        source-address 192.168.2.0 /24;
                } then {
                        permit;
}
}

# configure telnet access-profile mytelnet

若 source-address 有變動執行
# refresh policy "mytelnet"





IP-MAC blind:
add:
#configure iparp add 123.123.123.123 vr VR-Default 00:11:22:33:44:55
del
#configure iparp delete 123.123.123.123 vr VR-Default 00:11:22:33:44:55

設定檔備份:
#upload configuration 123.123.123.123 backupFileName vr "VR-Default"


清除 trial-license:

enable trial-license
#debug epm enable trial-license
remove trial-license
#debug epm clear trial

回覆出廠預設值:
#unconfigure  switch all

另外一個方法
使用console連線

1. 重開機出現Running POST的時候按住空白鍵。
2. POST完成之後會進入boot rom模式。 
3. 在提示符號下輸入: 
#Config abc  (abc指的是隨便一個檔名,目的在使系統找不到檔案後開機時load default) 
4. 輸入Boot後按enter。 
系統重開之後就回預設值,所有的設定都會不見。 


LACP:

8810 config
enable sharing 2:47 grouping 2:47-48 algorithm address-based L2
第一個「2:47」為主要port,後面的「2:47-48」為群組。

X450 config
enable sharing 23 grouping 23-24 algorithm address-based L2 lacp

查看
show lacp lag 1

解除設定
disable sharing 2:47

備份、升級韌體
download image [<hostname> | <ipaddress>] <filename> {primary | secondary}
upload image [<hostname> | <ipaddress>] <filename> {primary | secondary}
use image [primary | secondary]


2012年10月3日 星期三

FreeBSD 指令

Ports tree更新指令:
#portsnap fetch update



更新

# freebsd-update fetch
# freebsd-update install

2012年8月30日 星期四

更改 Fortigate 620B Policy session-TTL

在 CLI  輸入:
config firewall policy
edit policy_id
set session-ttl (300-604800)
end


查看
diagnose sys session ttl        查看全部配置
show firewall policy policy_id   查看 policy 配置

2012年8月9日 星期四

BL460c ILO2 錯誤訊息

最近機房的 HP BL460c 莫名其妙出現了下面訊息

"An ILO2 Failure has been detected. Make sure you have a suitable iLO2 firmware loaded (must be at least iLO2 1.30)"

印象中去年是四刀 HP BL460c 輪流出現,而且確認 iLO2 韌體版本都是在 1.30 以上,換了一片 OA 之後就好了,沒想到過了半年又出現這訊息....囧。

目前解法就是重新啟動 OA 或者是 iLO ,二選一。

Reset iLo 頁面如下:



重新啟動 OA 方法就是直接熱拔插那片 OA 。

2012年7月30日 星期一

Install SNMP on Centos

# yum -y install net-snmp net-snmp-utils

#vi /etc/snmp/snmpd.conf
# com2sec notConfigUser default public
# group notConfigGroup v1 notConfigUser
# group notConfigGroup v2c notConfigUser
# 再加入 group 存取設定
com2sec local localhost public
com2sec mynetwork xxx.xxx.xxx.0/24 public
group MyRWGroup any local
group MyROGroup any mynetwork
找以下設定取消註解#
view all included .1 80
access MyROGroup "" any noauth 0 all none none
access MyRWGroup "" any noauth 0 all all all
disk / 10000
# chkconfig snmpd on
# service snmpd start

2012年4月23日 星期一

用 simpleSAMLphp 實現 Google Apps 單一簽入

1. 安裝 simpleSAMLphp 1.8 於 /var/www/ simplesaml 底下
2. Edit apache 設定,增加 

Alias /sso /var/www/simplesaml/www


安裝如果正常可連結至 http://xxx.edu.tw/sso 看到以下畫面








3.Edit config.php 

#vi config/config.php
21 行
'baseurlpath'           => 'sso/',
60 行

 'auth.adminpassword'            => 'yourpassword',
72 行
使用 tr -c -d '0123456789abcdefghijklmnopqrstuvwxyz' </dev/urandom | dd bs=32 count=1 2>/dev/null;echo 產生


'secretsalt' => ' yourcode',
79 行
'technicalcontact_name'     => 'Admin',
'technicalcontact_email'    => 'admin@xxx.edu.tw',
89 行
 'timezone' => 'Asia/Taipei',

141 行

'enable.saml20-idp' => true, 

212 行
language.default'              => 'zh-tw',

4. 設定 SSL key
#openssl genrsa -des3 -out googleappsidp.key 1024 
#openssl rsa -in googleappsidp.key -out googleappsidp.pem 
#openssl req -new -key googleappsidp.key -out googleappsidp.csr 
#openssl x509 -req -days 9999 -in googleappsidp.csr -signkey googleappsidp.key -out googleappsidp.crt

then, copy key to /simplesaml/cert

5. 設定認證來源

#touch modules/ldap/enable
# vi config/authsources.php 182 行開始
        'example-ldap' => array(
                'ldap:LDAP',

                'hostname' => '123.123.123.123',
                'enable_tls' => FALSE,
                'debug' => FALSE,
                'timeout' => 0,
                'attributes' => NULL,
                'dnpattern' => 'uid=%username%',
                'search.enable' => TRUE,
                'search.base' => 'o=users',
                'search.attributes' => array('uid', 'mail','Password','givenName'),
                'search.username' => 'cn=manage,o=domain',
                'search.password' => 'youradminpassword',
                'priv.read' => FALSE,
                'priv.username' => NULL,
                'priv.password' => NULL,

        ),

6.設定 metadata for an SAML 2.0 IdP
#vi metadata/saml20-idp-hosted.php
17 行
        'privatekey' => 'googleappsidp.pem',
        'certificate' => 'googleappsidp.crt',
24 行
        'auth' => 'example-ldap',

7.設定 metadata for an SAML 2.0 IdP
#vi metadata/saml20-sp-remote.php
22 行
$metadata['google.com/a/xxx.edu.tw'] = array(
        'AssertionConsumerService' => 'https://www.google.com/a/xxx.edu.tw/acs',
        'NameIDFormat' => 'urn:oasis:names:tc:SAML:2.0:nameid-format:email',
        'simplesaml.nameidattribute' => 'uid',
        'simplesaml.attributes' => FALSE,


8. 設定 Google apps single sign-on (SSO)
登入網頁 
http://xxx.edu.tw/sso/saml2/idp/SSOService.php
登出網頁 
http://xxx.edu.tw/sso/saml2/idp/initSLO.php?RelayState=/simplesaml/logout.php
變更密碼改為貴單位 LDAP 更改密碼頁面
上傳憑證 googleappsidp.crt 

9.測試登入頁面
http://mail.google.com/a/yourgoogleappsdomain.com

10.強烈建議網頁使用 SSL 

2012年4月18日 星期三

FortiOS 4.0MR3 使用 eDirectory(OpenLDAP) 做群組認證


USER -> Remote ->LDAP




User -> UserGroup

輸入 LDAP 上的 group 的值




use CLI console Set Group
FGT# config user ldap
FGT# (ldap) # edit admin_LDAP
FGT# (ldap) # member-attr groupMembership //this is for Windows and Open LDAP, groupMembership for eDirectory
FGT# (ldap) # end

然後在輸入下列指令查看是否寫入
FGT# config user ldap