学员提问:
本来做的out策略都正常
但后来外部需要访问内部的一个端口,发现是不通的
于是加了一条in的策略,permit tcp host foreign host local eq 8001
但是加完以后连out的策略也失效了,不知道是什么情况
ip nat inside source static 192.xxx.xxx.67 10.xxx.xxx.67
ip nat inside source static 192.xxx.xxx.4 10.xxx.xxx.4
interface FastEthernet0/0
ip address 10.xxx.xxx.201 255.255.255.0
ip access-group 101 out
ip access-group 102 in
ip nat outside
no ip mroute-cache
speed auto
full-duplex
no cdp enable
!
interface FastEthernet0/1
ip address 192.xxx.xxx.254 255.255.255.0
ip nat inside
no ip mroute-cache
speed auto
full-duplex
no cdp enable
!
access-list 101 permit tcp host 10.xxx.xxx.67 host 172.xxx.xxx.65 eq 3389
access-list 101 permit tcp host 10.xxx.xxx.67 host 172.xxx.xxx.66 eq 3389
access-list 101 permit tcp host 10.xxx.xxx.4 host 172.xxx.xxx.65 eq 18000
access-list 101 permit tcp host 10.xxx.xxx.4 host 172.xxx.xxx.66 eq 18000
access-list 102 permit tcp host 172.xxx.xxx.66 host 10.xxx.xxx.4 eq 8001
在只有out的时候67还能 3389出去的
加了in 就出不去了
捷盈讲师及学员解答:
主要是你在102的acl当中,只放行了8001的端口进来,所以101的流量虽然能够出去。但是回来的流量将是被block掉,所以你在acl 102当中必须将101当中的流量的源目的ip和源目的端口进行一个颠倒。当然acl 101当中也要放行acl 102返回去的流量。这个时候源目的ip以及源目的端口都要颠倒下。

