Cisco Layer 3 switch enables IP routing
一、网络拓扑
二、三层交换机配置内容#vlan 11 // 创建 VLAN 11
#exit
#vlan 12 // 创建 VLAN 12
#exit
#vlan 13 // 创建 VLAN 13
#exit
#ip routing // 启用IP路由
#interface Vlan 11 // 创建 VLAN 11 的虚拟接口
#ip address 192.168.11.1 255.255.255.0 // 配置虚拟接口 VLAN 11 的IP地址
#exit
#interface Vlan 12 // 创建 VLAN 12 的虚拟接口
#ip address 192.168.12.1 255.255.255.0 // 配置虚拟接口 VLAN 12 的IP地址
#exit
#interface Vlan 13 // 创建 VLAN 13 的虚拟接口
#ip address 192.168.13.1 255.255.255.0 // 配置虚拟接口 VLAN 13 的IP地址
#exit
查看路由表状态
Switch>show 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 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 resort is not set
C 192.168.11.0/24 is directly connected, Vlan11
C 192.168.12.0/24 is directly connected, Vlan12
C 192.168.13.0/24 is directly connected, Vlan13
Switch>
三、二层交换机 Switch0 的配置内容
#interface FastEthernet 0/1
#switchport mode trunk // 设置接口工作模式为trunk
#exit
#interface FastEthernet 1/1
#switchport access vlan 11 // 设置接口绑定的 VLAN ID 为 11
#exit
#interface FastEthernet 2/1
#switchport access vlan 12 // 设置接口绑定的 VLAN ID 为 12
#exit
#interface FastEthernet 3/1
#switchport access vlan 13 // 设置接口绑定的 VLAN ID 为 13
#exit
查看 VLAN 信息
Switch#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa4/1, Fa5/1
11 VLAN0011 active Fa1/1
12 VLAN0012 active Fa2/1
13 VLAN0013 active Fa3/1
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Switch#
四、二层交换机 Switch1 的配置内容
#interface FastEthernet 0/1
#switchport mode trunk // 设置接口工作模式为trunk
#exit
#interface FastEthernet 1/1
#switchport access vlan 11 // 设置接口绑定的 VLAN ID 为 11
#exit
#interface FastEthernet 2/1
#switchport access vlan 12 // 设置接口绑定的 VLAN ID 为 12
#exit
#interface FastEthernet 3/1
#switchport access vlan 13 // 设置接口绑定的 VLAN ID 为 13
#exit
Switch#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa4/1, Fa5/1
11 VLAN0011 active Fa1/1
12 VLAN0012 active Fa2/1
13 VLAN0013 active Fa3/1
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Switch#
五、二层交换机 Switch2 的配置内容
#interface FastEthernet 0/1
#switchport mode trunk // 设置接口工作模式为trunk
#exit
#interface FastEthernet 1/1
#switchport access vlan 11 // 设置接口绑定的 VLAN ID 为 11
#exit
#interface FastEthernet 2/1
#switchport access vlan 12 // 设置接口绑定的 VLAN ID 为 12
#exit
#interface FastEthernet 3/1
#switchport access vlan 13 // 设置接口绑定的 VLAN ID 为 13
#exit
Switch#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa4/1, Fa5/1
11 VLAN0011 active Fa1/1
12 VLAN0012 active Fa2/1
13 VLAN0013 active Fa3/1
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Switch#
六、终端设备IP地址配置