本帖最后由 IT认证-微思网络 于 2021-11-26 14:21 编辑
今天给大家分享一个 ASA8.4以上IOS如何配置端口映射及PAT,希望对大家工作学习有帮助。
实验拓扑图
实验目标:把R1的telnet服务(端口23)映射到ASA1的外网口G0口的端口12345,使外网可以访问它;配置PAT使内网可以访问公网。 配置: 一、基本配置: R1: #int f0/0 #ip add 192.168.10.1 255.255.255.0 #no sh #no ip routing #ip default-gateway 192.168.10.254 #line vty 0 4 #password cisco #login #enable password cisco
ASA1: #int g0 #nameif outside #ip add 202.100.1.1 255.255.255.0 #no sh #int g1
#nameif inside #ip add 192.168.10.254 255.255.255.0 #no sh
二、在ASA1上配置映射R1的telnet服务(端口23): ASA1: #object network outside_telnet_inside - - - - - - - -新建一个名字叫“outside_telnet_inside”的网络对象 #host 192.168.10.1 - - - - - - - - -定义网络对象的地址,也可以是一个网段 # nat (inside,outside) static interface service tcp 23 12345 - - - - - 把所定义的地址的23端口映射到外网口的端口12345,注意,参数“static”用打问号的方式是不会显示的,但是可以TAB出来。 #access-list 100 permit tcp any host 192.168.10.1 eq 23 - - - - - - -写ACL允许外网访问内网特定地址的端口23,注意,与旧版IOS不同的是,这里允许访问的地址并不是外网口的地址,而是要映射出去的内网的真实地址。 #access-group 100 in interface outside - - - - - - - 把ACL应用在外网口
三、在ASA1上配置PAT使内网可以访问外网: #object network inside #subnet 192.168.10.0 255.255.255.0 #nat (inside,outside) dynamic interface - - - - - - - - -把内网网段192.168.10.0/24做PAT,注意,与“static”一样,“dynamic”也是“?”不出来的,但是可以Tab出来。
验证: PAT: R1上:
端口映射: Internet 上:
需要原文请下载文档文件
|