Day19-01综合实验

前言:这个综合实验花费了我大概五天的时间,由于自己的粗心的问题老是有一些错误,本来不想写文章的感觉代码好多,但是咬咬牙还是写了,就当是记录自己这五天的坚持。这个综合实验中我出现的问题是热备份时那两个路由器没有配置通往内网的路由条目下一跳地址是192.168.5.254,以及三层交换机中vlan60就没有开启,更没有设置ip地址,没有把三层交换机连接热备份的那两个路由器的端口sw ac vlan 60,把他俩配成了trunk,三层交换机没有配置到内网的路由条目以及ip route 0.0.0.0 0.0.0.0 192.168.5.250,还有就是NAT命令不熟悉,ACL不熟悉。
要求:(互联网中的路由不允许配置去往私网地址的路由)
1.整个内网(总部与分公司)内部全部互通,并内网全部可以上网,其中北京总部员工要要求自动获取IP地址
验证上网方法,所以员工可以通过域名http://www.baidu.com来访问百度网站
其中上网过程中,要求断掉拓扑中的1、2、3、4号线任何一根,不断网
2.将总部内网的web服务器发布出去,并成功在外网的pc访问网站
3.要求市场部禁止上网
4.禁止任何部门(服务器除外),访问财务部,但不影响财务部上网
5.要求所有分公司只能访问总部的服务器区及上网

1.配置路由
Router0:
en
conf t
int f0/0
ip add 172.16.1.254 255.255.255.0
no sh
exit
int f0/1
ip add 10.1.1.1 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 10.1.1.2
Router1:
en
conf t
int f0/0
ip add 172.16.2.254 255.255.255.0
no sh
exit
int f0/1
ip add 10.2.2.1 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 10.2.2.2
Router2:
en
conf t
int f0/0
ip add 10.2.2.2 255.255.255.0
no sh
exit
int f0/1
ip add 10.1.1.2 255.255.255.0
no sh
exit
int f1/0
ip add 10.3.3.1 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 10.3.3.2
ip route 172.16.1.0 255.255.255.0 10.1.1.1
ip route 172.16.2.0 255.255.255.0 10.2.2.1
Router3:
en
conf t
int f0/0
ip add 10.3.3.2 255.255.255.0
no sh
exit
int f0/1
ip add 192.168.8.1 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 192.168.8.2
ip route 10.1.1.0 255.255.255.0 10.3.3.1
ip route 10.2.2.0 255.255.255.0 10.3.3.1
ip route 172.16.1.0 255.255.255.0 10.3.3.1
ip route 172.16.2.0 255.255.255.0 10.3.3.1
2)给pc1和pc2配IP、DNS指向外网的DNS服务器,以便将来可以通过域名访问外网的web服务器
pc0:
ip:172.16.1.1
子网掩码:255.255.255.0
网关:172.16.1.254
DNS:140.1.1.1
pc1:
172.16.2.1
255.255.255.0
172.16.2.254
140.1.1.1
测试pc0:ping 172.16.2.1可通
2.实现总公司内部网络联通与分公司的网络连通
1)trunk
switch2:
en
conf t
int f0/1
sw mo tr
switch3:
en
conf t
int f0/1
sw mo tr
switch 4:
en
conf t
int f0/1
sw mo tr
三层交换机:
en
conf t
int range f0/1 - 3
sw tr en dot
sw mo tr
ex
2)vtp与valn
三层交换机:
en
conf t
vtp do test
vlan 10
vlan 20
vlan 30
vlan 40
vlan 50
vlan 60
ex
int f0/5
sw ac vlan 60
int f0/6
sw ac vlan 60
ex
int vlan 10
ip add 192.168.1.254 255.255.255.0
no sh
int vlan 20
ip add 192.168.2.254 255.255.255.0
int vlan 30
ip add 192.168.3.254 255.255.255.0
int vlan 40
ip add 192.168.4.254 255.255.255.0
int vlan 50
ip add 192.168.5.254 255.255.255.0
int vlan 60
ip add 192.168.6.254 255.255.255.0
no sh
exit
switch2:
int f0/2
sw ac vlan 10
ex
int f0/3
sw ac vlan 20
ex
switch3:
int f0/2
sw ac vlan 30
ex
int f0/3
sw ac vlan 40
ex
switch4:
int f0/2
sw ac vlan 50
ex
int f0/3
sw ac vlan 50
ex
3)配置路由
三层交换机:
en
conf t
ip routing
int f0/4
no sw
ip add 192.168.8.2 255.255.255.0
no sh
ex
ip route 172.16.1.0 255.255.255.0 192.168.8.1
ip route 172.16.2.0 255.255.255.0 192.168.8.1
ip route 10.1.1.0 255.255.255.0 192.168.8.1
ip route 10.2.2.0 255.255.255.0 192.168.8.1
ip route 10.3.3.0 255.255.255.0 192.168.8.1
4)配置DHCP服务器:
三层交换机:
int valn 10
ip helper 192.168.5.1
int valn 20
ip helper 192.168.5.1
int valn 30
ip helper 192.168.5.1
int valn 40
ip helper 192.168.5.1
server0:
DHCP:
vlan 10
192.168.1.254
140.1.1.1
192.168.1.0
255.255.255.0
Add
vlan 20
192.168.2.254
140.1.1.1
192.168.2.0
255.255.255.0
Add
vlan 30
192.168.3.254
140.1.1.1
192.168.3.0
255.255.255.0
Add
vlan 40
192.168.4.254
140.1.1.1
192.168.4.0
255.255.255.0
Add
然后把pc的IP获取方式改为dhcp获取IP地址即可,获取IP后全公司网段即可互通
测试:用pc2 ping上海分公司的pc
pc2: ping 172.16.1.1
3)内外网互通
1.配置HSRP(热备份)
在这里插入图片描述Router4:
配置其为活跃路由器,自己的IP:192.168.6.252,指向的虚拟路由器192.168.6.250
走内网的数据路由器的下一跳地址:192.168.6.254
en
conf t
int f0/0
ip add 192.168.2.252 255.255.255.0
no sh
standby 1 ip 192.168.6.250
standby 1 pri 200
standby 1 pree
standby 1 track f0/1
ex
int f0/1
ip add 100.1.1.1 255.255.255.0
no sh
ex
ip route 192.168.0.0 255.255.0.0 192.168.6.254
Router5:
配置其为备份路由器,自己的IP:192.168.6.253,指向的虚拟路由器192.168.6.250
走内网的数据路由器的下一跳地址:192.168.6.254
en
conf t
int f0/0
ip add 192.168.2.253 255.255.255.0
no sh
standby 1 ip 192.168.6.250
standby 1 pri 195
standby 1 pree
standby 1 track f0/1
ex
int f0/1
ip add 110.1.1.1 255.255.255.0
no sh
ex
ip route 192.168.0.0 255.255.0.0 192.168.6.254
2)配置路由:
三层交换机:
ip route 0.0.0.0 0.0.0.0 192.168.6.250
Router6:
en
conf t
int f0/0
ip add 100.1.1.2 255.255.255.0
no sh
int f0/1
ip add 110.1.1.2 255.255.255.0
no sh
int f1/0
ip add 130.1.1.1 255.255.255.0
no sh
int f1/1
ip add 120.1.1.254 255.255.255.0
no sh
ip route 140.1.1.0 255.255.255.0 130.1.1.2
Router7:
en
conf t
int f0/0
ip add 130.1.1.2 255.255.255.0
no sh
int f0/1
ip add 140.1.1.254 255.255.255.0
ip route 0.0.0.0 0.0.0.0 130.1.1.1
laptop0:
120.1.1.1
255.255.255.0
120.1.1.254
140.1.1.1
3)NAT
Router4:
int f0/0
ip nat inside
ex
int f0/1
ip nat outside
ex
acc 1 permit 192.168.0.0 0.0.255.255
acc 1 permit 172.16.0.0 0.0.255.255
ip nat inside source list 1 int f0/1 overload
Router5:
int f0/0
ip nat inside
ex
int f0/1
ip nat outside
ex
acc 1 permit 192.168.0.0 0.0.255.255
acc 1 permit 172.16.0.0 0.0.255.255
ip nat inside source list 1 int f0/1 overload
测试:使用分公司的pc ping140.1.1.1
pc0:ping -t 140.1.1.1
断开1、2、3、4任意一条还可联通
4.网站发布
百度web服务器的搭建不再概述,重点说公司内部网站如何发布出去
server3:HTTP启用index.html—edit
1)再控制公司内外网的路由器上做静态NAT,选择router4,新公司IP为:100.1.1.3,只允许80端口的数据通过
Router4:
ip nat inside source static tcp 192.168.5.2 80 10.1.1.3 80
2)配置DNS服务器:
百度的DNS服务器
注意:这里回出现一个新的问题:我们公司内部的pc访问公司的网站,我们给公司的员工全都指向了140.1.1.1,如果公司的员工输入域名,获取到的IP地址是100.1.1.3,而我们公司的员工又在内网,无法通过NAT转化IP
解决方法:
再申请一个域名,也就是qf.com,让他的IP指向192.168.5.2,这样员工在公司就可以通过qf.com去上网了
以上是:在实际环境下的解决方案,在现实中,一般公司有自己的DNS服务器,公司内部所有的员工都指到公司自己的DNS服务器,我们只要把这个DNS服务器设置转发器到外网的DNS服务器,这样就可以解决上述问题了。(自己有的直接发出去,没有的找外网大哥)
server2:
140.1.1.1
255.255.255.0
140.1.1.254
140.1.1.1
DNS-www.qf.com 100.1.1.3
qf.com 192.168.5.2
www.baidu.com 140.1.1.1
测试公司内部:www.qf.com
qf.com
外网pc:www.qf.com
5.通过ACL包过滤技术对网络流量进行控制
1)要求市场部禁止上网
因为制药企业市场部不能上网,也就是不能与外网联通,只需要在vlan60网段编写策略:阻止市场部的流量发出即可
ip acc ex kz-scb
deny ip 192.168.1.0 0.0.0.255 any
permit ip any any
ex
int vlan 60
ip access-group kz-scb out
市场部测试:ping 192.168.2.1 可ping通内网
ping 140.1.1.1 不能ping通外网
2)禁止总部任何部门(服务器除外)访问财务部,但不影响财务部上网
只需要在财务部所在的网段也就是vlan40编写策略:阻止vlan10,vlan20,vlan30网段的流量进入,最后允许即可
ip acc ex kz-cwb
deny ip 192.168.1.0 0.0.0.255 192.168.4.0 0.0.0.255
deny ip 192.168.2.0
deny ip 192.168.3.0
permit any any
int vlan 40
ip access-group kz-cwb in
ex
使用财务部pc测试:
外网可ping通 ping 140.1.1.1
vlan10不通:ping 192.168.1.1
3)要求所有分公司只能访问总部的服务器区及上网
服务器可通:ping 192.168.5.1
总部非服务器不可达:ping 192.168.1.1
外网可通:ping 140.1.1.1

在这里插入图片描述在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述在这里插入图片描述
在这里插入图片描述在这里插入图片描述在这里插入图片描述

综合实验的资源在这里,还是有一点小问题就是公司内部无法ping通140.1.1.1,明天再看看是哪里的问题。这是综合实验资源的链接:https://pan.baidu.com/s/1i-tgYXEynixg-ObngWbHIA
提取码:4ea0

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

想成为前端工程师滴小小白

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值