要求:

1,跨VLAN,三个教室在不同的VLAN中,翻番至网络风暴

2,三个VLAN在三个不同的网段

3,设置访问控制列表,组织每个网段的前八个IP不可访问服务器

4,其他IP均可访问外网的服务器

操作步骤:

(启用路由)

1.设置IP(为pc设置ip)(1.1 1.11 2.1 2.11 3.1  3.11 网关分别为:1.254 2.254 3.254)

2.设置三层交换机(具有路由功能)

(1)划分VLAN(VLAN10,VLAN20,VLAN30)

Switch>en
Switch#conf
Switch(config)#vlan
Switch(config-vlan)#e
Switch(config)#vlan
Switch(config-vlan)#e
Switch(config)#vlan

(2)位VLAN分配ip(是pc的网关)

   vlan 10:192.168.1.254

  vlan 20:192.168.2.254

  vlan 30:192.168.3.254

  (先启用 no shut)vlan 1:192.168.4.254

Switch(config)#inter vlan
Switch(config-if)#ip add 192.168.1.254 255.255.255.0
Switch(config-if)#inter vlan
Switch(config-if)#ip add 192.168.2.254 255.255.255.0
Switch(config-if)#inter vlan
Switch(config-if)#ip add 192.168.3.254 255.255.255.0
Switch(config)#inter vlan 1 Switch(config-if)#ip add 192.168.4.254 255.255.255.0
Switch(config-if)#no shut

(3)为VLAN分配接口:

f(0/1)VLAN10

  f(0/2)vlan 20

  f(0/3) vlan 30

  f(0/4) vlan 1(默认的)

Switch(config-if)#inter f /
Switch(config-if)#sw acc vlan
Switch(config-if)#inter f /
Switch(config-if)#sw acc vlan
Switch(config-if)#inter f /
Switch(config-if)#sw acc vlan

(4)启用路由器(ip routing)

Switch(config-if)#ex
Switch(config)#ip routing

3.设置路由器

  (1)设置端口ip(f0/0 4.1  f1/0 202.1.1.1)

Router(config-if)#inter f /
Router(config-if)#ip add 192.168.4.1 255.255.255.0
Router(config-if)#inter f /
Router(config-if)#ip add 202.1.1.1 255.255.255.0

  (2)设置服务器ip(202.1.1.2  202.1.1.1)

(地址转换设置)

  (1)声明内外网(借口 F0/0 内网 F1/0外网)

Router(config-if)#inter f /
Router(config-if)#ip nat in
Router(config-if)#inter f /
Router(config-if)#ip nat out

  (2)配置路由表

    三层交换机:

Switch(config)#route rip
Switch(config-router)#netw 192.168.1.0
Switch(config-router)#netw 192.168.2.0
Switch(config-router)#netw 192.168.3.0
Switch(config-router)#netw 192.168.4.0

    路由器:

Router(config-if)#route rip
Router(config-router)#netw 192.168.4.0
Router(config-router)#netw 192.168.5.0

  (3)设置nat表

Switch(config)#ip nat inside source static 192.168.1.1 202.1.1.3
Switch(config)#ip nat inside source static 192.168.1.11 202.1.1.4
Switch(config)#ip nat inside source static 192.168.2.1 202.1.1.5
Switch(config)#ip nat inside source static 192.168.2.11 202.1.1.6
Switch(config)# ip nat inside source static 192.168.3.1 202.1.1.7
Switch(config)# ip nat inside source static 192.168.3.11 202.1.1.8

    192.168.1.1 202.1.1.3

    192.168.1.11 202.1.1.4

    192.168.2.1 202.1.1.5

    192.168.2.11 202.1.1.6

    192.168.3.1 202.1.1.7

    192.168.3.11 202.1.1.8

4.设置三层交换机

  (设置访问控制列表)

Switch(config)#acc  deny ip 192.168.1.1 0.0.0.7 202.1.1.2 0.0.0.255
Switch(config)#acc per ip any any
Switch(config)#acc deny ip 192.168.2.0 0.0.0.7 202.1.1.2 0.0.0.255
Switch(config)#acc per ip any any
Switch(config)#acc deny ip 192.168.3.0 0.0.0.7 202.1.1.2 0.0.0.255
Switch(config)#acc per ip any any

    

将访问控制列表应用到VLAN

Switch(config)#inter vlan
Switch(config-if)# ip acc in
Switch(config-if)#inter vlan
Switch(config-if)#ip acc in
Switch(config-if)#inter vlan Switch(config-if)#ip acc in

5.测试

 192.168.1.1 访问202.1.1.2 访问失败

192.168.1.11 访问202.1.1.2访问成功

模拟教室网络(跨VLAN,跨网段通讯)的更多相关文章

  1. 在eNSP上简单的模拟企业网络场景(不同网段互连)

    额..首先你要有eNSP工具和Wireshark抓包工具,没有的话可以上网搜索一下,最好下载最新版本的,新版本中拥有更多型号的机器 这个实验我们主要模拟某公司购买了新的路由器和交换机.交换机S1连接客 ...

  2. 跨Vlan通信:单臂路由,三层交换机

    实验涉及命令以及知识补充(涉及Vlan通过的以太网口需要设置为Trunk口) 单臂路由 父接口 no ip address :删除实现单臂路由接口的IP no shutdown 虚拟子接口 R2(co ...

  3. Zabbix监控实现跨区域跨网络监控数据

    Zabbix监控实现跨区域跨网络监控数据 环境: 公司现有服务器10台,其中5台服务器有一台安装了zabbix,并且这5台服务器处于一个网络,只有一台服务器有公网ip, 另外的5台处于另一个网络,仅有 ...

  4. 通过Html5的postMessage和onMessage方法实现跨域跨文档请求访问

    在项目中有应用到不同的子项目,通过不同的二级域名实现相互调用功能.其中一个功能是将播放器作为单独的二级域名的请求接口,其他项目必须根据该二级域名调用播放器.最近需要实现视频播放完毕后的事件触发,调用父 ...

  5. Network-Emulator-Toolkit 模拟各种网络环境 windows

    背景.目标.目的 (1) 背景: 我们在使用网络时,时常遇到在正常网络环境下的代码运行一切正常,可以复杂的网络环境下的各种问题无法复现,必须搭建模拟各种网络环境,去复现问题,定位问题.不管是移动平台, ...

  6. html5 postMessage解决iframe跨协议跨域通信问题

    a.html有个iframe载入b.com/login.html,当login完成时通知a.html页面登录完成并传递UserName 1.a.html 监听消息 window.addEventLis ...

  7. iOS模拟各种网络状态

    在iOS开发中我们有在各种不同网络状态下测试app运行状态的需求.苹果给我们提供了在模拟器和真机状态下,模拟各种网络状态的软件. 在模拟器中 苹果提供的模拟网络状态的工具官网地址下载该工具需要登录Ap ...

  8. clumsy模拟客户端网络差的场景的使用

    1.为什么需要模拟客户端网络差的情况? a. 研发环境的网络配置一般较高,网络响应快,不容易出现网络故障,但是客户使用的网络环境千差万别,不排除使用过程中遇到网络故障的情况. b.程序有些时候是多线程 ...

  9. 使用Kernel NetEm和tc模拟复杂网络环境

    关键词:netem(Network Emulator).tc(Traffic Control). 大部分局域网环境良好,但是产品实际网络环境可能千差万别,为了对产品进行各种情况测试就需要模拟网络环境. ...

随机推荐

  1. Markdown简易语法说明

    html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,bi ...

  2. PowerShell安全修改Windows 10 登陆背景图

    PowerShell安全修改Windows 10 登陆背景图 可以把登陆的背景图换掉,主要是修改操作pri文件 $priPath = "$env:windir\SystemResources ...

  3. [转载] java多线程学习-java.util.concurrent详解(二)Semaphore/FutureTask/Exchanger

    转载自http://janeky.iteye.com/blog/770393 ------------------------------------------------------------- ...

  4. mysql数据库第一弹

    mysql(一) sql语句 sql是Structured Query Language(结构化查询语言)的缩写.SQL是专为数据库而建立的操作命令集,是一种功能齐全的数据库语言. 在使用它时,只需要 ...

  5. python 多线程批量传文件

    #!/usr/bin/env python #_*_ coding:utf-8 -*-#autho:leiyong#time:2017-06-05#version: 1.3 import parami ...

  6. System.UnauthorizedAccessException 错误

    给目录添加 "Authenticated Users" 这个用户的 读写权限

  7. 十五、Hadoop学习笔记————Zookeeper客户端的使用

    timeout表示会话超时时间,zookeeper靠与客户的心跳来判断会话是否有效(单位毫秒), -r为只读,表示zookeeper如果与半数以上服务器失去连接则会停止服务,如果有-r参数,则会继续保 ...

  8. 笔记(json)实现前后端交互案例

    1:首先创建一个项目如:(说明:此项目是在eclipse创建的) 2.在创建相对应的包如: 3.创建写好相对应的配置文件如: applicationContext.xml具体内容如下: <?xm ...

  9. HBase表预分区与压缩

    1.建立HBase预分区表.sql语句如下: create 'buyer_calllogs_info_ts', 'record', {SPLITS_FILE => 'hbase_calllogs ...

  10. web更改AD用户密码

    web更改AD用户密码 #web更改AD密码 #网站配置 绑定域名ad.test.cn 功能,更改AD用户密码 #参考http://bbs.51cto.com/thread-1379675-1.htm ...