配置在一台三层交换上,不同VLAN相互通信
通过在cisco catalyst 3550来规划VLAN 100 和VLAN 200,并且配置DHCP 让VLAN100人事部计算机获得IP地址为192.168.0.0/24,让VLAN200市场部计算机获得IP地址为172.16.0.0/24。因为市场部和人事部因为业务上的关系,需要两台服务器相互通信,所在还需要在3550上配置VLAN间相互通信。
实验过程 第一步 配置Catalyst 3550基础配置
Switch>
Switch>enable
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#host 3550
3550(config)#no ip do lo
3550(config)#line con 0
3550(config-line)#no exec-t
3550(config-line)#logg syn
3550(config-line)#exit
|
第二步 在Catalyst 3550 划分VLAN 100和VLAN 200
//进入全局配置模式下,划分VLAN(请问catalyst 3500支持在全局模式下划分VLAN吗?)
3550(config)#vlan 100
//给VLAN100命名
3550(config-vlan)#name renshibo
3550(config-vlan)#int f0/13
3550(config-if)#switchport mode access
3550(config-if)#switchport access vlan 100
3550(config-if)#spanning-tree portfast
//请问什么时候需要在交换机接口下配置portfast?这里如果不配置可以吗?
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/13 but will only
have effect when the interface is in a non-trunking mode.
3550(config-if)#vlan 200
3550(config-vlan)#name shichangbo
3550(config-vlan)#int f0/15
3550(config-if)#sw mo acc
3550(config-if)#sw acc vlan 200
3550(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/15 but will only
have effect when the interface is in a non-trunking mode.
//验证VLAN的配置
3550#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/14, Fa0/16, Fa0/17, Fa0/18
Fa0/23, Gi0/1, Gi0/2
100 renshibo active Fa0/13
200 shichangbo active Fa0/15
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
|
第三步 配置SVI(交换虚拟接口)
3550#conf t
Enter configuration commands, one per line. End with CNTL/Z.
//进入VLAN 100 虚拟接口下
3550(config)#int vlan 100
//增加接口描述,以便将来排错更加方便
3550(config-if)#description Connection to renshibo
//这里配置的IP地址就是人事部PC的默认网关地址,如果VLAN接口不配置IP地址,后面的DHCP配置中,PC能否获得IP地址吗??
3550(config-if)#ip add 192.168.0.1 255.255.255.0
3550(config-if)#no sh
3550(config-if)#int vlan 200
00:13:22: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan200, changed state to up
3550(config-if)#description Connection to shichangbo
3550(config-if)#ip add 172.16.0.1 255.255.255.0
3550(config-if)#no sh
3550(config-if)#
3550#conf t
//开启catalyst 3550三层交换路由功能(默认是关闭的)
请问cisco catalyst那些型号交换机是三层交换机?
3550(config)#ip routing
3550(config)#exit
3550#sh ip route
//两条直连路由条目
Codes: C - connected, S - static, 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, su - IS-IS summary, 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
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, Vlan200
C 192.168.0.0/24 is directly connected, Vlan100
Designated bridge has priority 32768, address ccd1.0a80.0000
Designated port id is 129.65, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 993, received 92
|
第四步 在Catalyst 3550上配置DHCP,以便于VLAN100和VLAN200下客户端获得IP地址,掩码,网关,DNS等
//全局下打开DHCP服务.默认是开启的吗?那为什么还要需要开启了?
3550(config)#service dhcp
//关闭dhcp 客户端IP冲突日志记录信息
3550(config)#no ip dhcp conflict logging
//配置地址池名称,地址池名称为任意字符(这里定义的名字VLAN的名称)
3550(config)#ip dhcp pool renshibo
//配置PC所获得网段地址范围,和掩码,(这里有几种命令语句格式)
(network 192.168.0.0 255.255.255.0)
3550(dhcp-config)#network 192.168.0.0 /24
//配置网关地址
3550(dhcp-config)#default-router 192.168.0.1
//配置DNS(域名解析服务器)可选配置
请问什么时候PC需要配置DNS地址?局域网通讯需要吗?
3550(dhcp-config)#dns 218.30.19.40 61.134.1.4
//配置域名
3550(dhcp-config)#domain-name www.cisco.com
//配置地址租期为永久
3550(dhcp-config)#lease infinite
3550(dhcp-config)#exit
//配置排除的IP地址范围,不从地址池内分配的地址,不配置排除地址可以吗?
3550(config)#ip dhcp excluded-address 192.168.0.1
3550(config)#ip dhcp pool shichangbo
3550(dhcp-config)#network 172.16.0.0 /24
3550(dhcp-config)#default-router 172.16.0.1
3550(dhcp-config)#dns 218.30.19.40 61.134.1.4
3550(dhcp-config)#domain-name www.cisco.com
3550(dhcp-config)#lease infinite
3550(dhcp-config)#exit
3550(config)#ip dhcp excluded-address 172.16.0.1
|
第五步 在市场部PC上验证是否能从catalyst 3550获得IP地址, 如图:开始-运行-cmd-ipconfig /all
第六步 在Catalyst 3550查看PC获得的IP地址是否正确
//查看DHCP绑定信息
3550#sh ip dhcp binding
IP address Client-ID/ (MAC地址) Lease expiration Type
Hardware address
172.16.0.2 0100.16d3.249f.fd Infinite Automatic
192.168.0.2 0100.1641.15e8.5c Infinite Automatic
|
第七步 在交换机测试是否可以ping通市场部和人事部PC
3550(config)#exit
3550#
00:26:41: %SYS-5-CONFIG_I: Configured from console by console
3550#ping 172.16.0.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
3550#ping 192.168.0.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
|
第八步 在市场部PC上用ping命令测试是否可以ping通VLAN100(人事部) 下PC 如图:测试结果如下,可以ping通,实验现象成功!
转载于:https://blog.51cto.com/1041201/228226
配置在一台三层交换上,不同VLAN相互通信相关推荐
- 交换机配置第七讲(不同vlan相互通信2)
1.实验介绍 内容为主机A和主机B配置不同的vlan希望他们能够通信,并且vlanif配置在不与PC机相连的交换机上. 设备规划 类型 名称 数量 终端 PC 2 交换机 S5700 2 vlan划分 ...
- 两台电脑上的虚拟机之间相互通信
我们的目标是想要在两个真实节点上的虚拟机之间实现互相通信. 我是在一台电脑上用VMware部署两个虚拟节点,一个master,一个node,组成一个小型kubernetes集群架构.现在的问题是,我想 ...
- 如何让两台PC通过一根网线相互通信?
1.如果是同类设备之间相连,比如PC-PC,交换机-交换机,需要用交叉线. 2.如果是不同类设备相连,比如PC-交换机,PC-路由器,需要用直连线. 之前用普通网线(直连线)连接笔记本A和笔记本B,在 ...
- VirtualBox 两台电脑上的虚拟机之间相互通信
因为要做一个Window Server 群集的测试,手头没有电脑资源,于是考虑用安装多台虚拟机来实现,这里主要解决虚拟机与主机所在局域网内其他电脑的连通问题. 参考:https://blog.csdn ...
- 思科三层交换机配置不同VLAN相互通信
三层交换机配置: Switch>enable Switch#configure terminal Switch(config)#vlan 10 Switch(config-vlan)#vla ...
- Vlan间通信原理(HCIA)
学习目标: 一.了解Vlan间通信原理 1.二层vlan间通信: 2.三层Vlan间通信: 二.二层间vlan同网段通信 1.利用Access接口特性: 2.利用Trunk本征Vlan特性: 3.利用 ...
- ping 不通 华为三层交换机vlan_华三两台三层华为交换机 vlan互访 配置
满意答案 罗志19850318 2015.05.17 采纳率:40% 等级:12 已帮助:3055人 (1)在二层交换机上配置VLAN2.VLAN3,分别将端口2.端口3划到VLAN2.VLAN ...
- 配置多台三层交换VLAN间相互通信
本实验需求: 通过在SW100 来创建VLAN 100 ,sw2 上创建VLAN 200,因为VLAN100和VLAN200因为业务上的关系,需要两台PC之间相互通信,保证不同VLAN之间可以互相访 ...
- 一台交换机不同vlan如何通信
前几天写了一篇关于单臂路由的文章,后面有一些关于acess和trunk转发机制的分析 ,今天就在其基础上做一个分析. 同一台交换机的不同vlan如何通信 我想大家都明白,一个vlan就是一个广播域.如 ...
- 思科模拟器:通过一台三层交换机及两台二层交换机和6台电脑划分3个VLAN,并建立三个网关让电脑之间互通
实验内容:通过一台三层交换机及两台二层交换机和6台电脑划分3个VLAN,并建立三个网关让电脑之间互通 实验工具:Cisco Packet Tracer 6.0 使用设备: 电脑六台(电脑1.电脑2.电 ...
最新文章
- Python学习之路29-序列的修改、散列和切片
- 皮一皮:碰到这样的领导怎么办...
- uva1515(模拟)
- linux优盘驱动目录,Linux U盘加载阵列卡驱动步骤(.dd或img).doc
- 服务器机房新风系统,某机房新风系统设计方案参考
- mybatis 控制台打印执行的SQL语句
- 数据库设计_数据库设计(一)分析及逻辑设计
- 官网下载JDK需要登陆的Oracle账号
- Redis中的管道有什么用?
- Kubernetes网络模型概念
- 管理感悟:建议工作文档多使用表格EXCEL
- matlab方差分析
- 忘了她,就像忘了一朵花
- (零基础)入门python学习四步骤,附上Python全栈学习路线大刚!
- asm磁盘头自动备份19c-au11
- CentOS 8.5下安装R语言经验总结
- LeetCode 91~95
- 求两点之间的最短路径
- ipv4和ipv6连通性相关工具实例
- 三顾茅庐,四面阿里,28k*15offer,分享我的大厂面经