1、路由實例
創(chuàng)新互聯(lián)公司服務(wù)項目包括北海網(wǎng)站建設(shè)、北海網(wǎng)站制作、北海網(wǎng)頁制作以及北海網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,北海網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到北海省份的部分城市,未來相信會繼續(xù)擴大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!路由實例是路由表、接口和路由協(xié)議參數(shù)的集合。通過設(shè)置接口及路由協(xié)議各種參數(shù)可以形成路由實例的路由表。
每個路由實例都有自己的實例名稱,并且各自維護一張獨立的路由表。
全局路由其實也是一個路由實例,其實例名稱為inet.0。
2、普通靜態(tài)策略路由(只做策略,不作NAT轉(zhuǎn)換)
設(shè)置包括如下步驟:
1)設(shè)置應(yīng)用接口子接口,定義為服務(wù)區(qū)域的入接口/出接口
2)定義路由實例,實例類型為forwarding,實例路由表
3)定義過濾器firewall filter
4)定義接口路由組rib-group;
5)將接口路由組導(dǎo)入到全局路由表及路由實例的路由表中;
6)在內(nèi)網(wǎng)接口應(yīng)用過濾器filter
3、做NAT的靜態(tài)策略路由(既做策略又做NAT轉(zhuǎn)換)
注意:
1)該情況下需要試用virtual-router類型的路由實例
2)每個virtual-router維護一張獨立的路由表
配置實例拓撲圖
達到目的:
默認內(nèi)網(wǎng)主機上網(wǎng)走CNC 2M鏈路訪問公網(wǎng),指定的PC走CNC 50M鏈路訪問外網(wǎng)
實現(xiàn)思路:
默認內(nèi)網(wǎng)所有主機通過全局路由表inet.0走CNC 2M鏈路出局訪問公網(wǎng),部分指定的PC通過Juniper SRX的FBF路由策略走路由實例的路由表出局訪問公網(wǎng)
設(shè)置步驟如下:
1)定義服務(wù)區(qū)域zone
配置示例:
set security zones security-zone lt host-inbound-traffic system-services all
set security zones security-zone lt host-inbound-traffic protocols all
2)設(shè)置應(yīng)用接口子接口,定義為服務(wù)區(qū)域的入接口/出接口
配置示例:
set security zones security-zone lt interfaces ge-0/0/2.0 host-inbound-traffic system-services all
set security zones security-zone lt interfaces ge-0/0/2.0 host-inbound-traffic protocols all
3)定義路由實例,路由實例數(shù)量可根據(jù)接入的ISP線路數(shù)量來定義。實例類型為virtual-router,VR的虛擬接口,VR的路由表
配置示例:
set routing-instances CNC50M instance-type virtual-router
set routing-instances CNC50M interface ge-0/0/2.0
set routing-instances CNC50M routing-options static route 0.0.0.0/0 next-hop XX.XX.XX.XX ##指向ISP提供的公網(wǎng)網(wǎng)關(guān)
4)定義NAT的相關(guān)映射rule-set、rule,策略policy、address-book、application等
√Source NAT的rule-set 配置示例:
set security nat source rule-set CNC50M-snat-internet from zone trust
set security nat source rule-set CNC50M-snat-internet to zone lt
set security nat source rule-set CNC50M-snat-internet rule CNC50M-inside-to-outside match source-address 0.0.0.0/0
set security nat source rule-set CNC50M-snat-internet rule CNC50M-inside-to-outside match destination-address 0.0.0.0/0
set security nat source rule-set CNC50M-snat-internet rule CNC50M-inside-to-outside then source-nat interface
√ 策略policy 配置示例:
set security policies from-zone trust to-zone lt policy CNC50M-snat-internet match source-address CBGZ-out-norestrict
set security policies from-zone trust to-zone lt policy CNC50M-snat-internet match destination-address any
set security policies from-zone trust to-zone lt policy CNC50M-snat-internet match application any
set security policies from-zone trust to-zone lt policy CNC50M-snat-internet then permit
set security policies from-zone trust to-zone lt policy CNC50M-snat-internet then log session-init
set security policies from-zone trust to-zone lt policy CNC50M-snat-internet then log session-close
5)定義過濾器filter
配置示例:
set firewall family inet filter filter-1 term LAN_term from destination-address 172.16.0.0/16
set firewall family inet filter filter-1 term LAN_term from destination-address 172.20.0.0/16
set firewall family inet filter filter-1 term LAN_term from destination-address 192.168.0.0/16
set firewall family inet filter filter-1 term LAN_term then accept ##允許內(nèi)網(wǎng)PC互訪,不作以上配置將會導(dǎo)致網(wǎng)關(guān)為此防火墻內(nèi)網(wǎng)接口的PC無法訪問內(nèi)網(wǎng)其他PC。
##指定的PC從CNC 50M鏈路出局訪問公網(wǎng)
set firewall family inet filter filter-1 term CNC50M_term from source-address 172.16.29.25/32
set firewall family inet filter filter-1 term CNC50M_term from source-address 172.16.29.251/32
set firewall family inet filter filter-1 term CNC50M_term from source-address 172.16.28.166/32
set firewall family inet filter filter-1 term CNC50M_term from source-address 172.16.28.137/32
set firewall family inet filter filter-1 term CNC50M_term from source-address 172.16.28.139/32
set firewall family inet filter filter-1 term CNC50M_term from source-address 172.16.28.138/32
set firewall family inet filter filter-1 term CNC50M_term then routing-instance CNC50M
set firewall family inet filter filter-1 term default then accept ##對于filter的其他數(shù)據(jù),采取默認動作accept(接受)
6)定義接口路由組
配置示例:
set routing-options interface-routes rib-group inet INSIDE
7)將接口路由組導(dǎo)入到全局路由表及實例的路由表中
配置示例:
set routing-options rib-groups INSIDE import-rib inet.0
set routing-options rib-groups INSIDE import-rib CNC50M.inet.0
set routing-options rib-groups INSIDE import-rib default.inet.0
8)在內(nèi)網(wǎng)接口應(yīng)用相應(yīng)的過濾器filter
set interfaces ge-0/0/0 unit 0 family inet filter input filter-1
4、普通靜態(tài)策略路由與NAT轉(zhuǎn)換的策略路由之間的區(qū)別
路由實例類型不同:
普通靜態(tài)策略路由類型:forwarding
NAT轉(zhuǎn)換的策略路由類型:virtual-router
參考鏈接:http://www.docin.com/p-598358767.html
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。