ACL与NAT综合实验

实验需求

  1. R2为IsP设备:只能在该设备上配置ip地址,不得在进行其他任何配置
  2. 1.1.1.0/24网段代表整个互联网的所有网段;
  3. Pc1可以正常pingPc2
  4. R1仅拥有一个公有ip地址,在G0/0/1接口上
  5. CLIENT可以通过http访问到两台server
  6. client在访问其他一台server通过域名

实验拓扑

ACL与NAT综合实验_第1张图片

实验分析

  1. 因为不能在R2上配置除IP之外的其他东西,所以需要用到ACL与NAT,使数据包可以返回
  2. 要使G0/0/0下的所有设备都能访问1.1.1.0/24,需要在AR1上写一个缺省路由指向AR2,并且需要使用PAT端口地址转换
  3. 使用端口映射让client能通过http访问到两台server
  4. 需要将一台server的端口号改为8888
  5. 将AR2下的服务器设为DNS域名解析服务器,并解析AR1下的其中一台服务器

实验配置

 1.从两台路由器开始配置所有ip地址

AR1的配置

ACL与NAT综合实验_第2张图片

AR2的配置

 PC1的配置

ACL与NAT综合实验_第3张图片

PC2的配置

ACL与NAT综合实验_第4张图片 

DNS

 

http1

 

http2

ACL与NAT综合实验_第5张图片

client 

ACL与NAT综合实验_第6张图片 

4.在AR1上写缺省路由

[AR1]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2

3.在AR1上配置ACL和NAT

[AR1]acl    
[AR1]acl 2000    
[AR1-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[AR1-acl-basic-2000]int g 0/0/1
[AR1-GigabitEthernet0/0/1]nat outbound 2000


[AR1-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 80 in
side 192.168.1.10 80
Warning:The port 80 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y
[AR1-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 8888 in
side 192.168.1.20 80
Warning:The port 80 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y

4.启动http1与http2的HttpServer

5.启动DNS的DNSServer,配置其解析的服务器为http1

ACL与NAT综合实验_第7张图片

 

验证

PC1 ping PC2

ACL与NAT综合实验_第8张图片

 Client访问两台server

ACL与NAT综合实验_第9张图片

ACL与NAT综合实验_第10张图片

client通过域名访问server1

ACL与NAT综合实验_第11张图片 

 

game over

你可能感兴趣的:(网络协议)