一、NAT基本概念
二、具体实验步骤
1.具体实施
2.端口映射
一、NAT基本概念
1.nat技术静态,就是不动,不变,需要手动修改。
动态nat实现私有地址和共有地址的转换
natp:网络地址端口转换napt允许多个内部地址映射到同一个公有地址的不同端口
Easy IP:允许将多个内部地址映射到网关出接口地址上的不同端口
二、具体实验步骤
1.具体实施
进入端口配置端口信息,然后配置动态nat,并在接口处启用nat(可以抓包看一下地址池的变化)
[Huawei]acl 3000 #创建高级策略 [Huawei-acl-adv-3000]rule p [Huawei-acl-adv-3000]rule permit ip s [Huawei-acl-adv-3000]rule permit ip source 192.168.1.0 0.0.0.255 [Huawei-acl-adv-3000]q [Huawei]int g0/0/2 [Huawei-GigabitEthernet0/0/2]nat outbound 3000 #设置IP转换规则,调用ACL的规则来筛选允许进行地址转换的IP网段
然后用pc1ping12.0.0.10并抓包看一下
2.端口映射
从192.168.1.254:80指向12.0.0.10:80
[Huawei]int g0/0/0 #进入端口 [Huawei-GigabitEthernet0/0/0]int g0/0/1 [Huawei-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 80 inside 12.0.0.10 80 #所有的访问 ip地址 192.168.1.254:80就相当于访问 12.0.0.10:80 nat server protocol tcp 指定nat服务的协议,使用的是tcp global current-interface 80 指定了全局的接口,192.168.1.254 以及服务的端口 inside 12.0.0.10 80:映射,192.168.1.254:80=12.0.0.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 #确认