三层交换机间的互联

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

如图,两台三层交换机3560,每台交换机底下都挂一个局域网,现要求两个局域网间能相互通信。

配置步骤:

1、用模拟器搭建如图所示的网络实训环境

2、配置PC0的IP地址为192.168.1.2,子网掩码为255.255.255.0,网关地址

为192.168.1.1.配置PC1的IP地址为192.168.2.2/24,网关地址为

192.168.2.1.

3、配置台交换机的基本信息:两台交换机分别命名为switchA、switchB;关

闭DNS服务;对交换机间的互联端口进行端口描述;管理vlan的IP;

交换机A的配置

Switch>

Switch>en

Switch#conf t

Switch(config)#hostname SwitchA

SwitchA(config)#no ip domain-lookup

SwitchA(config)#int f0/1

SwitchA(config-if)#description To-SwitchB-f0/1

SwitchA(config-if)#int f0/2

SwitchA(config-if)#description To-SwitchB-f0/2

SwitchA(config-if)#exit

SwitchA(config)#int vlan 1

SwitchA(config-if)#ip add 192.168.1.1 255.255.255.0

SwitchA(config-if)#no shut

交换机B的配置

Switch>

Switch>en

Switch#conf t

Switch(config)#host SwitchB

SwitchB(config)#no ip domain-lookup

SwitchB(config)#int f0/1

SwitchB(config-if)#des To-SwitchA-f0/1

SwitchB(config-if)#int f0/2

SwitchB(config-if)#des To-SwitchA-f0/2

SwitchB(config-if)#exit

SwitchB(config)#int vlan 1

SwitchB(config-if)#ip add 192.168.2.1 255.255.255.0

SwitchB(config-if)#no shut

配置完后,分别在PC上测试能否ping通网关,即在PC0上ping192.168.1.1,在PC1上ping192.168.2.1。正常能ping通,如果不通检查配置是否有错。

4、配置三层接口的端口汇聚:将交换机A的f0/1和f0/2与交换机B的f0/1和f0/2接口进行三层端口汇聚,汇聚后交换机A的通道接口地址设置为

172.16.1.2/30,交换机B的通道接口地址设置为172.16.1.3/30。

交换机A的配置

SwitchA(config)#int port-channel 1

SwitchA(config-if)#no switchport

SwitchA(config-if)#ip add 172.16.1.1 255.255.255.252

SwitchA(config-if)#no shut

SwitchA(config-if)#int f0/1

SwitchA(config-if)#no switchport

SwitchA(config-if)#channel-group 1 mode on

SwitchA(config-if)#no shut

SwitchA(config-if)#int f0/2

SwitchA(config-if)#no swit

SwitchA(config-if)#channel-g 1 mode on

SwitchA(config-if)#no shut

交换机B的配置

SwitchB(config)#int port-channel 1

SwitchB(config-if)#no switchport

SwitchB(config-if)#ip add 172.16.1.2 255.255.255.252

SwitchB(config-if)#no shut

SwitchB(config-if)#int f0/1

SwitchB(config-if)#no switchport

SwitchB(config-if)#channel-group 1 mode on

SwitchB(config-if)#no shut

SwitchB(config-if)#int f0/2

SwitchB(config-if)#no swit

SwitchB(config-if)#channel-g 1 mode on

SwitchB(config-if)#no shut

使用show etherchannel port-channel查看以太网通道配置信息

SwitchA#sho etherchannel port-channel

Channel-group listing:

----------------------

Group: 1

----------

Port-channels in the group:

---------------------------

Port-channel: Po1

------------

Age of the Port-channel = 00d:00h:17m:16s

Logical slot/port = 2/1 Number of ports = 2

GC = 0x00000000 HotStandBy port = null

Port state = Port-channel

Protocol = PAGP

Port Security = Disabled

Ports in the Port-channel:

Index Load Port EC state No of bits

------+------+------+------------------+-----------

0 00 Fa0/1 On 0

0 00 Fa0/2 On 0

Time since last port bundled: 00d:00h:03m:55s Fa0/2

配置完后,在交换机A上PING交换机B,两个地址应该能ping通。

SwitchA#ping 172.16.1.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds: .!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 31/78/218 ms

5、配置路由信息:在交换机A上配置到192.168.2.0/24网段的路由,下一跳指向172.16.1.2地址。在交换机B上配置到192.168.1.0/24网段的路由,下一跳指向172.16.1.1地址。

相关文档
最新文档