关于nat转换的问题,如何解决?

img

img

左边的路由器
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1
 no ip address
 ip nat inside
 duplex auto
 speed auto
!
interface FastEthernet0/1.1
 encapsulation dot1Q 10
 ip address 192.168.1.1 255.255.255.0
 ip nat inside
!
interface FastEthernet0/1.2
 encapsulation dot1Q 20
 ip address 192.168.2.1 255.255.255.0
 ip nat inside
!
interface Serial0/0/0
 ip address 111.1.1.2 255.255.255.0
 ip nat outside
!
interface Serial0/0/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router eigrp 1
 passive-interface FastEthernet0/1
 passive-interface FastEthernet0/1.1
 passive-interface FastEthernet0/1.2
 network 111.0.0.0
!
ip nat inside source static 192.168.1.2 111.1.1.2 
ip nat inside source static 192.168.2.2 111.1.1.2 
ip classless
!
上面的路由器
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 111.1.1.1 255.255.255.0
 clock rate 64000
!
interface Serial0/0/1
 ip address 222.2.2.1 255.255.255.0
 clock rate 64000
!
interface Vlan1
 no ip address
 shutdown
!
router eigrp 1
 network 111.0.0.0
 network 222.2.2.0
!
ip classless
!
右边的路由器
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet0/1
 ip address 33.33.33.1 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/0/0
 ip address 222.2.2.2 255.255.255.0
!
interface Serial0/0/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router eigrp 1
 network 33.0.0.0
 network 222.2.2.0
!
ip nat inside source static 192.168.1.2 222.2.2.2 
ip nat inside source static 192.168.2.2 222.2.2.2 
ip nat outside source static 111.1.1.2 192.168.2.50 
ip classless
ip route 192.168.2.50 255.255.255.255 Serial0/0/0 
ip route 192.168.2.50 255.255.255.255 222.2.2.1 
!

根据您的配置,左边路由器的FastEthernet0/1接口和子接口FastEthernet0/1.1和FastEthernet0/1.2已经正确配置为NAT内部接口,而且已经配置了静态NAT转换表项将192.168.1.2和192.168.2.2映射到111.1.1.2。右边的路由器也已经配置了静态NAT转换表项将192.168.1.2和192.168.2.2映射到222.2.2.2,并且还配置了一个静态NAT转换表项将111.1.1.2映射到192.168.2.50,这样可以将来自互联网的流量转发给内部网络中的主机192.168.2.50。
但是,右边的路由器还需要一些额外的配置才能使NAT正常工作。具体来说,右边路由器还需要配置以下内容:
 
在FastEthernet0/1接口上配置NAT外部接口:

interface FastEthernet0/1
 ip nat outside

配置NAT转换表项将33.33.33.1映射为192.168.1.1和192.168.2.1:

ip nat inside source static 192.168.1.1 33.33.33.1
ip nat inside source static 192.168.2.1 33.33.33.1

配置ACL允许内部网络的主机访问互联网:

access-list 1 permit 192.168.1.0 0.0.0.255
access-list 1 permit 192.168.2.0 0.0.0.255

在NAT配置中指定使用ACL 1允许内部网络的主机访问互联网:

ip nat inside source list 1 interface FastEthernet0/1 overload

这些配置将启用NAT,并允许内部网络的主机通过右边的路由器访问互联网。
 
希望这些信息能帮助到您。如果对您有所帮助,望采纳。