实验要求:
1、R2为IsP设备只能在该设备上配置ip地址,不得在进行其他任何配置
2 、1.1-1.0/24网段代表整个互联网的所有网段;
3、Pc1可以正常ping Pc2
4、R1仅拥有一个公有ip地址,在G0/0/1接口上
5、CLIENT可以通过http访问到两台server
6、 client在访问其他一台server通过域名
配置IP
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip address 12.1.1.1 24
[r1-GigabitEthernet0/0/1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[r2-GigabitEthernet0/0/0]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip address 1.1.1.1 24
定义私有地址
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
出接口调用:
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]na outbound 2000
设置端口映射
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 80 inside 192.168.1.3 80
Warning:The port 80 is well-known port. If you continue it may cause function failure.
Are you sure to continue?[Y/N]:y
[r1-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 8888 inside 192.168.1.4 80
配置静态路由,实现全网可达
[r1]ip route-static 1.1.1.0 24 12.1.1.2
[r2]ip route-static 192.168.1.0 12.1.1.1
配置缺省路由:
[r1]ip route-static 0.0.0.0 0 12.1.1.2
配置