您好,登錄后才能下訂單哦!
SRX所使用的地址池使用的地址在SRX是虛擬的,它不是一個(gè)真正物理存在的。那么這個(gè)地址的可達(dá)性必然依賴于簡(jiǎn)單的IP路由查找。SRX也支持將自己的物理接口配置到Pool中,如圖5-8。
Figure5-8. Source NAT with ProxyARP
為保證這些Pool的可達(dá)性,Proxy ARP功能使能。由于Pool內(nèi)有可路由的IP網(wǎng)絡(luò)(或者SRX設(shè)備本身是不可達(dá)),關(guān)鍵是要在以太網(wǎng)層面(二層)提供可達(dá)性,而不是IP層的可達(dá)性。
最后一跳IP路由設(shè)備必須在本地以太網(wǎng)絡(luò)上發(fā)送一個(gè)ARP請(qǐng)求,以獲得MAC地址。Proxy ARP功能可以讓SRX設(shè)備上代表Pool內(nèi)地址回應(yīng)這些ARP請(qǐng)求。在這樣做時(shí),SRX設(shè)備提供其自己的MAC地址作為數(shù)據(jù)包在以太網(wǎng)層目的地發(fā)送到池地址的IP層。一旦報(bào)文被接收時(shí),SRX設(shè)備繼續(xù)流處理為正常。
james@SRX5800-1>edit
Enteringconfigurationmode
[edit]
james@SRX5800-1# edit security natsource
[editsecurity natsource]
james@SRX5800-1# set pool phyPool address 198.18.5.64/27
創(chuàng)建一個(gè)新的rule-set應(yīng)用這個(gè)Pool:
[edit]
james@SRX5800-1#editrule-set Dept-B-to-Inet
對(duì)來(lái)自Dept-B zone的流量進(jìn)行匹配:
[editsecurity nat source rule-setDept-B-to-Inet]
james@SRX5800-1#set from zone Dept-B
目的是Inet zone:
[editsecuritynatsourcerule-setDept-B-to-Inet]
james@SRX5800-1# set to zone Inet
下面在rule層級(jí)下進(jìn)行配置:
[editsecuritynatsourcerule-setDept-B-to-Inet]
james@SRX5800-1# editrulephypoolNAT
對(duì)源地址10.2.0.0/16的流量進(jìn)行匹配:
[editsecurity nat source rule-set Dept-B-to-Inet rulephypoolNAT]
james@SRX5800-1# set match source-address 10.2/16
配置source nat的Action:
[editsecurity nat source rule-set Dept-B-to-Inet rulephypoolNAT]
james@SRX5800-1#set then source-nat phyPool
[editsecurity nat source rule-set Dept-B-to-Inet rulephypoolNAT]
james@SRX5800-1#up 3
在Inet zone ge-0/0/2.0 interface為198.18.5.64/27range配置Proxy ARP:
[editsecurity nat]
james@SRX5800-1#set proxy-arp interface ge-0/0/2.0 address198.18.5.64/27
[editsecuritynat]
james@SRX5800-1#show |compare
[editsecurity natsource] pool ipPool { ...}
+ pool phyPool{
+ address{
+ 198.18.5.64/27;
+ }
+ }
[editsecurity natsource]
rule-setDept-A-to-Inet { ...}
+ rule-set Dept-B-to-Inet{
+ from zoneDept-B;
+ to zoneweb-dmz;
+ rule phypoolNAT{
+ match{
+ source-address198.18.11.0/24;
+ }
+ then{
+ source-nat{
+ pool{
+ phyPool;
+ }
+ }
+ }
+ }
+ }
[editsecuritynat]
+ proxy-arp{
+ interface ge-0/0/2.0{
+ address{
+ 198.18.5.64/27;
+ }
+ }
+}
[edit securitynat]
james@SRX5800-1#commit and-quit
configurationchecksucceeds commit complete
Exitingconfiguration mode
james@SRX5800-1>
來(lái)自Dept-B zone的10.2.0.0/16流量去往net zone的流量將被翻譯為198.18.5.64/27,該地址池存在于egress Inet zone network。
當(dāng)在GE-0/0/2.0接口上收到對(duì)198.18.5.64/27的ARP請(qǐng)求時(shí),設(shè)備SRX將對(duì)其應(yīng)答。
可以看到一條flow通過(guò)新的rule-set進(jìn)行了翻譯:
james@SRX5800-1>show security flow session
SessionID: 2336, Policy name: webdmz_mgt/8, Timeout:1796
In:10.2.1.15/49842 --> 198.18.200.1/80;tcp, If:ge-0/0/0.0
Out:198.18.200.1/80 --> 198.18.5.78/2615;tcp, If:ge-0/0/2.0
1sessionsdisplayed james@SRX5800-1>
在此,內(nèi)部源IP地址10.2.1.15被轉(zhuǎn)換為198.18.5.78池地址(在Out返回方向可見),而源端口是從49842翻譯到2615(因?yàn)樗鼪](méi)有明確禁用)。該流量相應(yīng)的日志是:
james@SRX5800-1>show logtraffic-log
Jan19 09:41:59 SRX210 RT_FLOW: RT_FLOW_SESSION_CREATE: sessioncreated10.2.1.15/49842->198.18.200.1/80junos-http198.18.5.78/2615->198.18.200.1/80
phypoolNATNone 6 webdmz_mgt Dept-B web-dmz2336
james@SRX5800-1>
此會(huì)話初始化日志條目顯示翻譯內(nèi)部源IP地址和端口從10.2.1.15和49842至198.18.5.78和2615公共地址和端口,它也顯示了匹配NAT規(guī)則(phypoolNAT)。
通過(guò)show命令查看rule:
james@SRX5800-1>show security nat source rule phypoolNAT
source NAT rule:phypoolNAT Rule-set:Dept-B-to-InetRule-Id 2
Ruleposition 1
Fromzone :Dept-B
Tozone :Inet
Match
Sourceaddresses :198.18.5.64 -198.18.5.95 Action :phyPool
PersistentNATtype :N/AInactivitytimeout 0
Max sessionnumber 0
Translationhits 1
james@SRX5800-1>
新的地址池:
james@SRX5800-1>showsecurity nat source pool all
Totalpools:1
Poolname :phyPool
Poolid 5
Routinginstance :default Host address base :0.0.0.0
Port : [1024,63487]
Totaladdresses 32
Translationhits 1
Addre***ange SinglePorts TwinPorts 198.18.5.64 -198.18.5.95 1 0
james@SRX5800-1>
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。