
预配置如下:
[r1]
#
sysname r1
#
interface Serial1/0
ip address 20.0.0.1 255.255.255.0
nat server protocol tcp global 20.0.0.21 23 inside 10.1.1.1 23
#
interface GigabitEthernet0/1
port link-mode route
combo enable copper
ip address 10.1.1.254 255.255.255.0
#
return
[r3server]
#
sysname r3server
#
telnet server enable
#
interface GigabitEthernet0/1
port link-mode route
combo enable copper
ip address 10.1.1.1 255.255.255.0
#
ip route-static 0.0.0.0 0 10.1.1.254
#
return
[r7isp]
#
sysname r7isp
#
interface Serial1/0
ip address 20.0.0.100 255.255.255.0
#
return
需求场景 外部访问内部资源时,将外部源地址转换为内部地址
公网r7isp (200.0.0.100),访问内网r3server对外提供的WEB服务时,在路由器r1上配置外部源地址转换,将200.0.0.100的源地址转换为10.1.1.100
配置如下:
[r1]
#
interface GigabitEthernet0/1
port link-mode route
combo enable copper
ip address 10.1.1.254 255.255.255.0
nat outbound name r7isp address-group 10
#
acl basic name r7isp
rule 0 permit source 20.0.0.100 0
#
nat address-group 10
address 10.1.1.100 10.1.1.100
#
return
验证:通过在r7isp 使用telnet 命令测试r3server web服务
r7isp上通过telnet 20.0.0.21 进行测试

r1 通过display nat session verbose 命令进行验证,查看源地址 20.0.0.100 已转换为地址 10.1.1.100

r3server 通过terminal debugging和debugging telnet client命令开启telnet debug功能,在r7isp上再次telnet 20.0.0.21 进行测试验证
