我是思科新手,有 1841,带有两个以太网接口:
interface FastEthernet0/0: Internal
Desired destination IP: 186.67.181.140
interface FastEthernet0/1: External World
IP 186.67.181.140
想要从外部世界到内部 IP 进行 HTTP 端口转发。
尝试添加此规则,但没有进行转发:
ip nat inside source static tcp 192.168.1.20 80 186.67.181.140 80 extendable
知道为什么我不能正确进行端口转发吗?
完整配置:
interface FastEthernet0/0
ip address 192.168.0.1 255.255.255.0 secondary
ip address 192.168.1.1 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 186.67.181.140 255.255.255.248
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
ip classless
ip route 0.0.0.0 0.0.0.0 186.67.181.141
no ip http server
no ip http secure-server
ip nat inside source list 100 interface FastEthernet0/1 overload
ip nat inside source static tcp 192.168.1.20 80 186.67.181.140 80 extendable
!
!
access-list 100 permit ip any any
access-list 111 permit ip 192.168.1.0 0.0.0.255 any
access-list 111 permit ip 192.168.0.0 0.0.0.255 any
答案1
问题出在我的目的地,与思科路由器不同。
要检查你的思科路由器是否正在进行端口转发,请执行以下操作:
Router#sh ip nat trans | i 80
然后检查是否有类似这样的入口:
tcp 186.67.181.203:80 192.168.1.20:80 85.72.43.64:51720 85.72.43.64:51720
如果存在,则正在进行端口转发。