码迷,mamicode.com
首页 > 其他好文 > 详细

如何实现私有地址访问外网(华为)

时间:2018-01-15 11:19:23      阅读:530      评论:0      收藏:0      [点我收藏+]

标签:water   color   1.0   interface   undo   ace   子网   alt   route   

技术分享图片
操作步骤及思路:
一.分别给pc1,pc2配上ip地址,子网掩码,网关
#pc1
ip:192.168.1.1
子网掩码:255.255.255.0
网关:192.168.1.254
pc2
ip:192.168.1.2
子网掩码:255.255.255.0
网关:192.168.1.254
二.在路由1上配置网关
interface ge0/0/0
undo shutdown //激活端口
ip address 192.168.1.254 255.255.255.0
interface g0/0/1
ip address 10.1.1.1 255.255.255.0
三.在路由2上配置ip
interface ge0/0/0
undo shutdown //激活端口
ip address 10.1.1.2 255.255.255.0
interface g0/0/1
undo shutdown //激活端口
ip address 192.168.20.1.1.1
四.在路由3上配置ip
interface g0/0/0
undo shutdown //激活端口
ip address 20.1.1.2 255.255.255.0
五.在路由1中设置默认路由让它能发包过去
ip route 0.0.0.0 0.0.0.0 10.1.1.2
六.让其他两个路由器自己学习
路由2:
rip //启用rip路由协议
version 2 //使用rip2版本
network 10.0.0.0
network 20.0.0.0 进入rip协议
路由3:
rip //启用rip路由协议
version 2 //使用rip2版本
network 20.1.1.0 进入rip协议
七.在路由1把私有地址转化为公有地址
1.定义感兴趣的流量
acl 2000
rule 5 permit source 192.168.1.0 0.0.0.255
2.在流量的出端口配置NAT
interface ge0/0/1
nat outbound 2000-->在该端口上发送出去,并且被 ACL 2000
匹配的流量,其中的源IP地址转换为该
接口的IP地址;
八.在pc机上验证
在两台pc机上ping 20.1.1.2 拼外网看能成功否

如何实现私有地址访问外网(华为)

标签:water   color   1.0   interface   undo   ace   子网   alt   route   

原文地址:http://blog.51cto.com/13568840/2060929

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!