• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

MSR3620 nat端口映射问题

2022-01-18提问
  • 0关注
  • 1收藏,818浏览
粉丝:0人 关注:0人

问题描述:

对齐方式

  • 靠左
  • 居中
  • 靠右
  1. nat不起作用,我想外网访问内部192.168.20.3:18082上的服务器,做了以下配置,没起效果


  2. #
  3. version 7.1.064, Release 0821P18
  4. #
  5. sysname H3CROUTE
  6. #
  7. clock timezone Beijing add 08:00:00
  8. clock protocol ntp
  9. #
  10. wlan global-configuration
  11. #
  12. telnet server enable
  13. #
  14. ip unreachables enable
  15. ip ttl-expires enable
  16. #
  17. nat static inbound 218.108.84.204 192.168.20.3
  18. nat static outbound 192.168.20.3 218.108.84.204
  19. #
  20. dhcp enable
  21. dhcp server always-broadcast
  22. #
  23. dns proxy enable
  24. #
  25. system-working-mode standard
  26. password-recovery enable
  27. #
  28. vlan 1
  29. #
  30. object-group ip address 1段
  31. 0 network range 192.168.1.11 192.168.1.250
  32. #
  33. object-group ip address vlan字段
  34. 0 network range 192.168.20.1 192.168.100.254
  35. 0 network exclude 192.168.20.1
  36. 0 network exclude 192.168.20.3
  37. 0 network exclude 192.168.30.1
  38. 0 network exclude 192.168.40.1
  39. 0 network exclude 192.168.50.1
  40. 0 network exclude 192.168.60.1
  41. 0 network exclude 192.168.70.1
  42. #
  43. dhcp server ip-pool GigabitEthernet0/0
  44. gateway-list 192.168.0.1
  45. network 192.168.0.0 mask 255.255.255.0
  46. address range 192.168.0.11 192.168.0.249
  47. dns-list 202.101.172.35 114.114.114.114
  48. #
  49. dhcp server ip-pool GigabitEthernet0/1
  50. gateway-list 192.168.1.1
  51. network 192.168.1.0 mask 255.255.255.0
  52. address range 192.168.1.11 192.168.1.249
  53. dns-list 202.101.172.35 114.114.114.114
  54. #
  55. controller Cellular0/0
  56. #
  57. interface Virtual-Template0
  58. #
  59. interface NULL0
  60. #
  61. interface Vlan-interface1
  62. #
  63. interface GigabitEthernet0/0
  64. port link-mode route
  65. combo enable copper
  66. ip address 192.168.0.1 255.255.255.0
  67. nat static enable
  68. #
  69. interface GigabitEthernet0/1
  70. port link-mode route
  71. combo enable copper
  72. ip address 192.168.1.1 255.255.255.0
  73. nat static enable
  74. attack-defense apply policy AtkInterface3
  75. #
  76. interface GigabitEthernet0/2
  77. port link-mode route
  78. combo enable copper
  79. nat static enable
  80. #
  81. interface GigabitEthernet0/3
  82. port link-mode route
  83. description Multiple_Line
  84. bandwidth 100000
  85. combo enable copper
  86. ip address 115.238.110.154 255.255.255.252
  87. dns server 114.114.114.114
  88. dns server 202.101.172.35
  89. packet-filter name WebHttpHttps5 inbound
  90. qos car inbound any cir 100000 cbs 6250000 ebs 0 green pass red discard yellow pass
  91. qos car outbound any cir 100000 cbs 6250000 ebs 0 green pass red discard yellow pass
  92. nat outbound
  93. nat server protocol tcp global current-interface 18082 inside 192.168.20.3 18082
  94. nat static enable
  95. attack-defense apply policy AtkInterface5
  96. #
  97. interface GigabitEthernet0/4
  98. port link-mode route
  99. nat static enable
  100. #
  101. interface GigabitEthernet0/5
  102. port link-mode route
  103. nat static enable
  104. #
  105. object-policy ip Any-Any
  106. rule 0 pass source-ip vlan字段 app-group limitspeed_120
  107. rule 1 inspect limitspeed source-ip vlan字段
  108. #
  109. security-zone name Local
  110. #
  111. security-zone name Trust
  112. #
  113. security-zone name DMZ
  114. #
  115. security-zone name Untrust
  116. #
  117. security-zone name Management
  118. #
  119. zone-pair security source Any destination Any
  120. object-policy apply ip Any-Any
  121. #
  122. scheduler logfile size 16
  123. #
  124. line class console
  125. user-role network-admin
  126. #
  127. line class tty
  128. user-role network-operator
  129. #
  130. line class usb
  131. user-role network-admin
  132. #
  133. line class vty
  134. user-role network-operator
  135. #
  136. line con 0
  137. user-role network-admin
  138. #
  139. line vty 0 63
  140. authentication-mode scheme
  141. user-role network-operator
  142. #
  143. ip route-static 0.0.0.0 0 GigabitEthernet0/3 115.238.110.153
  144. ip route-static 114.55.101.147 32 115.238.110.153 preference 10
  145. ip route-static 192.168.0.0 16 192.168.1.253
  146. #
  147. info-center loghost 127.0.0.1 port 3301
  148. info-center source CFGLOG loghost level informational
  149. #
  150. performance-management
  151. #
  152. ssh server enable
  153. #
  154. ntp-service enable
  155. ntp-service unicast-server 120.25.108.11
  156. ntp-service unicast-server 203.107.6.88
  157. #
  158. acl advanced name WebHttpHttps5
  159. rule 65533 permit tcp destination-port eq www
  160. rule 65534 permit tcp destination-port eq 443
  161. #
  162. password-control enable 
  163. undo password-control aging enable 
  164. undo password-control history enable 
  165. password-control length 6
  166. password-control login-attempt 3 exceed lock-time 10
  167. password-control update-interval 0
  168. password-control login idle-time 0
  169. #
  170. domain system
  171. #
  172. domain default enable system
  173. #
  174. role name level-0
  175. description Predefined level-0 role
  176. #
  177. role name level-1
  178. description Predefined level-1 role
  179. #
  180. role name level-2
  181. description Predefined level-2 role
  182. #
  183. role name level-3
  184. description Predefined level-3 role
  185. #
  186. role name level-4
  187. description Predefined level-4 role
  188. #
  189. role name level-5
  190. description Predefined level-5 role
  191. #
  192. role name level-6
  193. description Predefined level-6 role
  194. #
  195. role name level-7
  196. description Predefined level-7 role
  197. #
  198. role name level-8
  199. description Predefined level-8 role
  200. #
  201. role name level-9
  202. description Predefined level-9 role
  203. #
  204. role name level-10
  205. description Predefined level-10 role
  206. #
  207. role name level-11
  208. description Predefined level-11 role
  209. #
  210. role name level-12
  211. description Predefined level-12 role
  212. #
  213. role name level-13
  214. description Predefined level-13 role
  215. #
  216. role name level-14
  217. description Predefined level-14 role
  218. #
  219. user-group system
  220. #
  221. local-user admin class manage
  222. service-type ftp
  223. service-type ssh telnet terminal http https
  224. authorization-attribute user-role network-admin
  225. #
  226. connection-limit policy 32
  227. #
  228. app-group limitspeed_120
  229. description "User-defined application group"
  230. include application AndroidMarket
  231. include application AnZhiMarket
  232. include application BaiduWenKu
  233. include application JiFengMarket
  234. include application OnlineDown
  235. include application WanDouJia
  236. #
  237. ip http enable
  238. #
  239. attack-defense policy AtkInterface3
  240. scan detect level high action logging block-source
  241. syn-flood detect non-specific
  242. syn-flood action drop 
  243. udp-flood detect non-specific
  244. udp-flood action drop 
  245. icmp-flood detect non-specific
  246. icmp-flood action drop 
  247. signature detect smurf action drop
  248. signature detect large-icmp action drop
  249. signature detect large-icmpv6 action drop
  250. signature detect tcp-invalid-flags action drop
  251. signature detect tcp-null-flag action drop
  252. signature detect tcp-all-flags action drop
  253. signature detect tcp-syn-fin action drop
  254. signature detect tcp-fin-only action drop
  255. signature detect land action drop
  256. signature detect winnuke action drop
  257. signature detect fraggle action drop
  258. signature detect ip-option record-route action drop
  259. signature detect ip-option strict-source-routing action drop
  260. signature detect icmp-type destination-unreachable action drop
  261. signature detect icmp-type redirect action drop
  262. #
  263. attack-defense policy AtkInterface5
  264. syn-flood detect non-specific
  265. syn-flood action drop 
  266. udp-flood detect non-specific
  267. udp-flood action drop 
  268. icmp-flood detect non-specific
  269. icmp-flood action drop 
  270. signature detect smurf action drop
  271. signature detect large-icmp action drop
  272. signature detect large-icmpv6 action drop
  273. signature detect tcp-invalid-flags action drop
  274. signature detect tcp-null-flag action drop
  275. signature detect tcp-all-flags action drop
  276. signature detect tcp-syn-fin action drop
  277. signature detect tcp-fin-only action drop
  278. signature detect land action drop
  279. signature detect winnuke action drop
  280. signature detect fraggle action drop
  281. signature detect ip-option record-route action drop
  282. signature detect ip-option strict-source-routing action drop
  283. signature detect icmp-type destination-unreachable action drop
  284. signature detect icmp-type redirect action drop
  285. #
  286. url-filter policy limitspeed
  287. default-action permit
  288. #
  289. app-profile limitspeed
  290. url-filter apply policy limitspeed
  291. #
  292. wlan ap-group default-group
  293. vlan 1
  294. #
  295. traffic-policy 
  296. rule 1 name limitspeed_120 
  297.   action qos profile limitspeed_120 
  298.   source-address address-set vlan字段 
  299.   application app AndroidMarket 
  300.   application app AnZhiMarket 
  301.   application app BaiduWenKu 
  302.   application app JiFengMarket 
  303.   application app OnlineDown 
  304.   application app WanDouJia 
  305. profile name limitspeed_120
  306.   bandwidth downstream maximum 100 
  307.   bandwidth upstream maximum 100 
  308. #
  309. return

组网及组网描述:

交换机上做了20/30/40/50/60的vlan,交换机地址192.168.1.253

最佳答案

已采纳
z6Kl9 九段
粉丝:67人 关注:2人

删除

  1. nat static inbound 218.108.84.204 192.168.20.3
  2. nat static outbound 192.168.20.3 218.108.84.204
  3. ip route-static 114.55.101.147 32 115.238.110.153 preference 10

想要内网访问:

在内网口配置端口回流功能即可

  1. interface GigabitEthernet0/1

nat hairpin enable


2 个回答
粉丝:111人 关注:1人

nat static inbound 218.108.84.204 192.168.20.3

全局做了全端口映射,需要访问 218.108.84.204  

我路由器地址是115.238.110.154,218.108.84.204这是一个未使用的公网地址,我原来在5200上都是这么配的,都可以使用

zhiliao_IIO49h 发表时间:2022-01-18

不要管之前怎么配置,你的目标服务器,匹配了全端口映射自然不会匹配接口的端口映射

漓离原上谱 发表时间:2022-01-18

我把那条删了,现在是我用手机能访问,但是,在局域网内访问不了

zhiliao_IIO49h 发表时间:2022-01-18

跟踪一下路径 nat static outbound 192.168.20.3 218.108.84.204 这条是回给公网的不是回给内网的

漓离原上谱 发表时间:2022-01-18

NAT hairpin应该是这个功能没开启,这个功能好像在web端是看不到的

zhiliao_IIO49h 发表时间:2022-01-18
zhiliao_IIO49h 知了小白
粉丝:0人 关注:0人

我做了2个映射,一个是端口映射,一个是公网地址的映射,都不成功

编辑答案

你正在编辑答案

如果你要对问题或其他回答进行点评或询问,请使用评论功能。

分享扩散:

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作

举报

×

侵犯我的权益 >
对根叔社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明