解決華為路由器用公網(wǎng)IP訪問內(nèi)網(wǎng)的命令
[XXX級別]路由器內(nèi)網(wǎng)PC 通過公網(wǎng)IP 訪問映射的內(nèi)網(wǎng)SERVER案例一、 組網(wǎng):二、 問題描述:拓樸如上圖,內(nèi)網(wǎng)PC 與內(nèi)網(wǎng)所在的SERVER 在同一個網(wǎng)段, 現(xiàn)在內(nèi)網(wǎng)SERVER 對公網(wǎng)用戶提
[XXX級別]
路由器內(nèi)網(wǎng)PC 通過公網(wǎng)IP 訪問映射的內(nèi)網(wǎng)SERVER
案例
一、 組網(wǎng):

二、 問題描述:
拓樸如上圖,內(nèi)網(wǎng)PC 與內(nèi)網(wǎng)所在的SERVER 在同一個網(wǎng)段, 現(xiàn)在內(nèi)網(wǎng)SERVER 對公網(wǎng)用戶提供WWW 和FTP 服務(wù), 在公網(wǎng)上有相應(yīng)的域名。現(xiàn)在要求內(nèi)網(wǎng)PC 可以同時通過公網(wǎng)域名、公網(wǎng)IP 和私網(wǎng)IP 來訪問內(nèi)網(wǎng)的這臺SERVER 。
三、 過程分析:
內(nèi)網(wǎng)主機通過公網(wǎng)域名來訪問映射的SERVER 在AR 路由器上都是通過NAT DNS-MAP 來實現(xiàn)的,但不能同時通過公網(wǎng)IP 和私網(wǎng)IP 來訪問SERVER 。如果在設(shè)備內(nèi)網(wǎng)口配置NAT SERVER 則可以把訪問公網(wǎng)地址轉(zhuǎn)換成私網(wǎng)地址,然后向SERVER 發(fā)起連接,但源地址還是內(nèi)網(wǎng)主機的地址,此時SERVER 給PC 回應(yīng)報文時就不會走路由器,直接發(fā)到了內(nèi)網(wǎng)PC 上,內(nèi)網(wǎng)PC 認為不是自己要訪問的地址,會把這
華為3Com 機密 未經(jīng)許可不得擴散
第1頁 共5頁

[XXX級別]
個報文丟棄,因此會導(dǎo)致連接中斷。如果讓SERVER 把報文回給路由器,路由器再根據(jù)NAT SESSION就可以正確轉(zhuǎn)發(fā)給PC 了。
四、 解決方法:
在內(nèi)網(wǎng)接口配置一個NAT OUTBOUND 3000就可以了。具體配置如下:
1. 增加一條source 到destination 的訪問控制列表3000
2. 在內(nèi)網(wǎng)口應(yīng)用列表3000
3. 再做靜態(tài)映射
4. 關(guān)掉內(nèi)網(wǎng)口的快速轉(zhuǎn)發(fā)表項
[H3C]dis cu
#
sysname H3C
#
clock timezone gmt 08:004 add 08:00:00
#
cpu-usage cycle 1min
#
connection-limit disable
connection-limit default action deny
connection-limit default amount upper-limit 50 lower-limit 20 #
web set-package force flash:/http.zip
#
radius scheme system
#
domain system
華為3Com 機密 未經(jīng)許可不得擴散
第2頁 共5頁

[XXX級別]
#
local-user admin
password cipher .]@USE=B,53Q=^Q`MAF4<1!!
service-type telnet terminal
level 3
service-type ftp
#
acl number 2000
rule 0 permit source 192.168.1.0 0.0.0.255
rule 1 deny
#
acl number 3000
rule 0 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.1.2 0
#
interface Aux0
async mode flow
#
interface Ethernet1/0
ip address 192.168.1.1 255.255.255.0
nat outbound 3000
nat server protocol tcp global 200.0.0.2 ftp inside 192.168.1.2 ftp #
interface Ethernet1/1
ip address 200.0.0.2 255.255.255.0
nat outbound 2000
nat server protocol tcp global 200.0.0.2 ftp inside 192.168.1.2 ftp
#
華為3Com 機密 未經(jīng)許可不得擴散
第3頁 共5頁

[XXX級別]
interface Ethernet1/2
#
interface Ethernet1/3
#
interface Ethernet1/4
#
interface Ethernet1/5
#
interface Ethernet1/6
#
interface Ethernet1/7
#
interface Ethernet1/8
#
interface Ethernet2/0
#
interface Ethernet3/0
#
interface NULL0
#
FTP server enable
#
ip route-static 0.0.0.0 0.0.0.0 200.0.0.1 preference 60 #
user-interface con 0
user-interface aux 0
user-interface vty 0 4
authentication-mode scheme
#
華為3Com 機密 未經(jīng)許可不得擴散
第4頁 共5頁

[XXX級別]
return
[H3C]
五、 說明
1、本案例適用于R 系列、AR 系列、MSR 系列路由器。
2、R 系列路由器在使用此案例時內(nèi)網(wǎng)口需要undo ip
fast-forwarding ,并且在使用FTP 映射時,客戶端只能使用主動模式去訪問。
華為3Com 機密 未經(jīng)許可不得擴散
第5頁 共5頁
