【技术分享】ASA如何配置端口映射及PAT
发布作者:微思网络 发布时间:2022-06-15 浏览量:0次
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 ciscASA1:
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 s
2.在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应用在外网
3.在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出来。
端口映射:
Internet 上:
1