配置单臂路由

拓扑如下:

wKiom1g34Mbi6BT1AABDZBPB2U0875.png-wh_50

要求:PC2划分在VLAN10 ,PC2划分在VLAN 20,配置完成后测试PC2和PC3的连通性。

switch5:

switch#config t

switch(config)#vlan 10

switch(config)#vlan 20

switch(config)#interface fastEthernet 0/1

switch(config-if)#switchport mode access

switch(config-if)#switchport access vlan 10

switch(config)#interface fastEthernet 0/2

switch(config-if)#switchport mode access

switch(config-if)#switchport access vlan 20

switch(config)#interface fastEthernet 0/3

switch(config-if)#switchport mode trunk


Route0配置:

Route#config t

Route(config)#interface GigabitEthernet 0/0 

Route(config-if)#no shutdown

Route(config)#interface GigabitEthernet 0/0.10  配置子接口

Route(config-subif)#encapsulation dot1Q  配置封装协议

Route(config-subif)#ip address 192.168.10.1 255.255.255.0 配置网关

Route(config)#interface GigabitEthernet 0/0.20

Route(config-subif)#encapsulation dot1Q


Route(config-subif)#iaddress 192.168.20.1 255.255.255.0


配置PC2和PC3的IP地址网关

测试连通性:


wKioL1g36Ebh7K7pAABK8vsddhE846.png-wh_50

总结:

VLAN间路由实现由三种方式:

①路由器在每一个VLAN中使用一个接口

②使用三层交换机:SVI(虚接口)

③单臂路由


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章