GNS3 nat 配置问题

网络工程 思科 路由 路由器 纳特 GNSS3
2021-07-25 21:35:03

我正在为我的 CCENT 考试而学习,我正在尝试练习 NAT 的配置。

在此处输入图片说明

R1配置:

Building configuration...

Current configuration : 1211 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.100.1 255.255.255.0
 duplex auto
 speed auto
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface FastEthernet2/0
 ip address 200.2.2.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet3/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 200.2.2.3
!
!
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end

R4配置:

Building configuration...

Current configuration : 845 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
!
interface FastEthernet0/0
 ip address 200.2.2.3 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet1/0
 ip address 200.2.0.1 255.255.255.0
 duplex auto
 speed auto
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 200.2.2.2
!
!
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end

我还没有设置NAT,但是PC3可以ping通PC1和PC2,你能解释一下为什么吗?我认为如果没有 NAT,私有 IP 将无法与公共通信。我应该创建什么配置才能练习 NAT?

1个回答

IP 中没有定义公共和私有寻址的内在内容。对于 IP,所有 IP 寻址都是有效的,因此您的路由器将很乐意在您认为是公共寻址和私有寻址之间进行路由。ISP 已同意不在公共 Internet 上路由(任意)分配的私有地址。您可以通过在您的路由器(R4,如果那是您的“ISP”路由器)上放置 ACL 来模拟这一点,以阻止在您的“公共”网络上路由私有地址。

在任何情况下,您仍然可以在 R1 上设置 NAT 来练习使用 NAT,即使路由在您的“私有”和“公共”寻址之间工作。只需配置您的内部和外部接口,然后配置您的 NAT。