1 案例1:配置目前网络环境
1.1 问题
一家新创建的IT公司,公司位于北京有80多台服务器
目前网络环境使用技术,通过端口映射技术将web服务器发布给Internet:
- 三层交换:汇聚接入层交换机
- 默认路由:实现到互联网数以万计网络访问的简化配置
- 静态路由:实现公司内部网络互通
- NAT端口映射:实现企业内部Web服务器的发布
1.2 方案
通过端口映射技术将web服务器发布给Internet,公司现有网络环境拓扑如图-1所示:

图-1
现有网络连接说明如表-1所示:
表-1 网络连接说明

1.3 步骤
实现此案例需要按照如下步骤进行。
步骤一:根据表-1为设备配置IP地址,并为三层交换机开启路由功能
1)MS1配置vlan1与f0/1接口的IP地址并开启路由功能
- Switch(config)#hostname MS1
- MS1(config)#ip routing
- MS1(config)#interface vlan 1
- MS1(config-if)#ip address 192.168.1.252 255.255.255.0
- MS1(config-if)#no shutdown
- MS1(config-if)#exit
- MS1(config-if)#interface fastEthernet 0/1
- MS1(config-if)#no switchport
- MS1(config-if)#ip address 192.168.2.1 255.255.255.0
- MS1(config-if)#no shutdown
步骤二:为路由器配置IP地址,添加接口模块
1)为路由器添加接口模块并进入路由器接口配置IP地址
- Router(config)#hostname R1
- R1(config)#interface fastEthernet 0/0
- R1(config-if)#ip address 192.168.2.2 255.255.255.0
- R1(config-if)#no shutdown
- R1(config-if)#exit
- R1(config)#interface fastEthernet 1/0
- R1(config-if)#ip address 61.159.62.129 255.255.255.248
- R1(config-if)#no shutdown
步骤三:配置MS1和路由器的静态路由
- MS1(config-if)#ip route 0.0.0.0 0.0.0.0 192.168.2.2
- R1(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1
步骤四:测试server1与R1接口IP的连通性
- PC>ping 192.168.2.2
- Pinging 192.168.2.2 with 32 bytes of data:
- Reply from 192.168.2.2: bytes=32 time=0ms TTL=254
- Reply from 192.168.2.2: bytes=32 time=0ms TTL=254
- Reply from 192.168.2.2: bytes=32 time=0ms TTL=254
- Reply from 192.168.2.2: bytes=32 time=1ms TTL=254
- Ping statistics for 192.168.2.2:
- Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
- Approximate round trip times in milli-seconds:
- Minimum = 0ms, Maximum = 1ms, Average = 0ms
- PC>ping 61.159.62.129
- Pinging 61.159.62.129 with 32 bytes of data:
- Reply from 61.159.62.129: bytes=32 time=1ms TTL=254
- Reply from 61.159.62.129: bytes=32 time=0ms TTL=254
- Reply from 61.159.62.129: bytes=32 time=2ms TTL=254
- Reply from 61.159.62.129: bytes=32 time=0ms TTL=254
- Ping statistics for 61.159.62.129:
- Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
- Approximate round trip times in milli-seconds:
- Minimum = 0ms, Maximum = 2ms, Average = 0ms
步骤五:R1配置端口映射
- R1(config)#ip nat inside source static tcp 192.168.1.8 80 61.159.62.131 80
- R1(config)#interface fastEthernet 0/0
- R1(config-if)#ip nat inside
- R1(config)#interface f1/0
- R1(config-if)#ip nat outside
步骤六:在PC7上查看是映射结果,如图-2所示
图-2
2 案例2:项目阶段练习
2.1 问题
现有网络问题分析:
- 接入层交换机只与同一个三层交换机相连,存在单点故障而影响网络通信。
- 互联网连接单一服务商
现有网络需求:
- 随着企业发展,为了保证网络的高可用性,需要使用很多的冗余技术。
- 保证局域网络不会因为线路故障而导致的网络故障。
- 保证客户端机器不会因为使用单一网关而出现的单点失败。
- 保证到互联网的高可用接入使用冗余互联网连接。
- 提高网络链路带宽。
2.2 方案
基于项目的需求,需要用到如下技术:
- STP:解决二层环路带来的广播风暴并链路冗余问题
- 以太网通道:提高网络链路带宽
- RIP路由协议:实现网络路径的自动学习
- HSRP:实现网关冗余
重新规划后的网络拓扑如图-3:
图-3
重新规划后网络连接说明如表-2与表-3所示:
表-2 网络连接说明
表-3 网络连接说明(续)
2.3 步骤
实现此案例需要按照如下步骤进行。
步骤一:静态路由升级动态路由。
1)R1删除静态路由并配置rip
- R1(config)#no ip route 192.168.1.0 255.255.255.0 192.168.2.1
- R1(config)#router rip
- R1(config-router)#version 2
- R1(config-router)#no auto-summary
- R1(config-router)#network 192.168.2.0
- R1(config-router)#default-information originate
2)MS1上删除静态路由并配置rip
- MS1(config)#no ip route 0.0.0.0 0.0.0.0 192.168.2.2
- MS1(config)#router rip
- MS1(config-router)#version 2
- MS1(config-router)#no auto-summary
- MS1(config-router)#network 192.168.1.0
- MS1(config-router)#network 192.168.2.0
3)在MS1上查看路由表
- MS1#show ip route
- Codes: C - connected, S - static