思科路由器交换机学习

早上用cisco packet tracer练习配置cisco 3560交换机的时候发现在端口配置模式下无法配置端口的IP地址,

Switch>
Switch>enable
Switch#configure terminal
Switch(config)#interface f0/1
Switch(config-if)#?

dhcp

只有dhcp命令可用。在网上查了一下,原来交换机的端口默认都是switchport,也就是二层的交换端口,而IP地址是属于第三层的,所以要给端口配置IP地址,端口必须属于第三层

Switch>
Switch>enable
Switch#configure terminal
Switch(config)#interface f0/1
Switch(config-if)#no switchport         //启动三层功能
Switch(config-if)#ip address 192.168.0.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#end
这样就可以了。

二层交换机配置IP地址主要是为了管理设备,比如使用telnet、snmp等。三层交换机配置IP地址既可以用来管理设备,也可以用于通信,比如作为用户的默认网关。

原文地址:https://www.cnblogs.com/xianglongsdu/p/4590280.html