交换机的三层交换配置实验
创始人
2024-04-25 05:31:33
0

实验时间  2009年05月27日    13时~ 15时
实验人       子旭

实验名称  三层交换

实验目的

1、   VLAN之间的通信通过3层交换机来实现
2、   路由器为4个VLAN来分配IP地址
3、   PC1和PC2分别属于2个部门,能够得到IP地址
4、   PC1和PC2之间可以ping通。

实验拓扑

  
实验步骤 RA配置:
Router>en
Router#configure terminal
Router(config)#ho R1
R1(config)#line console 0
R1(config-line)#no exec-timeout
R1(config-line)#logging synchronous
R1(config-line)#exit
R1(config)#interface f0/0
R1(config-if)#ip address 1.1.1.2 255.0.0.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.1
R1(config)#ip dhcp pool 2
R1(dhcp-config)#network 192.168.2.0 /24
R1(dhcp-config)#default-router 192.168.2.1
R1(dhcp-config)#lease 7
R1(dhcp-config)#exit
R1(config)#ip dhcp pool 3
R1(dhcp-config)#default-router 192.168.3.1 /24
R1(dhcp-config)#default-router 192.168.3.1
R1(dhcp-config)#lease 7
R1(dhcp-config)#exit
S3(三层交换机)配置:
Router>enable
Router#config t
Router(config)#ho S3
S3(config)#no ip domain lookup
S3(config)#line console 0
S3(config-line)#no exec-timeout
S3(config-line)#logging synchronous
S3(config-line)#end
S3#vlan d
S3(vlan)#vlan 2
S3(vlan)#vlan 3
S3(vlan)#exit
S3(config)#inter f0/0
S3(config-if)#no switchport
S3(config-if)#ip address 1.1.1.1 255.0.0.0
S3(config-if)#no shut
S3(config-if)#exit
S3(config)#inter rang f0/1 - 2
S3(config-if)#sw mo tr
S3(config-if)#exit
S3(config)#ip routing
S3(config)#interface vlan 2
S3(config-if)#ip address 192.168.2.1 255.255.255.0
S3(config-if)#no shut
S3(config-if)#exit
S3(config)#interface vlan 3
S3(config-if)#ip address 192.168.3.1 255.255.255.0
S3(config-if)#no shut
S3(config-if)#exit
S3(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2
S3(config)#interface vlan 2
S3(config-if)#ip helper-address 1.1.1.2
S3(config-if)#exit
S3(config)#interface vlan 3
S3(config-if)#ip helper-address 1.1.1.2
S3(config-if)#exit
SA配置:
Router>en
Router#config t
Router(config)#ho Sa
Sa(config)#
Sa(config)#no ip domain lookup
Sa(config)#no ip routing
Sa(config)#line console 0
Sa(config-line)#no exec-timeout
Sa(config-line)#logg synchronous
Sa(config-line)#end
Sa#vlan d
Sa(vlan)#vlan 2
Sa(vlan)#exit
Sa#config t
Sa(config)#interface f0/0
Sa(config-if)#switchport access vlan 2
Sa(config-if)#exit
S3(config)#inter rang f0/1
S3(config-if)#sw mo tr
S3(config-if)#exit
SB配置:
Sb#config t
Sb(config)#no ip domain lookup
Sb(config)#no ip routing
Sb(config)#line console 0
Sb(config-line)#no exec-t
Sb(config-line)#logg synchronous
Sb(config-line)#end
Sb#vlan d
Sb(vlan)#vlan 3
Sb(vlan)#exit
Sb#config t
Sb(config)#interface f0/0
Sb(config-if)#switchport access vlan 3
Sb(config-if)#exit
S3(config)#inter rang f0/2
S3(config-if)#sw mo tr
S3(config-if)#exit

实验结论

二层设备在不同VLAN种通过三层交换做路由转发,由此能够让不同VLAN通信,同时也实现DHCP功能。

【编辑推荐】

  1. 高端交换机市场 思科同样面临激烈竞争
  2. 如何选择合适位置存放交换机配置文件
  3. 五个你从未用过的路由器与交换机功能

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...
《非诚勿扰》红人闫凤娇被曝厕所... 【51CTO.com 综合消息360安全专家提醒说,“闫凤娇”、“非诚勿扰”已经被黑客盯上成为了“木...
2012年第四季度互联网状况报... [[71653]]  北京时间4月25日消息,据国外媒体报道,全球知名的云平台公司Akamai Te...