目录

HCIA-NAT实验

目录

HCIA-NAT实验

https://i-blog.csdnimg.cn/direct/a8c9a8c1f33c4bccb2998a157863791b.png

内部底层实现互通

需求:实现内网到外网的通信

与外网的配置

AR1:interface GigabitEthernet0/0/2

ip address 202.100.1.1 255.255.255.0

ospf 1

default-route-advertise

ip route-static 0.0.0.0 0.0.0.0 202.100.1.2

AR4:

interface GigabitEthernet0/0/0

ip address 202.100.1.2 255.255.255.0

interface GigabitEthernet0/0/1

ip address 200.1.1.2 255.255.255.0

interface GigabitEthernet0/0/2

ip address 100.1.1.2 255.255.255.0

一、配置ACL匹配上网路由(AR1)

acl number 2000

rule 5 permit source 192.168.1.0 0.0.0.255

rule 10 permit source 192.168.2.0 0.0.0.255

二、配置NAT进行地址转换

1、 easy-ip 出接口转换

①配置(AR1)

interface GigabitEthernet0/0/2

nat outbound 2000

②查看

https://i-blog.csdnimg.cn/direct/e51ef59d2d604788b1dd93aa9fd406da.png

③验证:内部能ping通外部202.100.1.2的地址

https://i-blog.csdnimg.cn/direct/f5aa2b4f34c347448387e94f587b8bf4.png

2、地址池转换–NAPT,增加需求PC4不可以上网

①配置,按从小到大顺序匹配,所以先拒绝192.168.2.1,再允许192.168.2.0/24的其他IP可以上网

acl number 2000

rule 5 permit source 192.168.1.0 0.0.0.255

rule 10 deny source 192.168.2.1 0

rule 15 permit source 192.168.2.0 0.0.0.255

nat address-group 1 202.100.1.3 202.100.1.10

interface GigabitEthernet0/0/2

nat outbound 2000 address-group 1

②查看

https://i-blog.csdnimg.cn/direct/a66aafff990343c49fd03a6dd6ba9485.png

③验证:增加需求PC4不可以上网,其他网段正常上网

https://i-blog.csdnimg.cn/direct/feb92d7b22ff4cedb48d5c947c8aacee.png

https://i-blog.csdnimg.cn/direct/ccd598a0e67544f79d61b6a444ccab4b.png

https://i-blog.csdnimg.cn/direct/57e0c0cc6ced41eea5df08fff4964bbd.png

需求:将内网服务器映射到公网,公网通过公网地址访问内网服务

nat server

①配置

interface GigabitEthernet0/0/2

nat server protocol tcp global current-interface 1111 inside 192.168.1.2 ftp

nat server protocol tcp global current-interface 2222 inside 192.168.1.2 www

②查看

https://i-blog.csdnimg.cn/direct/1bde0446d7c04d1d9841900e8d0ea756.png

③测试

https://i-blog.csdnimg.cn/direct/ac87146f8b0e4878813f25eabd12e626.png

https://i-blog.csdnimg.cn/direct/c3edac4529e84130a5f2f4b9d5eaee77.png