三层交换机间的互联.docx

上传人:牧羊曲112 文档编号:3200986 上传时间:2023-03-11 格式:DOCX 页数:6 大小:38.24KB
返回 下载 相关 举报
三层交换机间的互联.docx_第1页
第1页 / 共6页
三层交换机间的互联.docx_第2页
第2页 / 共6页
三层交换机间的互联.docx_第3页
第3页 / 共6页
三层交换机间的互联.docx_第4页
第4页 / 共6页
三层交换机间的互联.docx_第5页
第5页 / 共6页
亲,该文档总共6页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《三层交换机间的互联.docx》由会员分享,可在线阅读,更多相关《三层交换机间的互联.docx(6页珍藏版)》请在三一办公上搜索。

1、三层交换机间的互联如图,两台三层交换机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 Switchen Switch#conf

2、 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.

3、168.1.1 255.255.255.0 SwitchA(config-if)#no shut 交换机B的配置 Switch Switchen 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)

4、#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的通道接口地址设置

5、为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 sh

6、ut 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)#i

7、nt 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

8、 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

9、 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 sec

10、onds: .! 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地址。 在配置前可先做些测试,如PC0 ping PC1,正常是不通的,因为交换机A没有到达192.168.2.0/24的路由。可在交换机A上查看路由表: SwitchA#sho ip route Codes: C - connected

11、, S - static, I - IGRP, 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, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-

12、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/30 is subnetted, 1 subnets C 172.16.1.0 is directly connected, Port-channel 1 C 192.168.1.0/24 is directly connected, Vlan1 交换机A的配置 SwitchA(config

13、)#ip route 192.168.2.0 255.255.255.0 172.16.1.2 交换机B的配置 SwitchB(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.1 配置完后,再查看路由表信息。 SwitchA#sho ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF

14、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, 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 r

15、esort is not set 172.16.0.0/30 is subnetted, 1 subnets C 172.16.1.0 is directly connected, Port-channel 1 C 192.168.1.0/24 is directly connected, Vlan1 S 192.168.2.0/24 1/0 via 172.16.1.2 新增加一条到达192.168.2.0/24的路由 这时,PC0与PC1间进行ping测试,发现能ping通了。 6、端口安全:交换机A的f0/4端口只允许连接MAC地址为0006.5bf7.9bb8或000a.c45d.78

16、16的主机。连接其他主机时将端口禁用。 SwitchA(config)#int f0/4 SwitchA(config-if)#switchport mode access SwitchA(config-if)#switchport port-security SwitchA(config-if)#switchport port-security maximum 2 SwitchA(config-if)#switchport port-security mac-address 0006.5bf7.9bb8 SwitchA(config-if)#switchport port-security mac-address 000a.c45d.7816 SwitchA(config-if)#switchport port-security violation shutdown SwitchA(config-if)#no shut 7、端口绑定:交换机A的f0/5端口只允许连接MAC地址为0007.3333.4444的主机,并且主机的IP地址固定的为192.168.1.10 。 SwitchA(config)#arp 192.168.1.10 0007.3333.4444 arpa f0/5

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号