我是 cisco 的新手,目前正在学习认证,这只是我实践所学知识的方式。目前我处于停滞状态,因为我似乎无法理解正在发生的事情,或者我的 NAT 基础知识是离开。无论如何,请参考我通过 Packet Tracer 创建的拓扑
CR 运行配置
!
!
!
interface GigabitEthernet0/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface GigabitEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface GigabitEthernet0/2
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/3/0
ip address 205.112.2.1 255.255.255.252
ip nat outside
!
interface Serial0/3/1
no ip address
clock rate 2000000
shutdown
!
interface Vlan1
no ip address
shutdown
!
ip nat pool mypool 172.16.2.1 172.16.2.31 netmask 255.255.255.224
ip nat inside source list 50 pool mypool overload
ip classless
!
ip flow-export version 9
!
!
access-list 50 permit 192.168.1.0 0.0.0.255
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
ISP 运行配置
interface GigabitEthernet0/0
ip address 210.125.35.1 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface GigabitEthernet0/2
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/3/0
ip address 205.112.2.2 255.255.255.252
clock rate 64000
!
interface Serial0/3/1
no ip address
clock rate 2000000
shutdown
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 205.112.2.1
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
现在,CR是我的公司路由器,通过串行接口连接,这也是我放置 NAT 配置的地方。ISP's 只是为了 ping 目的返回 CR 的静态路由。
我为验证此设置所做的工作是通过pingPC0/PC1/PC2 到 Server0,但是它无法访问(是的,可以理解,因为 CR 没有路由到 210.125.35.0 网络)但考虑到在该路由器上配置了 NAT,我希望它可以通过公共IP并路由它,此时我真的很困惑。现在我做的另一项测试是ping对 ISP 路由器上的 205.112.2.2 接口进行翻译(通过 确认show ip nat translation)。在这一点上,我确定我错过了一些东西,因为我在这一点上真的很困惑..
有人可以帮我清理一下吗?
编辑
正如@Ron Maquin 所说,这是一个路由问题,我添加了一个默认路由,但是当我从 PC0 进行连续 ping 时,nat 转换正在增加。据我所知,它只会将分配的端口重用于转换后的 IP(在本例中为 PC0)。如果我错了,请纠正我,另请参阅show ip nat translation输出
CR#show ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 172.16.2.1:27 192.168.1.2:27 210.125.35.110:27 210.125.35.110:27
icmp 172.16.2.1:28 192.168.1.2:28 210.125.35.110:28 210.125.35.110:28
icmp 172.16.2.1:29 192.168.1.2:29 210.125.35.110:29 210.125.35.110:29
icmp 172.16.2.1:30 192.168.1.2:30 210.125.35.110:30 210.125.35.110:30
icmp 172.16.2.1:31 192.168.1.2:31 210.125.35.110:31 210.125.35.110:31
icmp 172.16.2.1:32 192.168.1.2:32 210.125.35.110:32 210.125.35.110:32
icmp 172.16.2.1:33 192.168.1.2:33 210.125.35.110:33 210.125.35.110:33
icmp 172.16.2.1:34 192.168.1.2:34 210.125.35.110:34 210.125.35.110:34
icmp 172.16.2.1:35 192.168.1.2:35 210.125.35.110:35 210.125.35.110:35
icmp 172.16.2.1:36 192.168.1.2:36 210.125.35.110:36 210.125.35.110:36
icmp 172.16.2.1:37 192.168.1.2:37 210.125.35.110:37 210.125.35.110:37
icmp 172.16.2.1:38 192.168.1.2:38 210.125.35.110:38 210.125.35.110:38
icmp 172.16.2.1:39 192.168.1.2:39 210.125.35.110:39 210.125.35.110:39
icmp 172.16.2.1:40 192.168.1.2:40 210.125.35.110:40 210.125.35.110:40
icmp 172.16.2.1:41 192.168.1.2:41 210.125.35.110:41 210.125.35.110:41
icmp 172.16.2.1:42 192.168.1.2:42 210.125.35.110:42 210.125.35.110:42
icmp 172.16.2.1:43 192.168.1.2:43 210.125.35.110:43 210.125.35.110:43
icmp 172.16.2.1:44 192.168.1.2:44 210.125.35.110:44 210.125.35.110:44
icmp 172.16.2.1:45 192.168.1.2:45 210.125.35.110:45 210.125.35.110:45
icmp 172.16.2.1:46 192.168.1.2:46 210.125.35.110:46 210.125.35.110:46
icmp 172.16.2.1:47 192.168.1.2:47 210.125.35.110:47 210.125.35.110:47
