標籤:blank 伺服器 setting system target
概述
CITRIX NETSCALER常用的功能有:LB,CS,GSLB,SSL。LB實現的功能是伺服器負載平衡,CS實現基於七層(網域名稱,IP等)的負載平衡,GSLB實現的功能是全域負載平衡,SSL實現的功能是SSL加速。
配置步驟 系統配置 配置feature
進入system菜單,選擇setting
650) this.width=650;" title="clip_image002" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image002" src="http://s3.51cto.com/wyfs02/M01/53/A7/wKiom1RstFezK5k5AADbY8i4jZY630.jpg" "557" height="222" />
點擊 basic feature,選中一下feature,選擇需要的feature,不用的都關閉
650) this.width=650;" title="clip_image004" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image004" src="http://s3.51cto.com/wyfs02/M01/53/A5/wKioL1RstNHTk6uRAADmByDe9w4348.jpg" "436" height="347" />
點擊advanced feature,選則需要的feature,不用的全部關閉
650) this.width=650;" title="clip_image006" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image006" src="http://s3.51cto.com/wyfs02/M02/53/A5/wKioL1RstNPTaad7AAEydrJ6G6o714.jpg" "483" height="465" />
修改nsroot使用者的密碼
Netscaler預設使用者名和密碼均為nsroot,為了保證裝置的安全性,需要修改密碼,或建立新的使用者。
650) this.width=650;" title="clip_image008" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image008" src="http://s3.51cto.com/wyfs02/M00/53/A5/wKioL1RstNagaotGAAENTOfD-RA282.jpg" "557" height="425" />
修改nsroot使用者的密碼,雙擊nsroot使用者名稱,然後修改密碼,
650) this.width=650;" title="clip_image010" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image010" src="http://s3.51cto.com/wyfs02/M00/53/A7/wKiom1RstGHShHiGAAFbZZGq1bw158.jpg" "476" height="593" />
配置mode
Netscaler預設是不啟用2層轉寄的,如果需要啟用2層功能,需要在mode中配置,
進入setting菜單,點擊mode,
650) this.width=650;" title="clip_image012" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image012" src="http://s3.51cto.com/wyfs02/M00/53/A7/wKiom1RstGPxHYeZAAE9b2nHNHc000.jpg" "526" height="439" />
配置系統時間
用shell命令進入系統的作業系統,然後用date命令修改當前系統時間
輸入tzsetup命令設定時區,輸入date yymmddhhmm命令修改系統時間,格式為:年 月 天小時 分鐘
配置時間同步
用文本編輯兩個檔案,ntp.conf和rc.conf,內容如下:
Ntp.conf:
# Netscaler NTP Configuration File
#
# Copy this file to /nsconfig, and make changes to /nsconfig/ntp.conf
# Changes in /etc/ntp.conf will be lost following a reboot.
#
# Add the following line in /nsconfig/rc.conf to enable ntpd:
#
# ntpd_enable="YES"
#
# The following addresses are example addresses. There should be a
# corresponding ‘restrict‘ entry for every ‘server‘ entry.
#
#example address
server 61.129.42.44 burst
restrict default ignore
restrict 127.0.0.1 mask 255.255.255.255
#corresponds to ‘server‘ entry above
restrict 61.129.42.44 mask 255.255.255.255
註:61.129.42.44為ntp伺服器,此類伺服器在互連網上可以搜到
Rc.conf:
ntpd_enable="YES"
編輯完兩個檔案後,用WinSCP3工具登陸Netscaler,然後將這兩個檔案拷貝到/nsconfig目錄下。然後重啟Netscaler
IP配置 配置NSIP
配置一個NSIP,保證這個IP不會和其他IP地址發生衝突,這個IP為裝置的IP,可以用於管理系統。配置完NSIP後需要重啟裝置。
如:在命令列下輸入set ns config -ipAddress 192.168.2.3 -netmask 255.255.255.0,然後輸入save config來儲存配置,最後輸入reboot重啟,裝置重啟後NSIP變為192.168.2.3
配置SNIP和路由
配置SNIP,即介面IP,然後在配置下聯路由和預設路由。
進入菜單network,點擊ips,再點擊add來添加SNIP,如:IP地址為219.142.6.94,掩碼為24位。如果希望通過這個IP裡來管理Netscaler的話,在application access control下的方框打上勾。
650) this.width=650;" title="clip_image014" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image014" src="http://s3.51cto.com/wyfs02/M01/53/A5/wKioL1RstOCjARv3AAGv5edIIUE793.jpg" "557" height="588" />
進入network-routing-routes,點擊add添加路由和預設閘道,如:網關為219.142.6.93;到192.168.3.0網段的下一跳為192.168.2.1
650) this.width=650;" title="clip_image016" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image016" src="http://s3.51cto.com/wyfs02/M02/53/A5/wKioL1RstOPTYovYAADW7HnBqfo274.jpg" "289" height="393" />
650) this.width=650;" title="clip_image018" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image018" src="http://s3.51cto.com/wyfs02/M02/53/A5/wKioL1RstObx65HgAADgCmT4gyI305.jpg" "294" height="390" />
配置HA
HA雙機熱備配置前提條件是兩台裝置的NSIP能夠互相訪問,進入如下菜單:
650) this.width=650;" title="clip_image020" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image020" src="http://s3.51cto.com/wyfs02/M00/53/A5/wKioL1RstOiTdGX9AADNaToXQms824.jpg" "557" height="320" />
預設的Netscaler將自己做為一個節點(node)加入到HA中,只需要將另一台裝置做為不同的節點加入到HA中即可,
650) this.width=650;" title="clip_image022" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image022" src="http://s3.51cto.com/wyfs02/M01/53/A5/wKioL1RstOrRaqsRAACQfxNZRlc840.jpg" "293" height="238" />
在這裡需要注意的是ID必須不同,IP地址必須是NSIP。
在建立好HA後,需要將不使用的介面的狀態disable,進入如下菜單:
650) this.width=650;" title="clip_image024" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image024" src="http://s3.51cto.com/wyfs02/M02/53/A5/wKioL1RstPCxc5lTAADfE3fL65g535.jpg" "557" height="234" />
單擊一個介面,點擊下方的DISABLE按鈕,將這個介面的狀態設定為disable狀態。
然後在非流量介面的要關閉HA monitoring,雙擊一個非流量介面,
650) this.width=650;" title="clip_image026" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image026" src="http://s3.51cto.com/wyfs02/M00/53/A5/wKioL1RstPSCrVzOAAGlYaRI9W0212.jpg" "435" height="580" />
將HA monitoring設定為off。所謂的流量介面是指業務的資料流經過的介面。例如:管理介面不屬於流量介面。
配置Load Balance 配置servers
添加物理伺服器的ip地址,
650) this.width=650;" title="clip_image028" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image028" src="http://s3.51cto.com/wyfs02/M01/53/A5/wKioL1RstPiQWEbRAACX0fDPqV4310.jpg" "365" height="225" />
配置services
添加應用,包括協議,應用連接埠,由哪個server提供的等資訊。
650) this.width=650;" title="clip_image030" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image030" src="http://s3.51cto.com/wyfs02/M01/53/A7/wKiom1RstIOS7Qw4AAEAnlp1vf8192.jpg" "557" height="393" />
進入advanced,添加用戶端IP到header中。
650) this.width=650;" title="clip_image032" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image032" src="http://s3.51cto.com/wyfs02/M02/53/A7/wKiom1RstIeA_E8SAAFQcI1BQAc830.jpg" "558" height="376" />
配置Vserver
添加Vserver,並將相關services加入到Vserver中,如果只做四層負載平衡,則在IP address處添加VIP,port處添加應用連接埠,
650) this.width=650;" title="clip_image034" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image034" src="http://s3.51cto.com/wyfs02/M00/53/A5/wKioL1RstQGR4OdVAAFK4r9L9hc102.jpg" "557" height="388" />
如果需要做七層負載的話,就需要將directly addressable處將勾去掉
650) this.width=650;" title="clip_image036" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image036" src="http://s3.51cto.com/wyfs02/M01/53/A5/wKioL1RstQWA9vF4AAF0oNoCcio112.jpg" "557" height="402" />進入method and persistence菜單中,設定負載平衡方式和會話保持模式,如:負載方式為最小串連數;保持模式為cookie insert,時間可以隨意調整
650) this.width=650;" title="clip_image038" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image038" src="http://s3.51cto.com/wyfs02/M01/53/A7/wKiom1RstJCgzW8TAAFMg9ngXNA183.jpg" "557" height="397" />
配置SSL 配置認證
將申請好的根憑證和伺服器憑證匯入到netscaler中,並安裝這兩個認證。
進入ssl-sercificates,點擊add。點擊browse,選中一個認證,建立根憑證不需要密鑰。
650) this.width=650;" title="clip_image040" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image040" src="http://s3.51cto.com/wyfs02/M01/53/A7/wKiom1RstJOCkS9PAAFpl1LdT1A752.jpg" "554" height="382" />
製作伺服器憑證的時候需要認證和密鑰綁定,
650) this.width=650;" title="clip_image042" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image042" src="http://s3.51cto.com/wyfs02/M02/53/A7/wKiom1RstJagIVd1AAFyWw20Kb8173.jpg" "552" height="382" />
配置CRL
1. 首先進入菜單ssl-crl,然後點擊add,出現如下介面。
2. 然後將crl檔案選中,這個檔案事先已從cfca的ldap伺服器下載完並copy到netscaler中3. 的/var/netscaler/ssl目錄中。
4. 格式為der,ca認證選擇這個crl列表的頒發者的認證。
5. 開啟自動更新,模式為http,連接埠為80,url要寫入下載crl的絕對url路徑,時間間隔為每天,更新時間為3點50
建立如所示:
650) this.width=650;" title="clip_image044" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image044" src="http://s3.51cto.com/wyfs02/M00/53/A7/wKiom1RstJih-BNIAAHJkg9NGjU277.jpg" "536" height="535" />
建立完畢後,重新整理狀態顯示成功,使用狀態顯示為可用的。如
650) this.width=650;" title="clip_image046" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image046" src="http://s3.51cto.com/wyfs02/M02/53/A5/wKioL1RstROj36MsAABl1i-E8Ew895.jpg" "557" height="212" />
用命令列查看crl的狀態如下:
650) this.width=650;" title="clip_image048" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image048" src="http://s3.51cto.com/wyfs02/M02/53/A7/wKiom1RstJ3Az_kSAACTf_eYl4U702.jpg" "557" height="107" />
配置SSL OFFLOAD
配置SSL OFFLOAD的server和service與Load Balance一樣,並且在Load Balance中建立的server和service都可以在SSL OFFLOAD中使用,直接建立Vserver即可,進入如下菜單,
650) this.width=650;" title="clip_image050" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image050" src="http://s3.51cto.com/wyfs02/M00/53/A7/wKiom1RstKDxiCsZAAFD93EvY58431.jpg" "557" height="404" />
然後進入SSL Setting菜單中,
650) this.width=650;" title="clip_image052" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image052" src="http://s3.51cto.com/wyfs02/M02/53/A7/wKiom1RstKPhNfqxAAEqkBLqbQY756.jpg" "557" height="404" />
在這裡伺服器憑證直接add即可,CA認證和根憑證需要add as CA來添加,
650) this.width=650;" title="clip_image054" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image054" src="http://s3.51cto.com/wyfs02/M01/53/A7/wKiom1RstKaDKahZAAFGcz6f01c495.jpg" "557" height="407" />
有時候使用者會需要認證的雙向認證,這時候需要點擊展開SSL Parameters菜單,
650) this.width=650;" title="clip_image056" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image056" src="http://s3.51cto.com/wyfs02/M01/53/A5/wKioL1RstYPDHBpoAAFnXkcfXHY086.jpg" "557" height="420" />
將用戶端認證啟用,並且選擇強制(mandatory)認證
配置Content Switch 配置CS Vserver
建立Vserver,例如協議為SSL,並且配置VIP和連接埠號碼。如果只是http協議的話是不需要配置ssl選項的。
650) this.width=650;" title="clip_image058" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image058" src="http://s3.51cto.com/wyfs02/M02/53/A5/wKioL1RstYXD6o2CAAFDZfObRqE423.jpg" "557" height="368" />
綁定建立號的認證,根憑證作為CA添加,伺服器憑證直接添加即可
650) this.width=650;" title="clip_image060" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image060" src="http://s3.51cto.com/wyfs02/M02/53/A5/wKioL1RstYazoqaRAAEOQZoSQJ0632.jpg" "557" height="365" />
如果需要設定用戶端認證的強制認證,則在ssl parameters中
650) this.width=650;" title="clip_image062" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image062" src="http://s3.51cto.com/wyfs02/M00/53/A5/wKioL1RstYjDsx3AAAFhP4hQotE614.jpg" "557" height="375" />
建立HTTP協議的Vserver。建立方法和建立SSL協議的vserver一樣,區別在於協議和連接埠號碼,
650) this.width=650;" title="clip_image064" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image064" src="http://s3.51cto.com/wyfs02/M00/53/A7/wKiom1RstRSxPHELAAFZp417Tl8536.jpg" "557" height="369" />
配置policy
添加policy,如建立兩中一種為基於網域名稱+url(目錄),
先建立網域名稱+目錄的policy
650) this.width=650;" title="clip_image066" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image066" src="http://s3.51cto.com/wyfs02/M01/53/A7/wKiom1RstRWjBhNpAAC2WHqTSD8114.jpg" "558" height="256" />
起好名字,點擊configure
650) this.width=650;" title="clip_image068" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image068" src="http://s3.51cto.com/wyfs02/M02/53/A5/wKioL1RstY6RyqxoAADnBxE8o-8220.jpg" "557" height="335" />
點擊add,建立一個網域名稱的expressions
650) this.width=650;" title="clip_image070" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image070" src="http://s3.51cto.com/wyfs02/M02/53/A7/wKiom1RstRnjQseoAAEgy2zrXkc388.jpg" "557" height="369" />
再建立一個URL的expressions
650) this.width=650;" title="clip_image072" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image072" src="http://s3.51cto.com/wyfs02/M00/53/A7/wKiom1RstRuhasvNAAEw4CG2brg814.jpg" "558" height="379" />
然後將匹配條件設定為match all expressions
650) this.width=650;" title="clip_image074" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image074" src="http://s3.51cto.com/wyfs02/M01/53/A5/wKioL1RstZTzmlUqAAEAB-w-4-8955.jpg" "557" height="336" />
然後點擊create建立即可。
policy綁定
將建立好的policy綁定到CS Vserver上,並且指定target的Load Balance的Vserver,並設定好優先順序,policy的優先順序值越低越優先,
展開已建立的ssl協議的CS Vserver
650) this.width=650;" title="clip_image076" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image076" src="http://s3.51cto.com/wyfs02/M02/53/A7/wKiom1RstR-h_WSyAAFw8j2gILU583.jpg" "558" height="362" />
配置GSLB 配置ADNS伺服器
在Load Balance中的service,添加ADNS服務,
650) this.width=650;" title="clip_image078" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image078" src="http://s3.51cto.com/wyfs02/M00/53/A7/wKiom1RstSHD5U2iAAEll1-05aI276.jpg" "557" height="410" />
ADNS使用了netscaler的介面地址。
配置site節點
建立local site,
650) this.width=650;" title="clip_image080" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image080" src="http://s3.51cto.com/wyfs02/M01/53/A7/wKiom1RstSOx8Y__AADL2BSuJEA774.jpg" "322" height="323" />
本地site要配置自己的ADNS地址。
建立remote site與建立本地site一樣,區別就是site type為remote,同時site ip為remote端adns的公網地址。
650) this.width=650;" title="clip_image082" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image082" src="http://s3.51cto.com/wyfs02/M02/53/A7/wKiom1RstSjDYyx4AAC_fDa_JdM396.jpg" "315" height="328" />
配置GSLB location
配置location,將電信和網通的位址區段分別寫到不同的location中,在系統判斷一個使用者的local DNS的地址屬於電信來訪問還是網通的時候,先尋找location表。這個表的作用就是靜態就近性判斷的依據。
事先寫好一個location文字檔,然後將其傳到netscaler的/var/netscaler/locdb/目錄下,然後在web介面載入這個檔案,
在GSLB-location中的static database中添加
650) this.width=650;" title="clip_image084" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image084" src="http://s3.51cto.com/wyfs02/M00/53/A5/wKioL1RstaHxjd6_AAClovZZY8g540.jpg" "557" height="280" />
配置GSLB service
配置local service,將兩個節點的Vserver配置到各自的service中。
650) this.width=650;" title="clip_image086" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image086" src="http://s3.51cto.com/wyfs02/M02/53/A5/wKioL1RstaXDiddQAAHBP-x3rsI968.jpg" "558" height="592" />
在virtual server上選擇在需要做GSLB的vserver。
配置remote service與local service一樣,區別是需要預先在loadbalance中的servers中建立一個remote server,IP地址為remote端vserver的公網IP;site name要選擇remote sit的name,virtual server中的server name要選擇預先建立好的remote server。
在loadbalance中建立remote server
650) this.width=650;" title="clip_image088" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image088" src="http://s3.51cto.com/wyfs02/M01/53/A7/wKiom1RstS_zfCFUAACKUOVsm_k615.jpg" "363" height="199" />
在GSLB中建立remote service
650) this.width=650;" title="clip_image090" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image090" src="http://s3.51cto.com/wyfs02/M02/53/A7/wKiom1RstTPi7YcaAAHgUSbVTvA996.jpg" "558" height="603" />
配置GSLB Vserver
配置GSLB Vserver,將GSLB service加入GSLB Vserver中,負載平衡演算法為:靜態就近性和動態就近性,當靜態表location中沒有使用者local DNS的地址時,則採用動態就近性來判斷使用者該走哪條鏈路;然後在配置網站對外提供服務的網域名稱。
650) this.width=650;" title="clip_image092" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image092" src="http://s3.51cto.com/wyfs02/M00/53/A5/wKioL1Rsta3D5HOYAAEM4ne6buA270.jpg" "557" height="398" />
協議選擇ssl,並將所建立的service加入到GSLB Vserver中。
然後佈建網域名,點擊domains,添加,
650) this.width=650;" title="clip_image094" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image094" src="http://s3.51cto.com/wyfs02/M00/53/A7/wKiom1RstTeQsLyhAAFAoqzYvYQ007.jpg" "558" height="405" />
然後配置GSLB Vserver的演算法,採用靜態就進性為第一演算法,動態就進性為第二演算法,當第一演算法失敗就會啟用第二演算法,
650) this.width=650;" title="clip_image096" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="clip_image096" src="http://s3.51cto.com/wyfs02/M00/53/A7/wKiom1RstTnzbzCOAAEa1Ytm9lo980.jpg" "558" height="404" />
CITRIX NETSCALER 常用的功能