查看文章 |
三层交换 单臂路由实现VLAN之间通信 Router(config)#interface fastEthernet 0/0 Router(config)#interface fastEthernet 0/0.1 Router(config)#interface fastEthernet 0/0.2
单臂路由产生的瓶颈 数据量增大,路由器与交换机之间的路径会成为整个网络的瓶颈
三层交换机的配置 v 在三层交换机上启动路由 Switch(config)#ip routing v 配置VLAN 的IP地址 Switch (config)#interface vlan vlan-id Switch (config-if)#ip address Ip-address Subnet-mask Switch (config-if)#no shutdown v 查看FIB表 Switch (config)#show ip cef v 查看邻接关系表 Switch (config)#show adjacency detail v 在三层交换机上配置路由接口 Switch (config-if)#no switchport v 配置DHCP中继转发 Switch(config)#interface vlan vlan-id Switch(config-if)#ip helper-address Dhcpserver-address 三层交换机实现VLAN互通实例 v 在2层交换机上配置VLAN SW SW SW SW SW SW SW SW SW
v 在2层交换机上配制Trunk接口 SW SW v 在3层交换机上配置与2层交换机相同的VLAN(配置步骤与方法相同)
v 在3层交换机上启动路由 SW
v 在3层交换机上配置各VLAN的IP地址 SW SW SW SW SW SW SW SW SW
v 在3层交换机上查看路由表
SW Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - 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
C 192.168.1.0/24 is directly connected, Vlan1 C 192.168.2.0/24 is directly connected, Vlan2 C 192.168.3.0/24 is directly connected, Vlan3
v 在主机192.168.2.156上ping 192.168.3.156 C:\>ping 192.168.3.156
Pinging 192.168.3.156 with 32 bytes of data: Reply from 192.168.3.156: bytes=32 time<1ms TTL=254 Reply from 192.168.3.156: bytes=32 time<1ms TTL=254 Reply from 192.168.3.156: bytes=32 time<1ms TTL=254 Reply from 192.168.3.156: bytes=32 time<1ms TTL=254
Ping statistics for 192.168.3.156: Packets: Sent = 4, Received = 4, Lost = 0(0% loss)
v 查看FIB SW Prefix Next Hop Interface 192.168.1.0/24 attached Vlan1 192.168.1.0/32 receive 192.168.1.1/32 receive 192.168.1.255/32 receive 192.168.2.0/24 attached Vlan2 192.168.2.0/32 receive 192.168.2.1/32 receive 192.168.2.156/32 attached Vlan2 192.168.2.255/32 receive 192.168.3.0/24 attached Vlan3 192.168.3.0/32 receive 192.168.3.1/32 receive 192.168.3.156/32 attached Vlan3 192.168.3.255/32 receive 224.0.0.0/4 drop 224.0.0.0/24 receive 255.255.255.255/32 receive
SW Protocol Interface Address IP Vlan2 192.168.2.156(6) 0 packets, 0 bytes epoch 2 sourced in sev-epoch 1 Encap length 14 00061BE ARP IP Vlan3 192.168.3.156(6) 0 packets, 0 bytes epoch 2 sourced in sev-epoch 1 Encap length 14 ARP 在三层交换机上配置路由实例 v 在三层交换机上配置路由接口 SW SW SW SW
v 在路由器上配置路由 Router(config)#ip route 192.168.1.0 255.255.255.0 Router(config)#ip route 192.168.2.0 255.255.255.0 Router(config)#ip route 192.168.3.0 255.255.255.0
v 查看f0/23接口信息 SW Name: Fa0/23 Switchport: Disabled
v 显示交换机的路由表 SW Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - 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
C C 192.168.1.0/24 is directly connected, Vlan1 C 192.168.2.0/24 is directly connected, Vlan2 C 192.168.3.0/24 is directly connected, Vlan3 S* v 在各VLAN互通的前提下,配置DHCP中继服务 SW SW SW SW |