溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

NAT實(shí)戰(zhàn)——設(shè)置動(dòng)態(tài)NAT

發(fā)布時(shí)間:2020-08-03 07:58:03 來(lái)源:網(wǎng)絡(luò) 閱讀:188 作者:qq5d47f509174fe 欄目:系統(tǒng)運(yùn)維

動(dòng)態(tài)NAT

拓?fù)鋱D如下:

NAT實(shí)戰(zhàn)——設(shè)置動(dòng)態(tài)NAT

實(shí)驗(yàn)步驟

1、設(shè)置三層交換機(jī)sw

sw#conf t 
Enter configuration commands, one per line.  End with CNTL/Z.
sw(config)#no ip routing 
sw(config)#

2、設(shè)置路由R1

R1#conf t 
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int f 0/1
R1(config-if)#ip add 192.168.20.1 255.255.255.0         //僅設(shè)置IP地址與子網(wǎng)掩碼
R1(config-if)#no shut 
*Mar  1 00:00:54.063: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:00:55.063: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R1(config-if)#int f 0/0
R1(config-if)#ip add 192.168.100.1 255.255.255.0          //僅設(shè)置IP地址與子網(wǎng)掩碼
R1(config-if)#no shut 
R1(config-if)#ex 
*Mar  1 00:01:08.423: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:01:09.423: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config)#

3、對(duì)三臺(tái)PC機(jī)進(jìn)行設(shè)置

PC1

PC1> 
PC1> ip 192.168.20.20 192.168.20.1
Checking for duplicate address...
PC1 : 192.168.20.20 255.255.255.0 gateway 192.168.20.1

PC1>

PC2

PC2> 
PC2> ip 192.168.20.30 192.168.20.1 
Checking for duplicate address...
PC1 : 192.168.20.30 255.255.255.0 gateway 192.168.20.1

PC2> 

PC3

PC3> 
PC3> ip 192.168.100.10 192.168.100.1
Checking for duplicate address...
PC1 : 192.168.100.10 255.255.255.0 gateway 192.168.100.1

PC3>
注意:此時(shí)理論上是已經(jīng)可以做到全網(wǎng)互通的,具體見下圖。如果無(wú)法連接請(qǐng)自行檢查命令。

NAT實(shí)戰(zhàn)——設(shè)置動(dòng)態(tài)NAT

為滿足實(shí)驗(yàn)要求,下面將正式進(jìn)行動(dòng)態(tài)NAT的設(shè)置。

R1

R1(config)#
R1(config)#ip access-list standard zhy                          //設(shè)置命名訪問(wèn)控制列表
R1(config-std-nacl)#permit 192.168.20.0 0.0.0.255 
R1(config)#ip nat pool test 12.0.0.10 12.0.0.20 netmask 255.255.255.0        //設(shè)置公網(wǎng)地址池
R1(config)#
*Mar  1 00:09:46.123: %LINEPROTO-5-UPDOWN: Line protocol on Interface NVI0, changed state to up
R1(config)#ip nat inside source list zhy pool test                  //實(shí)現(xiàn)網(wǎng)絡(luò)地址轉(zhuǎn)換

R1(config)#int f 0/1
R1(config-if)#ip nat inside                          //啟用內(nèi)部NAT
R1(config-if)#int f 0/0
R1(config-if)#ip nat outside                         //啟用外部NAT
R1(config-if)#ex 

驗(yàn)證結(jié)果

NAT實(shí)戰(zhàn)——設(shè)置動(dòng)態(tài)NAT

以上就是動(dòng)態(tài)NAT的地址轉(zhuǎn)換,不需要手動(dòng)進(jìn)行指定,他自動(dòng)轉(zhuǎn)換的都是區(qū)間范圍內(nèi)的地址

向AI問(wèn)一下細(xì)節(jié)

免責(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)容。

AI