分级网络设计(局域网设计方案)
接入层:为终端设备提供访问接口,实现了冲突域的隔离,VLAN的划分,交换机的端口安全
汇聚层:实现Vlan间通信,广播域的划分,并且定义了控制类型通信(路由更新、汇总、vlan间通信、地址聚合、访问控制、路由重分布)的策略。
核心层:快速转发。
Vlan的类型:
默认vlan:vlan号为1,默认情况下,所有的接口都是 vlan1
本地vlan:是主干端口的特征,当帧标记和本地vlan一样时,清除标记再发送;如果进入时没有帧标记则把本地vlan作为帧标记添加上。注意:主干端口的两端接口的本地vlan要匹配,否则会出错。通过 switchport trunk native vlan vlan-id 命令修改本地vlan。
数据vlan:用户产生的数据。
trunk的定义:
- Ethernet trunks carry the traffic of multiple VLANs over a single link
- A VLAN trunk allows you to extend the VLANs across an entire network
- A VLAN trunk does not belong to a specific VLAN
二层交换端口:
交换端口:access、trunk
聚合端口:应用于交换机之间的多链路捆绑技术。它的基本原理是:将两个设备间多条物理链路捆绑在一起组成一条逻辑链路,从而达到带宽倍增的目的(这条逻辑链路带宽相当于物理链路带宽之和)。除了增加带宽外,端口聚合还可以在多条链路上均衡分配流量,起到负载分担的作用;当一条或多条链路故障时,只要还有链路正常,流量将转移到其它的链路上,整个过程在几毫秒内完成,从而起到冗余的作用,增强了网络的稳定性和安全性。两台交换机之间是否形成EtherChannel也可以用协议自动协商。目前有两个协商协议:PAgP和LACP,PAgP(端口汇聚协议 Port Aggregation Protocol)是Cisco私有的协议,而LACP(链路汇聚控制协议 Link Aggregation Control Protocol)是基于IEEE 802.3ad的国际标准,是一种实现链路动态聚合的协议。
三层交换端口:
交换虚接口:VLAN Switch virtual interface ,SVI 可设置IP地址作为VLAN内主机的网关。
Routed Port:no switchport
L3 Aggregate Ports
VLAN配置
Switch(config)# vlan vlan-id
Switch(config-vlan)# name vlan-name
Switch(config)# no vlan vlan-id
Switch(config)# interface range {port-range}
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan vlan-id
Switch(config-if)#switchport mode trunk
Add: adds the vlan-list to join permission list.
Remove: removes the vlan-list VLAN from the permission list.
Except: 除了列出的vlan,其他都同意。
VLAN间通信
基于路由子接口的vlan间通信
Router(config-if)#no ip address
Router(config-if)#exit
Router(config)#interface fastEthernet 0/0.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 192.168.10.1 255.255.255.0
Router(config-subif)#exit
Router(config)#interface fastEthernet 0/0.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 192.168.20.1 255.255.255.0
Router(config-subif)#exit
Router(config)#interface fastEthernet 0/0.30
Router(config-subif)#encapsulation dot1Q 30
Router(config-subif)#ip address 192.168.30.1 255.255.255.0
Router(config-subif)#end
基于三层交换的vlan间路由
#配置交换虚接口,绑定到vlan-id
Switch(config)# interface vlan vlan-id
#配置vlan的ip
Switch(config-if)# ip address ip-address mask
上图实例解析:
S3750(config)#interface vlan 10
S3750(config-if)#exit
S3750(config-if)#ip address 192.168.20.1 255.255.255.0
S3750(config-if)#exit
S3750(config-if)#ip address 192.168.30.1 255.255.255.0
S3750(config-if)#end
Private VLAN
PVLAN类型
接口类型
通信范围
- primary VLAN:可以和所有他所关联的isolated VLAN,community VLAN通信。
- community VLAN:可以同那些处于相同community VLAN内的community port通信,也可以与pVLAN中的promiscuous端口通信。 (每个pVLAN可以有多个community VLAN)
- isolated VLAN:不可以和处于相同isolated VLAN内的其它isolated port通信,只可以与promiscuous端口通信。 (每个pVLAN中只能有一个isolated VLAN)
pVLAN当中使用的一些规则:
- 一个“Primary VLAN”当中至少有1个“Secondary VLAN”,没有上限。
- 一个“Primary VLAN”当中只能有1个“Isolated VLAN”,可以有多个“Community VLAN”。
- 不同“Primary VLAN”之间的任何端口都不能互相通信(这里“互相通信”是指二层连通性)。
- “Isolated端口”只能与“混杂端口”通信,除此之外不能与任何其他端口通信。
- “Community端口”可以和“混杂端口”通信,也可以和同一“Community VLAN”当中的其它物理端口进行通信,除此之外不能和其他端口通信。
通用的LAN的troubleshooting方法