01-交换机级联实验
1.交换机级联介绍
在多交换机的局域网环境中,级联技术可以实现多台交换机之间的互连。
级联可以定义为两台或两台以上的交换机通过一定的方式相互连接,根据需要,多台交换机可以以多种方式进行级联。在较大的局域网例如园区网(校园网)中,多台交换机按照性能和用途一般形成总线型、树型或星型的级联结构。
无论是10Base-T以太网、100Bas e-TX快速以太网还是1000Base-T千兆以太网,级联交换机所使用的电缆长度均可达到100米,这个长度与交换机到计算机之间长度完全相同。因此,级联除了能够扩充端口数量外,另外一个用途就是快速延伸网络直径。当有4台交换机级联时,网络跨度就可以达到500米。这样的距离对于位于同一座建筑 物内的小型网络而言已经足够了!
级联既可使用普通端口也可使用特殊的MDI-II端口。
2.四台交换机的级联实验
2.1实验拓扑
2.2 实验要求
LSW1-4分别连接1台终端,要求4台终端的网络互通,终端网络配置如下
终端 | IP | Netmask | Gateway |
PC1 | 10.0.1.1 | 255.255.255.0 | 10.0.1.254 |
PC2 | 10.0.2.1 | 255.255.255.0 | 10.0.2.254 |
PC3 | 10.0.3.1 | 255.255.255.0 | 10.0.3.254 |
PC4 | 10.0.4.1 | 255.255.255.0 | 10.0.4.254 |
2.3实验说明
在4台华为交换机上配置10/20/30/40vlan,将交换机互连的端口设置为trunk类型,允许4个vlan通过,然后在LSW4上给每个vlan指定IP
2.4实验配置
LSW1
vlan batch 10 20 30 40
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30 40
#
interface Ethernet0/0/4
port link-type access
port default vlan 10
LSW2
vlan batch 10 20 30 40
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30 40
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30 40
#
interface Ethernet0/0/3
#
interface Ethernet0/0/4
port link-type access
port default vlan 20
LSW3
vlan batch 10 20 30 40
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30 40
#
interface Ethernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30 40
#
interface Ethernet0/0/3
#
interface Ethernet0/0/4
port link-type access
port default vlan 20
LSW4
vlan batch 10 20 30 40
#
interface Vlanif10
ip address 10.0.1.254 255.255.255.0
#
interface Vlanif20
ip address 10.0.2.254 255.255.255.0
#
interface Vlanif30
ip address 10.0.3.254 255.255.255.0
#
interface Vlanif40
ip address 10.0.4.254 255.255.255.0
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20 30 40
#
interface Ethernet0/0/4
port link-type access
port default vlan 40
2.5实验结果
在每一台终端上可以ping通其他终端,则网络配置完成