多方向 NAT

网络工程 思科 纳特
2021-08-02 03:36:33

我需要有关 Cisco 路由器上 NAT 配置的帮助:

这里的图表: 在此处输入图片说明

解释:

来自网络 10.197.56.0 的 Computer1 连接到 Client1,它的默认 GW 是 Router1,但它需要连接到 Client2 的主机 10.100.2.1,因此它有一条到 Cisco1 (10.197.56.5) 的静态路由,它执行 NAT。Cisco1 还有一个静态路由 10.100.0.0/16 到 172.19.0.4

以下是 NAT 的配置:

interface FastEthernet0/0.1   
 encapsulation dot1Q 1 native    
 ip address 10.197.56.5 255.255.255.0    
 ip nat inside     
 ip virtual-reassembly in    
!   
interface FastEthernet0/1    
 ip address 172.19.0.5 255.255.255.0    
 ip nat outside    
 ip virtual-reassembly in    
 duplex auto    
 speed auto     
!    
ip route 10.100.0.0 255.255.0.0 172.19.0.4   
ip route 172.24.0.0 255.255.0.0 10.197.56.5    
access-list 1 permit 10.197.56.0 0.0.0.255     
ip nat inside source list 1 interface FastEthernet0/1 overload      

到这一步就OK了。

问题来自第二个需求:Computer3 有一个默认的 GW 172.30.56.1 来连接到 Client3 以到达生产网络,但它也需要从 Client1 连接到主机 172.24.2.6(邮件服务器)。我需要在 Cisco1 中 NAT 从 172.30.56.10 到 10.197.56.5 同时 Cisco1 NAT 计算机从 Network1 到 Client2。

我怎样才能做到这一点?

更新:

我终于用 NVI 做到了:

这里的配置:

interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 1 native
ip address 10.197.56.5 255.255.255.0
ip nat enable
!
interface FastEthernet0/0.39
encapsulation dot1Q 39
ip address 172.30.56.5 255.255.255.0
ip nat enable
!
interface FastEthernet0/1
ip address 172.19.0.5 255.255.255.0
ip nat enable
duplex auto
speed auto
!

ip nat pool NAT_client2 172.19.0.7 172.19.0.7 netmask 255.255.255.0 add-route
ip nat pool NAT_client1-3 10.197.56.215 10.197.56.215 netmask 255.255.255.0 add-route
ip nat source list client2_NAT pool NAT_client2 overload
ip nat source list NAT_client1-3 pool NAT_client1-3 overload
ip route 0.0.0.0 0.0.0.0 10.197.56.1
ip route 10.100.0.0 255.255.0.0 172.19.0.4
ip route 172.24.0.0 255.255.0.0 10.197.56.1

!
ip access-list extended client2_NAT
 permit ip 10.197.56.0 0.0.0.255 any
ip access-list extended NAT_client1-3
 permit ip 172.30.56.0 0.0.0.255 172.24.0.0 0.0.255.255
!

不管怎么说,还是要谢谢你。

1个回答

在此处输入图片说明

我只是以更清晰的方式重新绘制您的网络来定义问题,首先您有 6 个网络,我用不同的颜色标记每个网络,而您的 Cisco 路由器只知道其中的 4 个,因此您需要将其余两个定义为蓝色和深红色。蓝色的定义路由器接口,深红色的定义静态路由,然后在 Cisco 路由器上执行您想要的任何 NATing

从我的角度来看,NAT 不是最佳实践,而是带有路由 mab 的 ACL

a- CISCO 路由器默认知道 3 个网络,通过静态 nating 将知道其他 3 个网络
b- 在计算机的 GW 上配置扩展访问列表并定义源主机和目标主机
c- 在 GW 路由器上配置路由映射匹配此访问列表并将其下一跳设置为 CISCO 路由器

这将使您以轻松安全的方式实现目标