我已经建立了一个包含4个VLAN、3个VLAN配置的PAT和1个VLAN配置的静态NAT的网络。路由器充当DHCP服务器。在我的路由器之外,我有另一个路由器充当“互联网”,ip地址为172.16.10.1 /24。
一切都很好,我可以在VLAN1上成功地执行静态NAT,但是当我尝试在VLAN2、VLAN3 &上进行PAT配置时,它就不能工作了。下面是我的路由器配置:
Building configuration...
Current configuration : 1578 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R1
!
!
!
!
!
!
!
!
no ip cef
no ipv6 cef
!
!
!
username admin password 0 123
!
!
license udi pid CISCO1941/K9 sn FTX1524C1YC-
!
!
!
!
!
!
!
!
!
ip ssh version 1
ip domain-name test.com
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0
ip address 192.168.0.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface GigabitEthernet0/0.2
encapsulation dot1Q 2
ip address 192.168.2.1 255.255.255.0
ip nat inside
!
interface GigabitEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
ip access-group 1 in
ip nat inside
!
interface GigabitEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
ip nat inside
!
interface GigabitEthernet0/0.30
encapsulation dot1Q 30
ip address 192.168.30.1 255.255.255.0
ip nat inside
!
interface GigabitEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/1/0
ip address 100.10.10.1 255.255.255.240
ip nat outside
!
interface Serial0/1/1
no ip address
clock rate 2000000
shutdown
!
interface Vlan1
no ip address
shutdown
!
router rip
!
ip nat pool route 100.10.10.100 100.10.10.100 netmask 255.255.255.240
ip nat inside source list 1 pool route overload
ip nat inside source static 192.168.2.254 100.10.10.3
ip classless
ip route 0.0.0.0 0.0.0.0 100.10.10.2
!
ip flow-export version 9
!
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login local
transport input ssh
!
!
!
end谢谢
发布于 2020-07-20 17:55:29
假设您希望使用VLAN 3和VLAN 4作为您的LAN网络,并且希望为internet访问配置pat NAT,并假设VLAN 1用于DMZ网络来承载需要静态NAT的应用程序。
路由器子接口的配置。例如,在路由器子接口配置中:
Int g0/0.3
Encapsulation dot1Q 3
Ip address 192.168.2.1 255.255.255.0
Ip nat inside
No shutdown
Int g0/0.4
Encapsulation dot1Q 4
Ip address 192.168.10.1 255.255.25&.0
Ip nat inside
No shutdown端口地址转换总是出站通信量。
Router(config) access-list 1 permit ip 192.168.2 .0 0.255.255.255
Router(config) access-list 1 permit ip 192.168.10.0 0.255.255.255
Router(config) ip nat inside source list 1 interfàce serial 0/1/0 overload 帕特是来源地。当流量从内到外(出站流量)时,源私有IP被转换到接口S0/1/0的地址。
假设内部服务器位于VLAN1上,并假定IP为192.168.0.5:
ISP的公共IP为: 100.10.10.5
Router(config)# ip nat inside source static 192.168.0.5 100.10.10.5 静态NAT大多被认为是目标NAT。
https://networkengineering.stackexchange.com/questions/69128
复制相似问题