配置VLAN(划分VLAN起到隔离的作用)
Switch#vlan database
Switch(vlan)#vlan 2//创建VLAN
Switch(config)#in f0/2//进接口
Switch(config-if)#switchport mode access//把交换机的接口模式改为接入(access)模式
*交换机接口有三在模式1.access2.trunk 3.QinQ其中access是接入模式主要接主机的接口
Switch(config-if)#switchport access vlan 2//端口划分给vlan2
Switch#show vlan brief//查看VLAN信息
配置Trunk(实现不同交换机下的同一个vlan都能互相访问)
Switch(config)#in f0/24
Switch(config-if)#switchport mode trunk
Switch#show running-config
Switch#show interfaces trunk
配置默认路由与静态路由
Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2
Router(config)#ip route 目的IP 子网掩码 下一跳IP
Router#show ip route
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END