配置静态地址转换------发布公司内网网站到互联网上
来源:互联网 发布:linux防火墙配置详解 编辑:程序博客网 时间:2024/06/06 00:35
拓扑图如下:
第1步:配置路由器R1启用的端口信息
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R1
R1(config)#int fa0/0
R1(config-if)#ip add 192.168.10.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#int se2/0
R1(config-if)#ip add 61.135.99.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
R1(config-if)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1#
第1步:配置路由器R2启用的端口信息
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R2
R2(config)#int se3/0
R2(config-if)#ip add 61.135.99.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#
%LINK-5-CHANGED: Interface Serial3/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to up
R2(config-if)#int fa1/0
R2(config-if)#ip add 61.135.100.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
R2(config-if)#end
R2#
%SYS-5-CONFIG_I: Configured from console by console
R2#
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R2#
第2步:配置路由器R1的静态路由
R1>en
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 61.135.100.0 255.255.255.0 61.135.99.2
R1(config)#exit
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
61.0.0.0/24 is subnetted, 2 subnets
C 61.135.99.0 is directly connected, Serial2/0
S 61.135.100.0 [1/0] via 61.135.99.2
C 192.168.10.0/24 is directly connected, FastEthernet0/0
R1#
第2步:配置路由器R2的静态路由
R2>en
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip route 192.168.10.0 255.255.255.0 61.135.99.1
R2(config)#exit
R2#
%SYS-5-CONFIG_I: Configured from console by console
R2#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
61.0.0.0/24 is subnetted, 2 subnets
C 61.135.99.0 is directly connected, Serial3/0
C 61.135.100.0 is directly connected, FastEthernet1/0
S 192.168.10.0/24 [1/0] via 61.135.99.1
R2#
第3步:测试PC1可以访问Web Server,而现实中在公网地址上输入企业网络的私有地址是不能访问的
http://192.168.10.2
所以在公网上还是使用公网地址访问企业内网私有地址是一种不错的选择
第4步:配置内网地址转换(内网地址转公网地址)
R1>en
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int fa0/0
R1(config-if)#ip nat inside
R1(config-if)#int se2/0
R1(config-if)#ip nat outside
R1(config-if)#exit
R1(config)#ip nat inside source static 192.168.10.2 61.135.99.3
R1(config)#exit
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 61.135.99.3 192.168.10.2 --- ---
R1#
第5步:在公网上测试企业内网的WEB服务器
http://61.135.99.3
在WEB Server被访问后,再一次查看路由器R1内网转换信息
R1#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 61.135.99.3 192.168.10.2 --- ---
tcp 61.135.99.3:80 192.168.10.2:80 61.135.100.2:1027 61.135.100.2:1027
R1#
测试结果表明静态地址转换配置完全成功。
如果使用网址访问网站就需要申请域名,填写静态公网地址IP就填写61.135.99.3即可。
- 配置静态地址转换------发布公司内网网站到互联网上
- 对于将开发的网站发布到互联网上的理解(针对公司)
- 内网如何建网站,并将网站发布到互联网
- HUAWEI USG 静态地址转换--网内
- 在服务器上配置git并且自动发布到网站
- 关于将个人网站发布到互联网
- 公司内部,怎么修改内网ip地址,即私有地址,并且可以上公网即互联网?
- 普通电脑做服务器,低配置不是问题,问题是如何发布网站应用到互联网
- 路由器配置静态的NAT地址转换
- VS2010网站发布到服务器上
- 怎么把做好的网站发布到互联网上去
- [置顶] 如何发布你的网站到互联网
- Tomcat的安装与应用--------发布网站到互联网
- CentOS上配置静态IP地址
- 网站内嵌百度地图定向到公司位置
- 鱼和熊掌如何兼得——公司内网和外网(互联网)如何同时上?
- 互联网公司--技术分享网站
- 如何发布内网网站到外网
- FAFU 1072 - 组合(深度优先)
- H.264 格式
- Socket学习-Socket基础
- codesign error:code signing is required product type 'application' in sdk 'ios 7'错误解决办法(已验证)
- CString/string 区别及其转化
- 配置静态地址转换------发布公司内网网站到互联网上
- HDU--杭电--2303--The Embarrassed Cryptographer--暴力爆菊花
- Activity not started, its current task has been brought to the front
- 利用ServerSocket获取浏览器http协议内容
- Android 打包签名 怎样生成keystore到完成签名
- linux下查看磁盘空间
- sgu143 树形DP Long Live the Queen
- 拒绝平庸!一本IT届的“神书”,不得不看!
- Working Practice-工作量完成情况趋势图说明开发进展情况