配置三层路由口

路由口是一种三层逻辑接口,由单一物理接口组成,可用于连接一个子网。

Switch(config)#interface 接口!选择接口
Switch(config-if)#no switchport!转换成路由口
Switch(config-if)#ip address IP地址 子网掩码!配置地址
Switch(config-if)#no shutdown!激活接口

取消路由口:把一个路由口重新变为普通接口,取消后它上面的IP地址也随之失效。

Switch(config)#interface 接口!选择接口
Switch(config-if)#switchport!转换成交换口(普通接口)
配置f0/1口为路由口

Switch(config)#interface f0/1
Switch(config-if)#no switchport
Switch(config-if)#ip address 192.168.1.254 255.255.255.0
Switch(config-if)#no shutdown
配置f0/2口为路由口

Switch(config)#interface f0/2
Switch(config-if)#no switchport
Switch(config-if)#ip address 192.168.2.254 255.255.255.0
Switch(config-if)#no shutdown
查看接口配置情况

Switch#show ip interface brief
缩小
放大